Пример #1
0
        private void Init()
        {
            IConfigManager config = new ConfigManagerByJson("LauguageJSONConfig");

            dicLauguageCache = config?.AppSetting;
        }
Пример #2
0
        private static string strLogBufferNumber = null;    //日志缓存最大容量

        /// <summary>
        /// 静态构造函数
        /// </summary>
        static Log()
        {
            //日志缓存数据
            _LiLogArray = new List <string>();

            //日志文件路径
            IConfigManager configMgr = new ConfigManagerByJson(SysDefine.SysConfigInfoPath);

            //PC与编辑器环境下的路径,使用配置文件。
#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            string strPCTruePath = configMgr.AppSetting[Json_CONFIG_LOG_DRIVE_NAME] + ":\\" + configMgr.AppSetting[Json_CONFIG_LOG_PATH] + ".txt";
            _LogPath = strPCTruePath;
#endif

            //日志状态(部署模式)
            strLogState = configMgr.AppSetting[Json_CONFIG_LOG_STATE];
            //日志最大容量
            strLogMaxCapacity = configMgr.AppSetting[Json_CONFIG_LOG_MAX_CAPACITY];
            //日志缓存最大容量
            strLogBufferNumber = configMgr.AppSetting[Json_CONFIG_LOG_BUFFER_NUMBER];

            //日志文件路径
            if (string.IsNullOrEmpty(_LogPath))
            {
                _LogPath = UnityEngine.Application.persistentDataPath + "//" + Json_CONFIG_LOG_DEFAULT_PATH;
            }

            //日志状态(部署模式)
            if (!string.IsNullOrEmpty(strLogState))
            {
                switch (strLogState)
                {
                case Json_CONFIG_LOG_STATE_DEVELOP:
                    _LogState = State.Develop;
                    break;

                case Json_CONFIG_LOG_STATE_SPECIAL:
                    _LogState = State.Speacial;
                    break;

                case Json_CONFIG_LOG_STATE_DEPLOY:
                    _LogState = State.Deploy;
                    break;

                case Json_CONFIG_LOG_STATE_STOP:
                    _LogState = State.Stop;
                    break;

                default:
                    _LogState = State.Stop;
                    break;
                }
            }
            else
            {
                _LogState = State.Stop;
            }

            //日志最大容量
            if (!string.IsNullOrEmpty(strLogMaxCapacity))
            {
                _LogMaxCapacity = Convert.ToInt32(strLogMaxCapacity);
            }
            else
            {
                _LogMaxCapacity = LOG_DEFAULT_MAX_CACITY_NUMBER;
            }

            //日志缓存最大容量
            if (!string.IsNullOrEmpty(strLogBufferNumber))
            {
                _LogBufferMaxNumber = Convert.ToInt32(strLogBufferNumber);
            }
            else
            {
                _LogBufferMaxNumber = LOG_DEFAULT_MAX_LOG_BUFFER_NUMBER;
            }
        }//Log_end(构造函数)
Пример #3
0
        /// <summary>
        /// 初始化"UI窗体"路径数据
        /// </summary>
        void InitUIPathData()
        {
            IConfigManager configManager = new ConfigManagerByJson(SysDefine.UIConfigPath);

            UIPaths = configManager?.AppSetting;
        }