/**
  * Will run everytime toggle in group is clicked.
  */
 public void NotifyToggleClick(GemToggle toggle)
 {
     if (ActiveToggles().Count() == 1)
     {
         for (var i = 0; i < m_Toggles.Count; i++)
         {
             if (m_Toggles [i].isOn)
             {
                 gm.SetGemOne(m_Toggles [i].AssociatedGem);
                 gm.SetGemTwo(m_Toggles [i].AssociatedGem);
             }
         }
     }
     if (!toggle.isOn)
     {
         if (gm.GetGemOne() == toggle.AssociatedGem)
         {
             gm.ClearGemOne();
         }
         else if (gm.GetGemTwo() == toggle.AssociatedGem)
         {
             gm.ClearGemTwo();
         }
     }
     Debug.Log("***********************");
     Debug.Log(gm.GetGemOne().ToString());
     Debug.Log(gm.GetGemTwo().ToString());
 }
Exemple #2
0
    void Awake()
    {
        if (fire)
        {
            GemSelection.SetGemOne(Gem.Red);
            GemSelection.SetGemTwo(Gem.Green);
        }
        else if (lightning)
        {
            GemSelection.SetGemOne(Gem.Yellow);
            GemSelection.SetGemTwo(Gem.Green);
        }
        else if (ice)
        {
            GemSelection.SetGemOne(Gem.Blue);
            GemSelection.SetGemTwo(Gem.Green);
        }

        spawn  = GameObject.FindGameObjectWithTag("SpecialAttack");
        gemOne = GameObject.FindGameObjectWithTag(GemSelection.GetGemOne().ToString());

        foreach (Transform child in spawn.transform)
        {
            child.gameObject.SetActive(false);
        }
        gemOne.SetActive(true);

        //current selection starts with gemOne
        GemSelection.SetCurrentGem(GemSelection.GetGemOne());
    }