public virtual void ChangeSlot(ButtonSlotBase sourceSlot) { Sprite sourceIcon = sourceSlot.icon.sprite; sourceSlot.AddSlot(this.icon.sprite); AddSlot(sourceIcon); }
public override void ChangeSlot(ButtonSlotBase sourceSlot) { if (sourceSlot == null) { return; } SkillSlot sourceSkillSlot = sourceSlot.GetComponent <SkillSlot>(); // Reset Icon Color. sourceSkillSlot.isIconColorResetTrigger = true; isIconColorResetTrigger = true; Sprite sourceIcon = sourceSkillSlot.icon.sprite; Skill sourceSkill = sourceSkillSlot.skill; sourceSkillSlot.AddSkill(this.icon.sprite, this.skill); AddSkill(sourceIcon, sourceSkill); // 若起始選取的技能欄位是快捷鍵,則同步更新戰鬥畫面上的UI技能欄 if (slotBeginDrag.slotType == SlotType.MenuHotKey) { MenuSkillSlot menuSkillSlot = slotBeginDrag.GetComponent <MenuSkillSlot>(); menuSkillSlot.linkSkillSlotOnCombatUI.AddSkill(sourceSlot.icon.sprite, sourceSkillSlot.skill); menuSkillSlot.linkSkillSlotOnCombatUI.isIconColorResetTrigger = true; } }
protected virtual void OnSlotClickPickUp() { slotBeginDrag = this; inDrag = true; slotBeginDrag.slotCanvasSetting.overrideSorting = true; slotBeginDrag.slotCanvasSetting.sortingOrder = 99; isClickDrag = true; lastMousePos = GetMousePositionOnScreen(); }
public void Update() { if (isActivedTabs && ButtonSlotBase.GetDragingState()) { isActivedTabs = false; SetTabsButtonInteractive(false); } else if (!isActivedTabs && !ButtonSlotBase.GetDragingState()) { isActivedTabs = true; SetTabsButtonInteractive(true); } }
public virtual void OnBeginDrag(PointerEventData e) { // 只能用滑鼠左鍵拖曳 if (!Input.GetMouseButton(0)) { return; } GetComponent <CanvasGroup>().blocksRaycasts = false; slotBeginDrag = this; inDrag = true; slotCanvasSetting.overrideSorting = true; slotCanvasSetting.sortingOrder = 99; }