コード例 #1
0
ファイル: Inventory.cs プロジェクト: Torppo/IntramuralRPG
    public void LoadData(ISaveService sc)
    {
        items = new List<InventoryItem>();
        int count = sc.LoadInt(this.gameObject, "inventory.count");
        for (int i = 0; i< count; i++){
            string name = sc.LoadString(this.gameObject, "inventory.items."+ i +".name");
            int amount = sc.LoadInt(this.gameObject, "inventory.items."+ i +".amount");

            InventoryItem it = InventoryItem.FromString(name);
            it.amount = amount;
            items.Add(it);
        }
    }
コード例 #2
0
ファイル: PickUp.cs プロジェクト: Torppo/IntramuralRPG
    public int quantity = 0; //the amount of items that the player receives

    #endregion Fields

    #region Methods

    public void LoadData(ISaveService sc)
    {
        item = sc.LoadString(owner, "pickup.item");
        quantity = sc.LoadInt(owner, "pickup.quantity");
    }