void Start()
 {
     _audioSource          = GetComponent <AudioSource>();
     _playerRb             = GetComponent <Rigidbody2D>();
     _playerSpriteRenderer = GetComponent <SpriteRenderer>();
     _spawnManager         = GameObject.Find("Spawn Manager").GetComponent <Spawn_Manager>();
     _mainCam   = GameObject.FindWithTag("MainCamera").GetComponent <Camera>();
     _renderers = GetComponentsInChildren <Renderer>();
     _uiManager = GameObject.Find("Canvas").GetComponent <UI_Manager>();
     if (_uiManager == null)
     {
         Debug.LogError("The UI Manager is NULL!");
     }
     if (_audioSource == null)
     {
         Debug.LogError("The AudioSource is NULL!");
     }
     else
     {
         _audioSource.clip = _bulletSoundClip;
     }
     if (_spawnManager == null)
     {
         Debug.Log("Spawn Manager is NULL - Asteroid.cs");
     }
 }
Пример #2
0
    // Start is called before the first frame update
    void Start()
    {
        // get an instance of the spawn manager from the game.
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();

        _explosionSound = GameObject.Find("Explosion_Sound").GetComponent <AudioSource>();
    }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        transform.position = new Vector3(0, 0, 0);
        _spawnManager      = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();
        _audioSource       = GetComponent <AudioSource>();

        if (_spawnManager == null)
        {
            Debug.LogError("The Spawn_Manager is NULL!");
        }

        if (_uiManager == null)
        {
            Debug.LogError("The UI Manager is NULL");
        }

        if (_audioSource == null)
        {
            Debug.LogError("AudioSource on the Player is null");
        }
        else
        {
            _audioSource.clip = _laserSound;
        }
    }
Пример #4
0
    public void MaxMatchs()

    {
        Debug.Log(actualMatchs);
        if (actualMatchs >= 3)
        {
            if (actualTag == "Cube")
            {
                audio.clip = lifeSound;
                audio.Play();
                PlayerHpBar();
                actualTag = null;
            }
            if (actualTag == "Triangle")
            {
                audio.clip = damageSound;
                audio.Play();
                EnnemyHpBar();
                actualTag = null;
            }
            if (actualTag == "Circle")
            {
                EnnemyShieldBar();
                actualTag = null;
            }
            Spawn_Manager.Instance().UnSpawnForms();
            Spawn_Manager.Instance().StartingIdx();
            actualMatchs      = 0;
            isSelectionActive = false;
            ResetTimer();
        }
    }
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine("onInitStart");
        _shieldsPrefab.SetActive(false);

        // get a reference to the UI manager script
        _uiManager = GameObject.Find("Canvas").GetComponent <UI_Manager>();
        if (_uiManager == null)
        {
            Debug.Log("The UI manager is Null.");
        }

        // get an instance of the Spawn_Manager.
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        if (_spawnManager == null)
        {
            Debug.Log("Spawn Manager is NULL.");
        }

        // Get the sound objects
        _laserShot = GameObject.Find("LaserShot").GetComponent <AudioSource>();
        {
            if (_laserShot == null)
            {
                Debug.Log("LaserShot is null.");
            }
        }
        _explosionSound = GameObject.Find("Explosion_Sound").GetComponent <AudioSource>();
        {
            if (_explosionSound == null)
            {
                Debug.Log("Explosion is null.");
            }
        }
    }
Пример #6
0
    // Start is called before the first frame update
    void Start()
    {
        // Snap the player object to the origin point 0,0,0 when the game starts.
        transform.position = new Vector3(0, 0, 0);
        _spawnManager      = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();
        _audioSource       = GetComponent <AudioSource>();
        _sprintActive      = false;

        if (_spawnManager == null)
        {
            Debug.LogError("The Spawn Manager is NULL.");
        }

        if (_uiManager == null)
        {
            Debug.LogError("The UI Manager is NULL.");
        }

        if (_audioSource == null)
        {
            Debug.LogError("AudioSource on the player is NULL.");
        }
        else
        {
            _audioSource.clip = _laserSoundClip;
        }
    }
