Exemplo n.º 1
0
    string GetButtonItem(CreativeButtons button)
    {
        int itemNum = buttons.IndexOf(button);

        if (SaveData.current.profile.radialItems.Count <= itemNum)
        {
            return(null);
        }
        return(SaveData.current.profile.radialItems[itemNum]);
    }
Exemplo n.º 2
0
    public Sprite GetItemSprite(CreativeButtons button)
    {
        string itemString = GetButtonItem(button);

        if (itemString == null)
        {
            return(null);
        }
        return(ItemManager.current.GetItem(itemString).itemSprite);
    }
Exemplo n.º 3
0
    public void ShowItemData(CreativeButtons button)
    {
        string itemName = GetButtonItem(button);

        if (itemName == null)
        {
            return;
        }
        string numRemain = ItemManager.current.GetItemsRemaining(itemName).ToString();

        if (numRemain == "-1")
        {
            numRemain = "*";
        }
        itemInfo.text = itemName + "\nRemaining: " + numRemain + "\n" + ItemManager.current.GetItem(itemName).GetTimeRemaining();
    }
Exemplo n.º 4
0
 public void ButtonSelect(CreativeButtons button)
 {
     for (int i = 0; i < buttons.Count; i++)
     {
         if (buttons[i] == button)
         {
             button.SelectButton();
             if (SaveData.current.profile.radialItems.Count >= i)
             {
                 ItemManager.current.UseItem(SaveData.current.profile.radialItems[i]);
                 ShowItemData(button);
             }
         }
         else
         {
             buttons[i].DimButton(false);
         }
     }
     radial.gameObject.SetActive(false);
 }