public override void Initialize() { base.Initialize(); var controllerType = ReflectionManager.LooseGetType(InventoryInstance.InterfaceControllerTypeName); var args = new object[] { this }; InterfaceController = DynamicTypeFactory.CreateInstance <InventoryInterfaceController>(controllerType, args); InterfaceController.Initialize(); if (Owner.TryGetComponent(out _sprite)) { foreach (var mask in InventoryInstance.SlotMasks.OrderBy(s => InventoryInstance.SlotDrawingOrder(s))) { if (mask == Slots.NONE) { continue; } _sprite.LayerMapReserveBlank(mask); } } // Component state already came in but we couldn't set anything visually because, well, we didn't initialize yet. foreach (var(slot, entity) in _slots) { _setSlot(slot, entity); } }
public override void Initialize() { base.Initialize(); if (Owner.TryGetComponent(out _sprite)) { foreach (var slot in _hands.Keys) { _sprite.LayerMapReserveBlank($"hand-{slot}"); _setHand(slot, _hands[slot]); } } }