Ejemplo n.º 1
0
        public override void Update()
        {
            if (on && Timer > 0)
            {
                Timer -= Engine.DeltaTime;
                if (Timer <= 0)
                {
                    on    = false;
                    Value = Vector2.Zero;
                    if (OnShake != null)
                    {
                        OnShake(Vector2.Zero);
                    }
                    if (RemoveOnFinish)
                    {
                        RemoveSelf();
                    }
                    return;
                }
            }

            if (on && Scene.OnInterval(Interval))
            {
                Value = Calc.Random.ShakeVector();
                if (OnShake != null)
                {
                    OnShake(Value);
                }
            }
        }
Ejemplo n.º 2
0
        public override void Update()
        {
            if (on && Timer > 0)
            {
                Timer -= Engine.DeltaTime;
                if (Timer <= 0)
                {
                    on = false;
                    for (var i = 0; i < Values.Length; i++)
                    {
                        Values[i] = Vector2.Zero;
                    }
                    if (OnShake != null)
                    {
                        OnShake(Values);
                    }
                    if (RemoveOnFinish)
                    {
                        RemoveSelf();
                    }
                    return;
                }
            }

            if (on && Scene.OnInterval(Interval))
            {
                for (var i = 0; i < Values.Length; i++)
                {
                    Values[i] = Calc.Random.ShakeVector();
                }
                if (OnShake != null)
                {
                    OnShake(Values);
                }
            }
        }