/// <summary>
        /// 更新人物已学习技能面板
        /// </summary>
        public void UpdateLearnedSkillsPlane(Skill skill)
        {
            if (skill == null)
            {
                return;
            }


            for (int i = 0; i < allLearnedSkillDetails.Length; i++)
            {
                SimpleSkillDetail learnedSkillDetail = allLearnedSkillDetails[i];


                if (i < Player.mainPlayer.allLearnedSkills.Count)
                {
                    Skill learnedSkill = Player.mainPlayer.allLearnedSkills[i];

                    learnedSkillDetail.SetUpSimpleSkillDetail(learnedSkill, LearnedSkillSelectCallBack);

                    //if (learnedSkill.skillId == skill.skillId)
                    //{
                    learnedSkillDetail.SetUpSelectedIcon(false);
                    //}
                }
                else
                {
                    learnedSkillDetail.ClearSimpleSkillDetail();
                }

                skillDetailInTrade.SetUpSkillDetailInTrade(skill);
            }
        }
Exemple #2
0
 /// <summary>
 /// 技能被点击回调(点击时将所有的技能选中框都禁用,SimpleSkillDetail里在回调之后会将自身选中框启用)
 /// </summary>
 /// <param name="skill">Skill.</param>
 private void OnSkillClick(Skill skill)
 {
     currentSelectedSkill = skill;
     skillDetail.SetupSkillDetail(skill);
     for (int i = 0; i < simpleSkillDetails.Length; i++)
     {
         SimpleSkillDetail simpleSkillDetail = simpleSkillDetails[i];
         simpleSkillDetail.SetUpSelectedIcon(false);
     }
 }
        public void SetUpSkillLearningView(HLHNPC npc, CallBack quitCallBack)
        {
            this.currentNpc = npc;

            GameManager.Instance.soundManager.PlayAudioClip(CommonData.merchantAudioName);

            gameObject.SetActive(true);

            this.skillGoodsIds = npc.npcSkillIds;

            this.quitCallBack = quitCallBack;

            skillGoodsPool.AddChildInstancesToPool(skillGoodsContainer);

            for (int i = 0; i < skillGoodsIds.Count; i++)
            {
                SkillGoodsInTrade skillGoodsDetail = skillGoodsPool.GetInstance <SkillGoodsInTrade>(skillGoodsModel.gameObject, skillGoodsContainer);

                Skill skill = GameManager.Instance.gameDataCenter.allSkills.Find(delegate(Skill obj)
                {
                    return(obj.skillId == skillGoodsIds[i]);
                });

                skillGoodsDetail.SetupSkillDetailInNPC(skill, SkillGoodsSelectCallBack);

                skillGoodsDetail.SetUpSelectedIcon(false);

                allSkillGoods.Add(skillGoodsDetail);
            }

            skillNumLeftText.text = string.Format("剩余技能点: {0}", Player.mainPlayer.skillNumLeft);

            for (int i = 0; i < allLearnedSkillDetails.Length; i++)
            {
                SimpleSkillDetail learnedSkillDetail = allLearnedSkillDetails[i];

                if (i < Player.mainPlayer.allLearnedSkills.Count)
                {
                    Skill learnedSkill = Player.mainPlayer.allLearnedSkills[i];

                    learnedSkillDetail.SetUpSimpleSkillDetail(learnedSkill, LearnedSkillSelectCallBack);
                }
                else
                {
                    learnedSkillDetail.ClearSimpleSkillDetail();
                }

                learnedSkillDetail.SetUpSelectedIcon(false);
            }

            //skillDetailInTrade.InitskilldetailInTrade(UpdateLearnedSkillsPlane);
            skillDetailInTrade.ClearSkillDetailInTrade();

            EnterSkillGoodsTradeViewDisplay();
        }
        /// <summary>
        /// 已学习技能的被选中的回调
        /// </summary>
        /// <param name="skill">Skill.</param>
        private void LearnedSkillSelectCallBack(Skill skill)
        {
            for (int i = 0; i < Player.mainPlayer.allLearnedSkills.Count; i++)
            {
                SimpleSkillDetail skillDetail = allLearnedSkillDetails[i];

                skillDetail.SetUpSelectedIcon(false);

                Skill learnedSkill = Player.mainPlayer.allLearnedSkills[i];

                skillDetail.SetUpSelectedIcon(learnedSkill.skillId == skill.skillId);
            }

            for (int i = 0; i < allSkillGoods.Count; i++)
            {
                allSkillGoods[i].SetUpSelectedIcon(false);
            }

            currentSelectedSkill = skill;

            skillDetailInTrade.SetUpSkillDetailInTrade(skill);
        }
Exemple #5
0
        public void SetUpSkillView()
        {
            gameObject.SetActive(true);

            leftSkillNumText.text = string.Format("剩余技能点: {0}", Player.mainPlayer.skillNumLeft);

            learnedSkillCountText.text = string.Format("已学习技能数量: {0}", Player.mainPlayer.allLearnedSkills.Count);

            for (int i = 0; i < simpleSkillDetails.Length; i++)
            {
                SimpleSkillDetail simpleSkillDetail = simpleSkillDetails[i];

                bool selectedIconEnable = false;

                if (i < Player.mainPlayer.allLearnedSkills.Count)
                {
                    Skill learnedSkill = Player.mainPlayer.allLearnedSkills[i];
                    simpleSkillDetail.SetUpSimpleSkillDetail(learnedSkill, OnSkillClick);
                    selectedIconEnable = currentSelectedSkill != null && currentSelectedSkill.skillId == learnedSkill.skillId;
                }
                else
                {
                    simpleSkillDetail.ClearSimpleSkillDetail();
                }


                simpleSkillDetail.SetUpSelectedIcon(selectedIconEnable);
            }

            if (currentSelectedSkill == null)
            {
                skillDetail.ClearSkillDetail();
            }
            else
            {
                skillDetail.SetupSkillDetail(currentSelectedSkill);
            }
        }