Exemplo n.º 1
0
        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
                });
            }
        }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
 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);
         }
     }
 }