示例#1
0
    void ShowConsommableInteraction(int itemSelectedIndex)
    {
        AConsommable <TModuleType> consommable = this.inventory.Consommables[itemSelectedIndex];
        string text = MultiResolutions.Font(13) + "<color=red>" + consommable.Name + "\n" + consommable.Description + "\n</color></size>\n";
        Rect   rect = StuffGUI <TModuleType> .GetRectOfMyGUIContent(text, 0.41f, 0.85f);

        float posX = rect.x + rect.width;
        float posY = rect.y;

        StuffGUI <TModuleType> .DisplayItemContent(MultiResolutions.Rectangle(rect), text);

        for (byte i = 0; i < 3; i++)
        {
            GUI.Box(MultiResolutions.Rectangle(posX, posY - 0.050f, 0.06f, 0.025f * 4), "");
        }

        if (GUI.Button(MultiResolutions.Rectangle(posX, posY - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Sell</b></color></size>"))
        {
            this.itemMgr.Sell(this.itemSelectedIndex, this.itemSelectedFiltre);
        }
        if (GUI.Button(MultiResolutions.Rectangle(posX, posY + 0.025f - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Throw</b></color></size>"))
        {
            this.itemMgr.ThrowOut(this.itemSelectedIndex, this.itemSelectedFiltre);
        }
        if (GUI.Button(MultiResolutions.Rectangle(posX, posY + 0.025f * 2 - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Destruct</b></color></size>"))
        {
            this.itemMgr.Destruct(this.itemSelectedIndex, this.itemSelectedFiltre);
        }
        if (GUI.Button(MultiResolutions.Rectangle(posX, posY + 0.025f * 3 - 0.050F, 0.06f, 0.025f), MultiResolutions.Font(14) + "<color=#00FF00><b>Use</b></color></size>"))
        {
            this.itemMgr.UseConsommable(this.itemSelectedIndex);
        }

        //StuffGUI.DisplayItemInteractionBorder(posX, posY, stuff);
    }
示例#2
0
    void ItemInteraction(string text, AStuff <TModuleType> stuff)
    {
        Rect rect = StuffGUI <TModuleType> .GetRectOfMyGUIContent(text, 0.41f, 0.85f);

        float posX = rect.x + rect.width;
        float posY = rect.y;

        StuffGUI <TModuleType> .DisplayItemContent(MultiResolutions.Rectangle(rect), text);

        StuffGUI <TModuleType> .DisplayItemInteractionBorder(posX, posY, stuff);

        this.ItemInteractionBehaviour(ref posX, ref posY, stuff);
    }