void GetNewProtectee() { //Debug.Log("Looking"); if (enemyManager != null) { targetProtectee = enemyManager.GetNearestProtectee(transform.position); } }
public void Spawn() { if (protecteeManager == null || protecteePrefab == null) { return; } //Debug.Log("Spawn"); Protectee protectee = Instantiate(protecteePrefab, transform.position, Quaternion.identity, protecteeManager.protecteeParent) as Protectee; protectee.protecteeManager = protecteeManager; protecteeManager.protectees.Add(protectee); protectee.OnFinish -= protecteeManager.ProtecteeFinished; protectee.OnFinish += protecteeManager.ProtecteeFinished; protectee.OnDeath -= protecteeManager.ProtecteeDestroyed; protectee.OnDeath += protecteeManager.ProtecteeDestroyed; protectee.GetComponent <LifeBarController>().lifeBarParent = protecteeManager.lifeBarParrent; }
public void ProtecteeDestroyed(Protectee protectee) { //Debug.Log("Protectee Destroyed"); protectees.Remove(protectee); }
public void ProtecteeFinished(Protectee protectee) { GetComponentInParent <GameManager>().OneFinished(); protectees.Remove(protectee); }