Esempio n. 1
0
 /// <summary>
 /// 增加一定数量的钻石
 /// </summary>
 /// <param name="number"></param>
 public void AddDiamond(int number)
 {
     if (number > 0)
     {
         Mod_PlayerExtendedDataProxy.GetInstance().AddDiamond(number);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 读取玩家的扩展数据
        /// </summary>
        private void LoadFromXML_PlayerExtendedData()
        {
            //参数检查
            if (string.IsNullOrEmpty(_FileNameByPlayerExtendedData))
            {
                Debug.LogError("读取玩家扩展参数失败!");
                return;
            }

            try {
                //读取XML数据
                string strTemp = XmlOperation.GetInstance().LoadXML(_FileNameByPlayerExtendedData);
                //反序列化
                Mod_PlayerExtendedData ped = XmlOperation.GetInstance().DeserializeObject(strTemp, typeof(Mod_PlayerExtendedData)) as Mod_PlayerExtendedData;
                //赋值
                Mod_PlayerExtendedDataProxy.GetInstance().EXP     = ped.EXP;
                Mod_PlayerExtendedDataProxy.GetInstance().KillNum = ped.KillNum;
                Mod_PlayerExtendedDataProxy.GetInstance().Level   = ped.Level;
                Mod_PlayerExtendedDataProxy.GetInstance().Gold    = ped.Gold;
                Mod_PlayerExtendedDataProxy.GetInstance().Diamond = ped.Diamond;
            }
            catch {
                Debug.LogError("读取玩家扩展参数失败!");
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 增加经验值
 /// </summary>
 public void AddEXP(int addValue)
 {
     if (addValue > 0)
     {
         Mod_PlayerExtendedDataProxy.GetInstance().AddEXP(addValue);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// 减少一定数量的钻石
 /// </summary>
 /// <param name="number"></param>
 /// <returns>钻石是否足够</returns>
 public bool SubDiamond(int number)
 {
     if (number > 0)
     {
         return(Mod_PlayerExtendedDataProxy.GetInstance().SubDiamond(number));
     }
     return(false);
 }
Esempio n. 5
0
        // Use this for initialization
        void Start()
        {
            Mod_PlayerKernelDataProxy   playerKernelDataObj   = new Mod_PlayerKernelDataProxy(100, 100, 10, 5, 50, 100, 100, 0, 0, 0);
            Mod_PlayerExtendedDataProxy playerExtendedDataObj = new Mod_PlayerExtendedDataProxy(0, 0, 1, 0, 0);


            //显示初始值
            Mod_PlayerKernelDataProxy.GetInstance().DisplayAllOriginalValues();             //调用显示所有初始数据方法
            Mod_PlayerExtendedDataProxy.GetInstance().DisplayAllOriginalValues();           //调用显示所有初始数据方法
        }
Esempio n. 6
0
        /// <summary>
        /// 有延迟的开始方法,必须要靠后执行
        /// </summary>
        /// <returns></returns>
        public IEnumerator Start()
        {
            yield return(new  WaitForSeconds(GlobalParameter.WAIT_FOR_SECONDS_ON_START));

            //显示初始值
            Mod_PlayerKernelDataProxy.GetInstance().DisplayAllOriginalValues();             //调用显示所有初始数据方法
            Mod_PlayerExtendedDataProxy.GetInstance().DisplayAllOriginalValues();           //调用显示所有初始数据方法

            //玩家的姓名处理
            if (string.IsNullOrEmpty(GlobalParaMgr.PlayerName))
            {
                Txt_PlayerName.text         = GlobalParaMgr.PlayerName;
                Txt_PlayerNameByDetail.text = GlobalParaMgr.PlayerName;
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 公共方法:存储游戏进度
        /// </summary>
        /// <returns>是否保存成功</returns>
        public bool SaveGameProcess()
        {
            //得到各种数据
            //###这里为何要用代理类?
            _PlayerKernelDataProxy   = Mod_PlayerKernelDataProxy.GetInstance();
            _PlayerExtendedDataProxy = Mod_PlayerExtendedDataProxy.GetInstance();
            //_PlayerPackageDataProxy = Mod_PlayerPackageDataProxy.GetInstance();

            //存储游戏的全局参数
            SaveToXML_GlobalParameterData();
            //存储玩家的核心数据
            SaveToXML_GlobalParameterData();
            //存储玩家的扩展数据
            SaveToXML_PlayerExtendedData();
            //存储玩家的背包数据
            SaveToXML_PlayerPackageData();

            return(false);
        }
Esempio n. 8
0
 /// <summary>
 /// 得到当前的钻石数量
 /// </summary>
 /// <returns></returns>
 public int GetDiamond()
 {
     return(Mod_PlayerExtendedDataProxy.GetInstance().GetDiamond());
 }
Esempio n. 9
0
 /// <summary>
 /// 得到当前等级
 /// </summary>
 public int GetLevel()
 {
     return(Mod_PlayerExtendedDataProxy.GetInstance().GetLevel());
 }
Esempio n. 10
0
 /// <summary>
 /// 提升当前等级
 /// </summary>
 public void AddLevel()
 {
     Mod_PlayerExtendedDataProxy.GetInstance().AddLevel();
 }
Esempio n. 11
0
 /// <summary>
 /// 得到杀敌数量
 /// </summary>
 /// <returns></returns>
 public int GetKillNum()
 {
     return(Mod_PlayerExtendedDataProxy.GetInstance().GetKillNum());
 }
Esempio n. 12
0
 /// <summary>
 /// 增加杀敌数量
 /// </summary>
 public void AddKillNum()
 {
     Mod_PlayerExtendedDataProxy.GetInstance().AddKillNum();
 }
Esempio n. 13
0
 public void AddEXP()
 {
     Mod_PlayerExtendedDataProxy.GetInstance().AddEXP(30);
 }