public void ShowCostume(string costume_name)
    {
        // costume_name in the format "Element ItemType" (ex: "Fire Cloak")
        // call this method using value of string 'itemScanned' from WitchSelect
        if (costume_name == "Null Hat")
        {
            ShowDefaultHat();
        }
        else if (costume_name == "Null Cloak")
        {
            ShowDefaultCloak();
        }
        else
        {
            string[] costume = costume_name.Split(" "[0]);

            if (costume[1] == "Hat")
            {
                hat_image.GetComponent <Image>().sprite  = manager.hats[manager.ElementToInt(costume[0])];
                hat_symbol.GetComponent <Image>().sprite = manager.symbols[manager.ElementToInt(costume[0])];
            }
            else if (costume[1] == "Cloak")
            {
                cloak_image.GetComponent <Image>().sprite  = manager.cloaksM[manager.ElementToInt(costume[0])];
                cloak_symbol.GetComponent <Image>().sprite = manager.symbols[manager.ElementToInt(costume[0])];
            }
        }
    }
Ejemplo n.º 2
0
 public void ShowCostumes()
 {
     if (manager.getHat() != "Null Hat")
     {
         hat_image.GetComponent <Image>().sprite  = manager.hats[manager.ElementToInt(manager.getHat())];
         hat_symbol.GetComponent <Image>().sprite = manager.symbols[manager.ElementToInt(manager.getHat())];
     }
     else
     {
         ShowDefaultHat();
     }
     if (manager.getCloak() != "Null Cloak")
     {
         cloak_image.GetComponent <Image>().sprite  = manager.cloaks[manager.ElementToInt(manager.getCloak())]; // m_cloaks
         cloak_symbol.GetComponent <Image>().sprite = manager.symbols[manager.ElementToInt(manager.getCloak())];
     }
     else
     {
         ShowDefaultCloak();
     }
 }