private void LoadModules() { Action = LoadModule <ActionModule>(EnableAction, ActionConfig); Brain = LoadModule <BrainModule>(EnableBrain, BrainConfig); Inventory = LoadModule <InventoryModule>(EnableInventory, InventoryConfig); Interaction = LoadModule <InteractionModule>(EnableInteraction, InteractionConfig); Movement = LoadModule <MovementModule>(EnableMovement, MovementConfig); Physics = LoadModule <PhysicsModule>(EnablePhysics, PhysicsConfig); Stacking = LoadModule <StackingModule>(EnableStacking, StackingConfig); Stats = LoadModule <StatsModule>(EnableStats, StatsConfig); TagList = LoadModule <TagListModule>(true, TagListConfig); }
// Update is called once per frame void Update() { StackingModule item = Inventory.Peek(Slot); if (item == null) { SlotImage.sprite = null; SlotAmount.text = null; } else { SlotImage.sprite = item.Owner.InventorySprite; if (item.IsStackable) { SlotAmount.text = item.Amount.ToString(); } else { SlotAmount.text = null; } } }