Пример #1
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Minus))
        {
            ChangeLifeAction(-1);
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (HeldPowerUp != null)
            {
                HeldPowerUp.Use();
                HeldPowerUp = null;
                UIManager.UpdateUI_ClearPowerUp();
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (!IsPaused)
            {
                IsPaused       = true;
                Time.timeScale = 0f;
            }
            else if (IsPaused)
            {
                IsPaused       = false;
                Time.timeScale = 1f;
            }
        }
    }
 public void UsePowerUp(Direction d)
 {
     Debug.Log("i am _playerIndex " + _playerIndex);
     if (currPowerUp != null)
     {
         currPowerUp.Use(d, _playerIndex);
         if (currPowerUp.RemainingUsages <= 0)
         {
             currPowerUp = null;
             ((GameManager)GameManager.GM).UpdatePowerup(_playerIndex, null);
         }
     }
 }