Example #1
0
        /// <summary>
        /// 预处理第一关卡
        /// </summary>
        /// <returns></returns>
        IEnumerator ScenePreProgressing_Level1()
        {
            yield return(new WaitForSeconds(0.1f));

            //参数赋值
            DialogDataAnalysisMgr.GetInstance().SetXMLPathAndRooNodeName(KernelParameter.GetDialogConfigPath(), KernelParameter.GetDialogConfigRootNodeName());
            //等待参数设置完毕(要比DialogDataAnalysisMgr的延迟方法慢)
            yield return(new WaitForSeconds(0.7f));                 //很重要

            //得到XML中所有的数据
            List <DialogDataFormat> DialogsDataArray = DialogDataAnalysisMgr.GetInstance().GetAllXmlDataArray();
            // 测试给“对话数据管理器”加载数据
            bool boolResult = DialogDataMgr.GetInstance().LoadAllDialogData(DialogsDataArray);

            if (!boolResult)
            {
                Log.Write(GetType() + "/Start()/对话数据管理器加载数据失败", Log.Level.High);
            }
        }
Example #2
0
        IEnumerator Start()
        {
            #region 测试内容(Log系统)

            /* 启用Log日志系统 */

            //面向接口编程
            IConfigManager configMgr = new ConfigManager(KernelParameter.GetLogPath(), KernelParameter.GetLogRootNodeName());

            //string strLogPath = configMgr.AppSetting["LogPath"];
            //string strLogState = configMgr.AppSetting["LogState"];
            //string strLogMaxCapacity = configMgr.AppSetting["LogMaxCapacity"];
            //string strLogCacheNumber = configMgr.AppSetting["LogCacheNumber"];
            //print("LogPath:" + strLogPath);
            //print("LogState:" + strLogState);
            //print("LogMaxCapacity:" + strLogMaxCapacity);
            //print("LogCacheNumber:" + strLogCacheNumber);

            //测试Log.cs类(让构造函数运行起来)
            //Log.Write("我的企业日志系统开始运行了,第一次测试");

            #endregion

            #region 测试内容(XML解析)

            ///* 测试XML解析程序 */
            ////或许可以封装为一个方法,提供参数:对话XML文件地址,根节点名
            ////输出参数:对话数据格式类列表

            //参数赋值
            DialogDataAnalysisMgr.GetInstance().SetXMLPathAndRooNodeName(KernelParameter.GetDialogConfigPath(), KernelParameter.GetDialogConfigRootNodeName());
            //等待参数设置完毕(要比DialogDataAnalysisMgr的延迟方法慢)
            yield return(new WaitForSeconds(0.5f));                 //很重要

            //得到XML中所有的数据
            List <DialogDataFormat> DialogsDataArray = DialogDataAnalysisMgr.GetInstance().GetAllXmlDataArray();

            //foreach (DialogDataFormat data in DialogsDataArray) {
            //	Log.Write("");      //空一行
            //	Log.Write("SectionNum: " + data.DiaSectionNum);
            //	Log.Write("SectionName: " + data.DiaSectionName);
            //	Log.Write("Index: " + data.DiaIndex);
            //	Log.Write("Side: " + data.DiaSide);
            //	Log.Write("Person: " + data.DiaPerson);
            //	Log.Write("Content:" + data.DiaContent);
            //}
            //Log.SyncLogArrayToFile();

            // 测试给“对话数据管理器”加载数据
            bool boolResult = DialogDataMgr.GetInstance().LoadAllDialogData(DialogsDataArray);
            if (!boolResult)
            {
                Log.Write(GetType() + "/Start()/对话数据管理器加载数据失败");
            }
            //###调试进入指定关卡(在这里改变调试关卡)###
            GlobalParaMgr.NextSceneName = SceneEnum.MajorCity;

            #endregion

            yield return(new WaitForSeconds(1f));

            StartCoroutine("LoadingSceneProgress");
        }