示例#1
0
        /// <summary>
        /// 升级条件
        /// </summary>
        public void UpgradeCondition(int exp)
        {
            int currentLevel = 0;

            currentLevel = PlayerExternalDataProxy.GetInstance().GetLevel();

            if (exp >= 100 && exp < 300 && currentLevel == 0)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (exp >= 300 && exp < 500 && currentLevel == 1)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (exp >= 500 && exp < 1000 && currentLevel == 2)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (exp >= 1000 && exp < 3000 && currentLevel == 3)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (exp >= 3000 && exp < 5000 && currentLevel == 4)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (exp >= 5000 && exp < 10000 && currentLevel == 5)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
        }
示例#2
0
        //得到升级条件(等级提升)
        public void GetUpgradeCondition(int experence)
        {
            int currentLevel = 0; //记录当前的等级

            currentLevel = PlayerExternalDataProxy.GetInstance().GetCurrentLevel();

            //当经验值达到条件的时候,调用方法进行升级
            if (experence >= 100 && experence <= 300 && currentLevel == 0)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (experence >= 300 && experence <= 500 && currentLevel == 1)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (experence >= 500 && experence <= 1000 && currentLevel == 2)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (experence >= 1000 && experence <= 3000 && currentLevel == 3)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (experence >= 3000 && experence <= 5000 && currentLevel == 4)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
            else if (experence >= 5000 && experence <= 10000 && currentLevel == 5)
            {
                PlayerExternalDataProxy.GetInstance().AddLevel();
            }
        }