public IInventorySlot_CommandLogic DoCreate_LibraryLogic_Command(EInventorySlot_CommandEvent eEvent, EInventory_CommandLogicName eLogic, EInventorySlot_CommandEvent eEventUndo = EInventorySlot_CommandEvent.None) { IInventorySlot_CommandLogic pLogic = null; switch (eLogic) { case EInventory_CommandLogicName.Instantiate_CloneSlot: pLogic = new Instantiate_CloneSlot(); break; default: Debug.LogError("Error - Not Found Logic"); return(null); } list_CommandLogic.Add(new InventorySlot_CommandLogic(eEvent, eEventUndo, pLogic)); return(pLogic); }
private void OnEnable() { if (_pInventory.bIsExecute_Awake == false) { _pInventory.EventAwake(); } _pInventory.DoClearData(); _pInventory.DoAddRangeData(listSomthingData.ToArray()); InventoryLogicFactory pLogicFactory = new InventoryLogicFactory(); var pLogic = pLogicFactory.DoCreate_LibraryLogic_Command(InventorySlot.EInventorySlot_CommandEvent.OnDragBegin, EInventory_CommandLogicName.Instantiate_CloneSlot, InventorySlot.EInventorySlot_CommandEvent.OnDragEnd); Instantiate_CloneSlot pInstantiateLogic = pLogic as Instantiate_CloneSlot; pInstantiateLogic.DoInit((p => p.GetComponent <Image>().enabled = false), null); _pInventory.DoInit_SlotLogic(pLogicFactory); _pInventory.OnSwap_Slot += _pInventory_OnSwap_Slot; _pInventory.OnSwap_Slot_OtherInventory += Inventory_OnSwap_OtherInventory; }