private bool isAttackerInLane() { attackerSpawner = FindObjectOfType <AttackerSpawn>(); if (attackerSpawner.transform.childCount <= 0) { return(false); } else { return(true); } }
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; } } }