Пример #1
0
    /// <summary>
    /// 刷新技能槽上技能的信息,参数技能槽索引,有效范围[0..3]
    /// </summary>
    void UpdateEquipSkill(int slotIdx)
    {
        SkillItemUI item = equipSkills[slotIdx] as SkillItemUI;

        if (item == null)
        {
            return;
        }

        //锁定状态;
        if (MySkillModule.IsSlotLocked(slotIdx + 1))
        {
            item.SLockType  = SkillLockType.Locked;
            item.IsShowIcon = false;
            item.IsTrigger  = false;//停止响应点击事件;
        }
        else
        {
            int skillID = MySkillModule.GetEquipSkillID(slotIdx);

            SkillLearnTableItem slti = MySkillModule.GetDetailBySkillId(skillID);
            if (slti == null)
            {
                item.SetSkillIcon("");
                item.SLockType = SkillLockType.UnLocked;
                return;
            }

            item.SetSkillIcon(slti.skill_icon);
            item.SLockType  = SkillLockType.UnLocked;
            item.IsShowIcon = true;
            item.IsTrigger  = true;
        }
    }
Пример #2
0
    void onEquipItemClick(GameObject go)
    {
        ///范围[1...4]
        int slotIdx = System.Convert.ToInt32(go.name.Replace(SKILL_ITEM_NAME, ""));

        if (mCanEquip)
        {
            MySkillModule.EquipSkill(slotIdx, CurSkillId);
            SetSelect(CurSkillId);
        }
        else
        {
            CurSkillId = MySkillModule.GetEquipSkillID(slotIdx - 1);
        }

        CanEquip = false;
    }