Ejemplo n.º 1
0
        void SetInitialReferences()
        {
            gameManagerMaster = GetComponent <GameManager_Master>();

            animatedObjs = GameObject.FindGameObjectsWithTag("pausable");
            enemyObjs    = GameObject.FindGameObjectsWithTag("Enemy");
            particleObjs = GameObject.FindGameObjectsWithTag("Particles");

            anims = new Animator[animatedObjs.Length];
            for (int i = 0; i < animatedObjs.Length; i++)
            {
                anims[i] = animatedObjs[i].GetComponent <Animator>();
            }

            particles = new ParticleSystem[particleObjs.Length];
            for (int i = 0; i < particleObjs.Length; i++)
            {
                particles[i] = particleObjs[i].GetComponent <ParticleSystem>();
            }

            enemyAnims = new Animator[enemyObjs.Length];
            for (int i = 0; i < enemyObjs.Length; i++)
            {
                enemyAnims[i] = enemyObjs[i].GetComponent <Animator>();
            }

            navAgents = new NavMeshAgent[enemyObjs.Length];
            for (int i = 0; i < enemyObjs.Length; i++)
            {
                if (enemyObjs[i].GetComponent <NavMeshAgent>() != null)
                {
                    navAgents[i] = enemyObjs[i].GetComponent <NavMeshAgent>();
                }
            }
        }
        void SetInitialReferences()
        {
            gameManagerMaster = GetComponent <GameManager_Master>();

            if (toggleInventoryButton == "")
            {
                Debug.LogWarning("Please type in the input manager reference to the inventory key in the 'toggle inventory button' field.");
                this.enabled = false;
            }
        }
        void SetInitialPreferences()
        {
            gameManagerMaster = GetComponent <GameManager_Master>();
            playerInventory   = GameObject.Find("FPSController_ALFDP").GetComponent <Player_Inventory>();

            if (togglePlayerStatsButton == "")
            {
                Debug.LogWarning("Please type in the input manager reference to the inventory key in the 'toggle player stats button' field.");
                this.enabled = false;
            }
        }
Ejemplo n.º 4
0
 void SetInitialReferences()
 {
     gameManagerMaster = GetComponent <GameManager_Master>();
 }
Ejemplo n.º 5
0
 void SetInitialReferences()
 {
     gameManagerMaster = GameObject.Find("GameManager").GetComponent <GameManager_Master>();
     playerMaster      = GetComponent <Player_Master>();
 }