private void OnLevelBtn(GameObject obj = null) { GameObject gameObject = GameObject.FindGameObjectWithTag("Player"); if (gameObject != null) { Units component = gameObject.GetComponent <Units>(); UtilCounter counter = UtilManager.Instance.GetCounter(UtilType.Exp); ExpValue expValue = counter.GetValue(PlayerControlMgr.Instance.GetPlayer().unique_id) as ExpValue; int lvUpExp = expValue.GetLvUpExp(expValue.CurLv + 1); expValue.AddExp((float)lvUpExp); SendMsgManager.Instance.SendPvpMsgBase <CheatInfo>(PvpCode.C2P_GMCheat, new CheatInfo { cheatMsg = "AddExp " + lvUpExp }); } }
private void OnTestBtn(GameObject go) { if (LevelManager.Instance.CheckSceneIsTest()) { if (LevelManager.Instance.IsServerZyBattleType) { return; } GameObject gameObject = GameObject.FindGameObjectWithTag("Player"); if (gameObject != null) { Units component = gameObject.GetComponent <Units>(); UtilCounter counter = UtilManager.Instance.GetCounter(UtilType.Exp); ExpValue expValue = counter.GetValue(PlayerControlMgr.Instance.GetPlayer().unique_id) as ExpValue; int lvUpExp = expValue.GetLvUpExp(expValue.CurLv + 1); expValue.AddExp((float)lvUpExp); } } }
private void AddExpByUnitId(int inUnitId, float inExpVal) { if (inExpVal < 0.1f) { return; } ExpCounter expCounter = this.GetCounter(UtilType.Exp) as ExpCounter; if (expCounter == null) { return; } ExpValue expValue = expCounter.GetValue(inUnitId) as ExpValue; if (expValue == null) { return; } expValue.AddExp(inExpVal); }
private void OnResetBtn(GameObject go) { if (LevelManager.Instance.CheckSceneIsTest()) { if (LevelManager.Instance.IsServerZyBattleType) { return; } GameObject gameObject = GameObject.FindGameObjectWithTag("Player"); if (gameObject != null) { Units component = gameObject.GetComponent <Units>(); UtilCounter counter = UtilManager.Instance.GetCounter(UtilType.Exp); ExpValue expValue = counter.GetValue(PlayerControlMgr.Instance.GetPlayer().unique_id) as ExpValue; expValue.AddExp(-expValue.CurExp); component.skillManager.SkillPointsLeft = 0; for (int i = 0; i < 4; i++) { List <SkillDataKey> skillsByIndex = component.getSkillsByIndex(i); if (skillsByIndex != null) { for (int j = 0; j < skillsByIndex.Count; j++) { skillsByIndex[j] = new SkillDataKey(skillsByIndex[j].SkillID, 0, skillsByIndex[j].Skin); Skill skillById = component.getSkillById(skillsByIndex[j].SkillID); if (skillById != null) { skillById.SetLevel(0); } } } } SkillCounter skillCounter = UtilManager.Instance.GetCounter(UtilType.Skill) as SkillCounter; skillCounter.OnHeroLevelup(component, 0); component.level = 1; component.UpLevel(); CtrlManager.CloseWindow(WindowID.SkillView); CtrlManager.OpenWindow(WindowID.SkillView, null); } } }