Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        uiManager   = GameObject.Find("Canvas").GetComponent <UIManager>();
        gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();

        if (uiManager)
        {
            uiManager.UpdateLives(lifes);
        }

        spawn_Manager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();

        if (spawn_Manager)
        {
            spawn_Manager.StartSpawnRoutines();
        }

        audioSource = GetComponent <AudioSource>();
    }
Esempio n. 2
0
    void Start()
    {
        transform.position = new Vector3(0, 0, 0);
        _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();

        if (_uiManager != null)
        {
            _uiManager.UpdateLives(lives);
        }

        _gameManager  = GameObject.Find("GameManager").GetComponent <GameManager>();
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();

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

        _audioSource = GetComponent <AudioSource>();
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        //get the ui manager component
        _UIManager = GameObject.Find("Canvas").GetComponent <UI_Manager>();

        //update the lives counter according to the player lives
        _UIManager.UpdateLives(playerLives);

        //get the spawn manager component
        _spawnManager = GameObject.Find("Spawn Manager").GetComponent <Spawn_Manager>();

        //get the audio source
        _laserSound = GetComponent <AudioSource>();

        //run the spawning coroutines after a nullcheck
        if (_spawnManager != null)
        {
            _spawnManager.StartSpawnRoutines();
        }
    }