コード例 #1
0
ファイル: Defender.cs プロジェクト: isnizal/GlitchGarden
 private bool isAttackerInLane()
 {
     attackerSpawner = FindObjectOfType <AttackerSpawn>();
     if (attackerSpawner.transform.childCount <= 0)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
コード例 #2
0
ファイル: Defender.cs プロジェクト: isnizal/GlitchGarden
    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;
            }
        }
    }