Exemplo n.º 1
0
 public void UpdatePowerUp(Upgrade.Type type, bool active)
 {
     if (active)
     {
         GameObject.Find(type.ToString() + "PowerUp/Image").GetComponent <Image> ().color = new Color32(255, 255, 255, 255);
         RectTransform[] canvasChildren = GameObject.Find("HUD Canvas").GetComponent <Canvas> ().gameObject.GetComponentsInChildren <RectTransform> (true);
         foreach (RectTransform ui in canvasChildren)
         {
             if (ui.gameObject.name == "AbilityUI")
             {
                 RectTransform panel = ui;
                 StartCoroutine(ShowAbilityPanel(panel, type.ToString()));
             }
         }
     }
     else
     {
         GameObject.Find(type.ToString() + "PowerUp/Image").GetComponent <Image> ().color = new Color32(140, 140, 140, 255);
     }
 }
Exemplo n.º 2
0
    public void LevelUpgradeElement(Upgrade.Type type, int value)
    {
        Text text = GameObject.Find(type.ToString() + "PowerUp/Level").GetComponent <Text> ();

        text.text = value.ToString();
    }