示例#1
0
    private void Select()
    {
        bool success = defenderSpawner.SelectDefender(defenderPrefab, this);

        if (success)
        {
            spriteRenderer.color = Color.white;
        }
    }
示例#2
0
 private void OnMouseDown()
 {
     ChangeButtonColor(Color.white);
     spawner.SelectDefender(defenderPrefab);
     foreach (DefenderButton button in FindObjectsOfType <DefenderButton>())
     {
         if (button != this)
         {
             button.ChangeButtonColor(Color.gray);
         }
     }
 }
示例#3
0
    private void SelectDefender(Defender selectedDefender)
    {
        DefenderSpawner spawner = FindObjectOfType <DefenderSpawner>();

        spawner.SelectDefender(selectedDefender);
    }