Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        _scoreManager        = GetComponent <ScoreManager> ();
        _comboManager        = GetComponent <ComboManager> ();
        _moraleManager       = GetComponent <MoraleManager> ();
        _playerHealthManager = GetComponent <PlayerHealthManager> ();
        _enemyHealthManager  = GetComponent <EnemyHealthManager> ();

        _playerHealthManager.BindDeathEvent(Lose);
        _enemyHealthManager.BindDeathEvent(Win);
    }
Esempio n. 2
0
    // Use this for initialization
    protected override void SetUp()
    {
        _gameControllerObject = GameObject.FindWithTag("GameController");
        if (_gameControllerObject != null)
        {
            _scoreController = _gameControllerObject.GetComponent <ScoreController>();
        }

        _scoreManager        = _gameControllerObject.GetComponent <ScoreManager> ();
        _comboManager        = _gameControllerObject.GetComponent <ComboManager> ();
        _moraleManager       = _gameControllerObject.GetComponent <MoraleManager> ();
        _playerHealthManager = _gameControllerObject.GetComponent <PlayerHealthManager> ();
        _enemyHealthManager  = _gameControllerObject.GetComponent <EnemyHealthManager> ();
    }
Esempio n. 3
0
    private void Awake()
    {
        // Singleton pattern that makes sure that there is only one MoraleManager
        if (instance)
        {
            Destroy(gameObject);
        }
        else
        {
            instance = this;
        }

        shipStatsUI = FindObjectOfType <ShipStatsUI>();
        ship        = GameObject.FindObjectOfType <ShipStats>();
        if (!ship)
        {
            print("Could not find ship");
        }
    }