Ejemplo n.º 1
0
		protected override void OnUpdate(float timeStep)
		{
			var input = Input;

			const float duration = 1f; //2s
			FiniteTimeAction action = null;

			if (input.GetKeyPress(Key.W))
			{
				action = new MoveBy(duration, new Vector3(0, 0, 5));
			}

			if (input.GetKeyPress(Key.S))
			{
				action = new MoveBy(duration, new Vector3(0, 0, -5));
			}

			if (input.GetKeyPress(Key.E))
			{
				action = new FadeIn(duration); 
			}

			if (input.GetKeyPress(Key.Q))
			{
				action = new FadeOut(duration);
			}

			if (input.GetKeyPress(Key.R))
			{
				action = new EaseElasticInOut(new ScaleBy(duration, 1.3f));
			}

			if (input.GetKeyPress(Key.G))
			{
				action = new TintTo(duration, NextRandom(1), NextRandom(1), NextRandom(1));
			}

			if (action != null)
			{
				//can be awaited
				boxNode.RunActionsAsync(action);
			}
			base.OnUpdate(timeStep);
		}
Ejemplo n.º 2
0
 public EaseElasticInOutState(EaseElasticInOut action, Node target) : base(action, target)
 {
 }
Ejemplo n.º 3
0
		public EaseElasticInOutState (EaseElasticInOut action, Node target) : base (action, target)
		{
		}