public void Update()
        {
            _TimeInHitLag -= Time.deltaTime;

            if (_TimeInHitLag <= 0)
            {
                _Player.SwitchState(_PreviousState);
            }
        }
 public void OnCollisionEnter(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("Wall"))
     {
         _Player._Audio.Play();
         _Player._WallBounce = true;
         _Player.SwitchState(new HitStun(_Player, _Player._State, 0.4f, 0.4f));
     }
 }
Esempio n. 3
0
 public void Reset1()
 {
     if (_Player1Points == _Rounds)
     {
         _Player1.enabled = false;
         _Player2.enabled = false;
         _WinScreen.gameObject.SetActive(true);
         _WinScreen.text = "WASD GH wins Press Start";
     }
     else
     {
         _Player1Input.enabled = true;
         _Player2Input.enabled = true;
         _Player1.SwitchState(new Idle(_Player1));
         _Player2.SwitchState(new Idle(_Player2));
         _Player1.transform.position = _Player1._StartPosition;
         _Player2.transform.position = _Player2._StartPosition;
     }
 }
        public void Update()
        {
            _TimeInHitLag -= Time.deltaTime;
            _Intensity    -= Time.deltaTime;
            _Player.transform.position = _Preposition + (Random.insideUnitCircle * _Intensity);

            if (_TimeInHitLag <= 0)
            {
                _Player.SwitchState(_PreviousState);
            }
        }
        public void Update()
        {
            if (_Player._Inputs._RightButtonUp)
            {
                _Player.SwitchState(new Idle(_Player));
            }

            if (_Player._Inputs._LeftButtonDown)
            {
                _Player.SwitchState(new FWalk(_Player));
            }

            if (_Player._Inputs._AttackButtonDown)
            {
                _Player.SwitchState(new Sweep(_Player));
            }

            if (_Player._Inputs._TauntButtonDown)
            {
                _Player.SwitchState(new Taunt(_Player));
            }
        }