コード例 #1
0
ファイル: MyGUI.cs プロジェクト: Sage-SQ/RPGFrameWork
    public void TrashIconDropItem()
    {
        WindowType sourceType = GetSourceOfItem(pickedUpItemIdentifier);

        if (sourceType == WindowType.Inventory)
        {
            inventoryWindowGUI.InventoryDo("DropItem", FindInventorySpot(pickedUpItemIdentifier));
            itemIsPickedUp         = false;
            pickedUpItemIdentifier = "";
        }
    }
コード例 #2
0
    private void DisplayEquipment()
    {
        //Debug.Log ("DISPLAYING EQUIPS");



        //Equipped Weapon
        if (_pc.EquipedWeapon == null)
        {
            if (GUI.Button(new Rect(130, 221, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedWeapon");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(130, 221, 40, 40), new GUIContent(_pc.EquipedWeapon.Icon, "EquipedWeapon"), _pc.EquipedWeapon.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedWeapon");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedWeapon", 0);
                }
            }
            string moreInfo = "+" + (_pc.EquipedWeapon as Weapon).Enchants.ToString();
            GUI.Box(new Rect(130, 221, 40, 40), moreInfo, "ItemInfoOverlay");
        }

        //Equipped Head
        if (_pc.EquipedArmorHead == null)
        {
            if (GUI.Button(new Rect(24, 21, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorHead");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(24, 21, 40, 40), new GUIContent(_pc.EquipedArmorHead.Icon, "EquipedArmorHead"), _pc.EquipedArmorHead.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorHead");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedArmorHead", 0);
                }
            }
        }

        //Equipped Chest Armour
        if (_pc.EquipedArmorChest == null)
        {
            if (GUI.Button(new Rect(24, 68, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorChest");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(24, 68, 40, 40), new GUIContent(_pc.EquipedArmorChest.Icon, "EquipedArmorChest"), _pc.EquipedArmorChest.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorChest");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedArmorChest", 0);
                }
            }
        }

        //Equipped Gloves
        if (_pc.EquipedArmorGloves == null)
        {
            if (GUI.Button(new Rect(238, 68, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorGloves");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(238, 68, 40, 40), new GUIContent(_pc.EquipedArmorGloves.Icon, "EquipedArmorGloves"), _pc.EquipedArmorGloves.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorGloves");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedArmorGloves", 0);
                }
            }
        }

        //Equipped Legs
        if (_pc.EquipedArmorLegs == null)
        {
            if (GUI.Button(new Rect(24, 116, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorLegs");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(24, 116, 40, 40), new GUIContent(_pc.EquipedArmorLegs.Icon, "EquipedArmorLegs"), _pc.EquipedArmorLegs.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorLegs");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedArmorLegs", 0);
                }
            }
        }

        //Equipped Feet
        if (_pc.EquipedArmorFeet == null)
        {
            if (GUI.Button(new Rect(238, 115, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorFeet");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(238, 115, 40, 40), new GUIContent(_pc.EquipedArmorFeet.Icon, "EquipedArmorFeet"), _pc.EquipedArmorFeet.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorFeet");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedArmorFeet", 0);
                }
            }
        }

        //Equipped Back
        if (_pc.EquipedArmorBack == null)
        {
            if (GUI.Button(new Rect(238, 21, 40, 40), "", "Box"))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorBack");
                    }
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(238, 21, 40, 40), new GUIContent(_pc.EquipedArmorBack.Icon, "EquipedArmorBack"), _pc.EquipedArmorBack.Rarity.ToString()))
            {
                if (Event.current.button == 0)
                {
                    if (MyGUI.itemIsPickedUp)
                    {
                        GUIHandler.SwapItems("EquipedArmorBack");
                    }
                }
                //Right Click To Use Item
                if (Event.current.button == 1 && !MyGUI.itemIsPickedUp)
                {
                    inventoryWindowGUI.InventoryDo("ReturnEquippedArmorBack", 0);
                }
            }
        }
    }