void Start() { m_renderer = GetComponent <Renderer> (); corOriginal = m_renderer.material.color; gerenciadorDeJogo = GameObject.FindGameObjectWithTag("GameManeger").GetComponent <GameMeneger> (); gerenciadorBotoes = GameObject.Find("ButtonMeneger").GetComponent <ButtonMeneger>(); custo = torre.transform.GetChild(0).gameObject.GetComponent <Torre> ().custo; }
void Awake() { if (instancia == null) { instancia = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); inicializa(); }