Пример #7
0
 // Start is called before the first frame update
 void Start()
 {
     transform.position = new Vector3(0, 0, 0);
     spawnManager       = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
     if (spawnManager == null)
     {
         Debug.LogError("The Spawn Manager is NULL");
     }
 }
Пример #8
0
    private void Start()
    {
        transform.position = new Vector3(0, 0, 0);
        _spawnManager      = FindObjectOfType <Spawn_Manager>().GetComponent <Spawn_Manager>();
        _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();
        _audioSource       = GetComponent <AudioSource>();

        _audioSource.clip = _laserSoundClip;
    }
Пример #9
0
    ///// public bool value1 = Input.GetKey("up");
    // public bool value2 = Input.GetKey("down");
    // Use this for initialization
    void Start()
    {
        _gamemanager = GameObject.Find("GameManager").GetComponent <GameManager>();
        _uimanager   = GameObject.Find("Canvas").GetComponent <UImanager>();
        _uimanager.UpdateLives(life);

        _spawnmanager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _spawnmanager.startSpawn();
        audio = GetComponent <AudioSource>();
    }
Пример #10
0
    // Start is called before the first frame update
    void Start()
    {
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();


        if (_spawnManager == null)
        {
            Debug.LogError("The Spawn Manager is NULL.");
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        cpos = new Vector3(0, 0, 0);
        transform.position = cpos;
        _spawn_Manager     = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();

        if (_spawn_Manager == null)
        {
            Debug.Log("the Spawn manager is NULL");
        }
    }
Пример #12
0
 void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Пример #13
0
    void Awake()
    {
        spawn_Manager     = GameObject.Find(SPAWNMANAGER).GetComponent <Spawn_Manager>() ?? null;
        uI_Manager        = GameObject.Find(CANVAS).GetComponent <UI_Manager>() ?? null;
        gameManager       = GameObject.Find(GAMEMANAGER).GetComponent <GameManager>() ?? null;
        _audioSource      = GetComponent <AudioSource>() ?? null;
        animator          = GetComponent <Animator>() ?? null;
        _audioSource.clip = _laserClip;

        if (!gameManager.CoopMode())
        {
            transform.position = new Vector3(0, 0, 0);
        }
    }
Пример #14
0
    // Start is called before the first frame update
    void Start()
    {
        transform.position = new Vector3(0, 0, 0);
        _spawnManager      = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();

        if (_spawnManager == null)
        {
            Debug.LogError("The Spawn Manager is NULL in Player.cs");
        }
        if (_uiManager == null)
        {
            Debug.LogError("The UIManager is NULL in Player.cs");
        }
    }
Пример #15
0
    // Start is called before the first frame update
    void Awake()
    {
        if (_Instace == null)
        {
            _Instace = this;
        }

        if (_Spawn_Manager == null)
        {
            _Spawn_Manager = GetComponent <Spawn_Manager> ();
        }

        _Medicine   = 5;
        _Timer      = d_Timer;
        useMedicine = false;
    }
Пример #16
0
    public void CooldownTimer()

    {
        if (timerActive)
        {
            tmpTimer -= Time.deltaTime;
            timerImage.fillAmount = tmpTimer / timerInSeconds;
            if (tmpTimer <= 0.0f)
            {
                tmpTimer = 0;
                ResetTimer();
                ennemyShield.fillAmount += ennemyShieldRecover;
                Spawn_Manager.Instance().UnSpawnForms();
                Spawn_Manager.Instance().StartingIdx();
            }
        }
    }
Пример #17
0
    void Start()
    {
        transform.position = new Vector3(0, -3.0f, 0);
        _spawnManager      = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();
        _audioSource       = GetComponent <AudioSource>();
        _audioSource.clip  = _laserSoundClip;

        //if(_spawnManager != null)
        //{
        //	Debug.LogError("SpawnManger is Null");
        //}

        //if(_uiManager == null)
        //{
        //	Debug.LogError("UI Manager is Empty");
        //}
    }
Пример #18
0
    private void Start()
    {
        _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 (_gameManager.isCoopMode == false)
        {
            transform.position = new Vector3(0, 0, 0);
        }
        _hitCount    = 0;
        _audioSource = GetComponent <AudioSource>();
    }
Пример #19
0
    public void CooldownTimer()

    {
        tmpTimer -= Time.deltaTime;
        timerImage.fillAmount = tmpTimer / timerInSeconds;
        if (tmpTimer <= 0.0f)
        {
            tmpTimer = 0;
            ResetTimer();
            ennemyShield.fillAmount += ennemyShieldRecover;
            audio.clip = timerSound;
            audio.Play();
            Spawn_Manager.Instance().UnSpawnForms();
            Spawn_Manager.Instance().StartingIdx();
            actualMatchs      = 0;
            isSelectionActive = false;
        }
    }
Пример #20
0
    // Start is called before the first frame update
    void Start()
    {
        transform.position = new Vector3(0, -2.5f, 0);

        _uiManager    = GameObject.Find("Canvas").GetComponent <UIManager>();
        _gameManager  = GameObject.Find("GameManager").GetComponent <GameManager>();
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _audioSource  = GetComponent <AudioSource>();

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

        if (_spawnManager != null)
        {
            _spawnManager.StartSpawn();
        }
    }
Пример #21
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>();
    }
