// Use this for initialization
    void Start()
    {
        _audioSource  = GetComponent <AudioSource>();
        _spawnManager = GameObject.Find("SpawnManager").GetComponent <Spawn_Manager>();
        // _spawnManager.StartSpawnRoutine();
        _uiManager = GameObject.Find("Canvas").GetComponent <UIManager>();
        if (_uiManager != null)
        {
            _uiManager.UpdateLives(playerHealth);
        }
        transform.position = new Vector3(0, 0, 0);
        _gameManager       = GameObject.Find("GameManager").GetComponent <GameManager>();

        if (_spawnManager != null)
        {
            _spawnManager.StartSpawnRoutine();
        }
        _hitCount = 0;
    }
Exemple #2
0
    void Start()
    {
        transform.position = new Vector3(0, 0, 0);
        Debug.Log("Game begins");

        _uimManager   = GameObject.Find("Canvas").GetComponent <UIManager>();
        _gamemanger   = GameObject.Find("GameManager").GetComponent <GameManager>();
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();

        if (_spawnManager != null)
        {
            _spawnManager.StartSpawnRoutine();
        }

        if (_uimManager != null)
        {
            _uimManager.UpdateLives(_lifes);
        }

        _audioSource = GetComponent <AudioSource>();

        hitCount = 0;
    }