コード例 #1
0
    private void SetEquipments()
    {
        foreach (var equipment in Npc.Equipments)
        {
            string slotName = equipment.Key;
            int    itemID   = equipment.Value;

            if (slotByNames.ContainsKey(slotName))
            {
                ItemScript item = ItemScript.CreateItem(itemID);

                slotByNames[slotName].SetItem(item);
            }
        }
    }
コード例 #2
0
ファイル: PlayerCharacter.cs プロジェクト: thyjukki/Rebelion
    // Use this for initialization
    void Start()
    {
        rbody = GetComponent <Rigidbody2D>();
        anim  = GetComponent <Animator>();

        inventory.AddItem(ItemScript.CreateItem(Category.Consumable, 0));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 1));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 2));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 3));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 4));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 5));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 6));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 7));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 8));
        inventory.AddItem(ItemScript.CreateItem(Category.Equipment, 9));

        touching = new List <GameObject>();
    }