コード例 #1
0
    void TookAWeapon(InventoryWeaponScriptable weaponTaken)
    {
        InventoryManager.slot3Item = Instantiate(itemHost);
        //weaponTaken.weaponQuantity = 1;
        InventoryManager.slot3Scriptable = weaponTaken as ScriptableObject;
        InventoryManager.slot3Item.GetComponent <InventoryScriptableReader>().objectScript = weaponTaken as ScriptableObject;

        if (weaponTaken.itemIndex == 103)
        {
            InventoryManager.arrowsCarried = 10;
        }

        print("You took a weapon");

        //CompileInventoryItemList();
    }
コード例 #2
0
    //WEAPON Variables


    //ARMOR Variables



    public void SetMyObjectType()
    {
        if (objectScript != null)
        {
            if (objectScript.GetType() == typeof(InventoryItemScriptable))
            {
                itemScript   = objectScript as InventoryItemScriptable;
                myObjectType = objectType.item;
                objectName   = itemScript.itemName;

                InitializeItem();
            }
            else if (objectScript.GetType() == typeof(InventoryWeaponScriptable))
            {
                weaponScript = objectScript as InventoryWeaponScriptable;
                myObjectType = objectType.weapon;
                objectName   = weaponScript.itemName;


                //itemQuantity = weaponScript.weaponQuantity;

                //if (weaponScript.MyWeaponType == InventoryWeaponScriptable.weaponTypes.Dagger) {

                //}

                InitializeWeapon();
            }
            else if (objectScript.GetType() == typeof(InventoryArmorScriptable))
            {
                armorScript  = objectScript as InventoryArmorScriptable;
                myObjectType = objectType.armor;
                objectName   = armorScript.itemName;

                //itemQuantity = armorScript.armorQuantity;

                InitializeArmor();
            }
        }
    }