Exemplo n.º 1
0
 public void AddObstacleDestroying()
 {
     ++_alreadyDestroyedObstacles;
     OnWinConditionValueChanged?.Invoke(_alreadyDestroyedObstacles);
     if (_alreadyDestroyedObstacles >= _destroyedObstaclesToWin)
     {
         OnPlayerWin();
     }
 }
Exemplo n.º 2
0
    private void Start()
    {
        OnWinConditionValueChanged?.Invoke(_alreadyDestroyedObstacles);

        if (_controller == null)
        {
            _controller = FindObjectOfType <UIViewController>();
        }

        if (_player == null)
        {
            _player = FindObjectOfType <Player>();
        }

        _playerDestroyable = _player.GetComponent <Destroyable>();

        _playerDestroyable.OnDeath += OnPlayerDeath;
    }