コード例 #1
0
 private void OnInventoryUpdated(Inventory.Update update)
 {
     if (update.resources.HasValue)
     {
         cachedResourcesCount = update.resources.Value;
     }
 }
コード例 #2
0
        public static void RemoveFromInventory(this InventoryWriter inventory, int quantity)
        {
            var update = new Inventory.Update()
            {
                Resources = Mathf.Max(0, inventory.Data.Resources - quantity)
            };

            inventory.SendUpdate(update);
        }
コード例 #3
0
        public static void AddToInventory(this InventoryWriter inventory, int quantity)
        {
            var update = new Inventory.Update()
            {
                Resources = inventory.Data.Resources + quantity
            };

            inventory.SendUpdate(update);
        }