Esempio n. 1
0
 void InputKey()
 {
     if (Input.GetKeyDown(KeyCode.RightArrow))
     {
         _root.ForceShake(1, 1, .1f, 2f);
         if (_left)
         {
             _moveTimer++;
             //TODO::Play the animation
             if (_moveTimer >= 5)
             {
                 _left = false;
                 Dead();
             }
         }
     }
     if (Input.GetKeyDown(KeyCode.LeftArrow))
     {
         _root.ForceShake(-1, 1, .1f, 2f);
         if (_right)
         {
             _moveTimer++;
             //TODO::Play the animation
             if (_moveTimer >= 5)
             {
                 _right = false;
                 Dead();
             }
         }
     }
 }
Esempio n. 2
0
    public void HitWindow()
    {
        _root.PlayDecodeFailedSound();

        if (_alienAttackManager._left)
        {
            _root.AttackSoundLeft();
            _root.ForceShake(1, 2, .1f);
        }

        if (_alienAttackManager._right)
        {
            _root.AttackSoundRight();
            _root.ForceShake(-1, 2, .1f);
        }

        GameObject go = GameObject.FindGameObjectWithTag("Signal");

        if (go)
        {
            go.GetComponent <Signal>().Disorder();
        }
    }