Exemplo n.º 1
0
 private bool isAttackerInLane()
 {
     attackerSpawner = FindObjectOfType <AttackerSpawn>();
     if (attackerSpawner.transform.childCount <= 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Exemplo n.º 2
0
    private void SetLaneAttacker()
    {
        AttackerSpawn[] attackerSpawners = FindObjectsOfType <AttackerSpawn>();

        foreach (AttackerSpawn spawner in attackerSpawners)
        {
            bool isCloseEnough = Mathf.Abs(spawner.transform.position.y - transform.position.y) <= Mathf.Epsilon;
            if (isCloseEnough)
            {
                attackerSpawner = spawner;
            }
        }
    }