// Use this for initialization void Start() { textyPoo = FindObjectOfType <ManaText>(); mana = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <Mana>(); enemycounter = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <EnemyCounter>(); sm = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <SM_tower_defense>(); nav = GetComponent <EnemyNavigation>(); eem = GetComponent <EnemyEffectMgr>(); enemycounter.register(gameObject); }
// Use this for initialization void Start() { enemy = this.transform.root.gameObject.GetComponent <EnemyEffectMgr>(); nav = this.transform.root.gameObject.GetComponent <EnemyNavigation>(); if (enemy == null) { Debug.Log("Not attached to an enemey"); Destroy(gameObject); } StartCoroutine("effect"); }