コード例 #1
0
 void GetNewProtectee()
 {
     //Debug.Log("Looking");
     if (enemyManager != null)
     {
         targetProtectee = enemyManager.GetNearestProtectee(transform.position);
     }
 }
コード例 #2
0
    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);
 }