コード例 #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 PlayerExternalDataProxy(int exp, int level, int gold) : base(exp, level, gold)
 {
     if (_instance == null)
     {
         _instance = this;
     }
 }
コード例 #3
0
ファイル: UpgradeRule.cs プロジェクト: Heavenfather/Mission
        //得到升级条件(等级提升)
        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();
            }
        }
コード例 #4
0
 public PlayerExternalDataProxy(int exp, int killNumber, int level, int gold, int diamonds)
     : base(exp, killNumber, level, gold, diamonds)
 {
     if (_Instance == null)
     {
         _Instance = this;
     }
     else
     {
         Debug.LogError(GetType() + "/PlayerExternalDataProxy()/不允许构造函数重复实例化,请检查");
     }
 }