private void Awake() { playerPotions = GameObject.FindGameObjectWithTag("Canvas").GetComponent <PotionsScript>(); //Obtém o Player e seus componentes player = GameObject.FindGameObjectWithTag("Player"); mana = player.GetComponent <Mana>(); playerShooting = player.GetComponentInChildren <PlayerShooting>(); playerMovement = player.GetComponent <PlayerController>(); }
// Use this for initialization void Awake() { //Obtém o managerScene para poder obter os modos de jogo managerScene = GameObject.FindGameObjectWithTag("GameController").GetComponent <ManagerScene>(); managerScene.GetScenesModeGame(); playerPotions = GameObject.FindGameObjectWithTag("Canvas").GetComponent <PotionsScript>(); // anim = GetComponent<Animator>(); // playerAudio = GetComponent<AudioSource>(); player = GetComponent <PlayerController>(); playerShooting = GetComponentInChildren <PlayerShooting>(); }
// Colocar todo valor que foi passado de uma fase para outra nas variáveis private void Awake() { canvas = GameObject.FindGameObjectWithTag("Canvas"); potions = canvas.GetComponent <PotionsScript>(); if (GameObject.FindGameObjectWithTag("Player")) { player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent <PlayerHealth>(); playerExperience = player.GetComponent <PlayerExperience>(); playerShooting = player.GetComponentInChildren <PlayerShooting>(); } }
// Use this for initialization void Start() { playerPotions = GameObject.FindGameObjectWithTag("Canvas").GetComponent <PotionsScript>(); currentMana = startMana; }