SamplyGame.Aircraft.Hit C# (CSharp) Method

Hit() private method

private Hit ( ) : void
return void
		async void Hit()
		{
			var material = Node.GetComponent<StaticModel>().GetMaterial(0);
			if (material == null)
				return;
			//NOTE: the material should not be cached (Clone() should be called) or all object with it will be blinking
			material.SetShaderParameter("MatSpecColor", new Color(0, 0, 0, 0));
			var specColorAnimation = new ValueAnimation();
			specColorAnimation.SetKeyFrame(0.0f, new Color(1.0f, 1.0f, 1.0f, 0.5f));
			specColorAnimation.SetKeyFrame(0.1f, new Color(0, 0, 0, 0));
			material.SetShaderParameterAnimation("MatSpecColor", specColorAnimation, WrapMode.Once, 1.0f);
			await Node.RunActionsAsync(new DelayTime(1f));
		}