Пример #22
0
    // 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;
    }
Пример #23
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();
        }
    }
Пример #24
0
    void Start()
    {
        SetPlayerStartPosition();
        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        _uiManager    = GameObject.Find("Canvas").GetComponent <UI_Manager>();
        if (_uiManager == null)
        {
            Debug.LogError("UI Manager is Null!");
        }
        SpawnManagerNullCheck();

        _audioSource = GetComponent <AudioSource>();
        if (_audioSource == null)
        {
            Debug.LogError("Audio Source is Null!");
        }
        else
        {
            _audioSource.clip = _laserSoundClip;
        }
    }
Пример #25
0
    // Use this for initialization
    void Start()
    {
        transform.position = new Vector3(0, 0, 0);

        _uI_Manager = GameObject.Find("Canvas").GetComponent <UI_Manager>();
        if (_uI_Manager != null)
        {
            _uI_Manager.UpdateLives(_health);
        }

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

        _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
        if (_spawnManager != null)
        {
            _spawnManager.StartSpawning();
        }

        _audioSource = GetComponent <AudioSource>();

        _hitCount = 0;
    }
Пример #26
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;
    }
Пример #27
0
    void Start()
    {
        transform.position = new Vector3(0, -3, 0);
        _shield.gameObject.SetActive(false);

        _uiManager = GameObject.Find("Canvas").GetComponent <UIManager>();

        _audioSourse = GetComponent <AudioSource>();

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

        if (_spawn_Manager == null)
        {
            Debug.LogError("The Spawn Manager is NULL.");
        }

        if (_uiManager == null)
        {
            Debug.LogError("The UI Manager is NULL.");
        }

        if (_audioSourse == null)
        {
            Debug.LogError("The AudioSource on the player is NULL.");
        }
        else
        {
            _audioSourse.clip = _laserSoundClip;
        }

        _anim = GetComponent <Animator>();

        _currentLevel = 1;

        _enemy.enemyLevel = 1;
    }
Пример #28
0
 void Start()
 {
     //take the current postion =new postion (0,0,0)
     transform.position = new Vector3(0, -2f, 0);
     _audiosource       = GetComponent <AudioSource>();
     _uiManager         = GameObject.Find("Canvas").GetComponent <UIManager>();
     _spawnmanager      = GameObject.Find("SpawnManager").GetComponent <Spawn_Manager>();
     if (_spawnmanager == null)
     {
         Debug.LogError("Hey dont ship");
     }
     if (_uiManager == null)
     {
         Debug.LogError("Hey UI manager is null");
     }
     if (_audiosource == null)
     {
         Debug.LogError("Audio Source of player is NULL");
     }
     else
     {
         _audiosource.clip = _laserSoundClip;
     }
 }
Пример #29
0
 private void Start()
 {
     _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
     _uiManager    = GameObject.Find("Canvas").GetComponent <UIManager>();
 }
Пример #30
0
 // Start is called before the first frame update
 void Start()
 {
     Player_ControlerScript = GameObject.Find("Player").GetComponent <Player_Controler>();
     spawnM = GameObject.Find("Spawn_Manager").GetComponent <Spawn_Manager>();
 }