예제 #1
0
    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;
        }
    }
예제 #2
0
    public void ResetPlayerCombatSkillSlotUI()
    {
        // 連結Menu與戰鬥畫面UI的技能快捷鍵
        if (linkSkillSlotOnCombatUI == null)
        {
            return;
        }
        linkSkillSlotOnCombatUI.AddSkill(this.icon.sprite, this.skill);
        linkSkillSlotOnCombatUI.isIconColorResetTrigger = true;

        if (slotBeginDrag != null && slotBeginDrag.slotType == SlotType.MenuHotKey)
        {
            MenuSkillSlot menuSkillSlot = slotBeginDrag.GetComponent <MenuSkillSlot>();
            var           linkedSlot    = menuSkillSlot.linkSkillSlotOnCombatUI;
            linkedSlot.AddSkill(menuSkillSlot.icon.sprite, menuSkillSlot.skill);
            linkedSlot.isIconColorResetTrigger = true;
        }
    }