Ejemplo n.º 1
0
    void Awake()
    {
        //get the external gameobject and scripts
        _cannon                      = GameObject.Find("Cannon");
        _shootCannonScript           = (ShootCannon)_cannon.GetComponent(typeof(ShootCannon));
        _enemyController             = GameObject.Find("EnemyController");
        _enemyControllerScript       = (EnemyController)_enemyController.GetComponent(typeof(EnemyController));
        _ingameButtonManagerScript   = (IngameButtonManager)GameObject.Find("UI Button Controller").GetComponent(typeof(IngameButtonManager));
        _resultSpawnAnimEventsScript = (ResultSpawnAnimEvents)GameObject.Find("Operators/ResultSpawn").GetComponent(typeof(ResultSpawnAnimEvents));


        //get internal scripts of the GameController
        _calculateScript        = GetComponent <Calculate>();
        _spawnCratesScript      = GetComponent <SpawnCrates>();
        _dragandDropScript      = GetComponent <DragAndDrop>();
        _playerControllerScript = GetComponent <PlayerController>();

        //sound
        _audioSourceCalculate = GameObject.Find("GameController/Sound/Calculate").GetComponent <AudioSource>();
        _loadTooMuch          = GameObject.Find("GameController/Sound/Calculate/Result Too High").GetComponent <SoundClips>().AudioClipsArray;
        _loadTooLittle        = GameObject.Find("GameController/Sound/Calculate/Result Too Low").GetComponent <SoundClips>().AudioClipsArray;

        //animation
        _animatorCannon    = GameObject.Find("Cannon").GetComponent <Animator>();
        _animatorOperators = GameObject.Find("Operators").GetComponent <Animator>();
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     instance = this;
 }