private void Start() { button2itemid.Add(s_item1.GetInstanceID(), 0); button2itemid.Add(s_item2.GetInstanceID(), 0); st_Daiji.onClick.AddListener(() => { doStrategy(GSNPCStrategy.Daiji); }); st_Jingjie.onClick.AddListener(() => { doStrategy(GSNPCStrategy.Jingjie); }); st_Autofight.onClick.AddListener(() => { doStrategy(GSNPCStrategy.AutoFight); }); st_BackToManual.onClick.AddListener(() => { GameEntityMgr.GetSelectedEntity()?.Back2Manual(); }); s_item1.onClick.AddListener(() => { startUseItem(button2itemid[s_item1.GetInstanceID()]); }); s_item2.onClick.AddListener(() => { startUseItem(button2itemid[s_item2.GetInstanceID()]); }); s_switchSkillList.onClick.AddListener(() => { GameEntity entity = GameEntityMgr.GetSelectedEntity(); if (entity == null) { return; } List <int> newSkills = entity.GetdifferentSkills(entity.GetNowSkillSockets()); entity.ChangeNowSkillSockets(newSkills); ScrollViewRemote remote = s_scroll.GetComponent <ScrollViewRemote>(); remote.UpdateUI(); }); }
internal void UpdateInfo() { if (GameEntityMgr.Instance == null || this.gameObject.activeInHierarchy == false) { return; } GameEntity selected = GameEntityMgr.GetSelectedEntity(); if (selected != null) { nonePlayer.SetActive(false); ScrollViewRemote remote = s_scroll.GetComponent <ScrollViewRemote>(); remote.UpdateUI(); entityname.text = selected.GetEntityName(); hpSlider.value = selected.GetControllRemote().GetHPPer(); magicSlider.value = selected.GetControllRemote().GetMagicPer(); } else { nonePlayer.SetActive(true); } }