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;
    }
示例#3
0
 public void ProtecteeDestroyed(Protectee protectee)
 {
     //Debug.Log("Protectee Destroyed");
     protectees.Remove(protectee);
 }
示例#4
0
 public void ProtecteeFinished(Protectee protectee)
 {
     GetComponentInParent <GameManager>().OneFinished();
     protectees.Remove(protectee);
 }