/// <summary>
        /// 初始化配置文件管理类
        /// </summary>
        /// <param name="path">路径应为全路径,包含文件名</param>
        /// <param name="configType">json 或Xml</param>
        /// <param name="isLog">发生错误时,是否打印日志,开启可能会降低一些性能</param>
        public static void  Init(string path, ConfigType configType, bool isLog)
        {
            SavePath   = path;
            ConfigType = configType;
            switch (configType)
            {
            case ConfigType.Json:
                ConfigGenr = new JsonConfig <T>();
                break;

            case ConfigType.Xml:
                ConfigGenr = new XmlConfig <T>();
                break;
            }

            ConfigGenr.IsLog = isLog;
        }
Example #2
0
    private void ReadConfData(string fileName, IBaseConfig conf)
    {
#if UNITY_EDITOR && !AB_MODE
        using (StreamReader sr = new StreamReader(Path.Combine(Application.dataPath, AssetBundlePathResolver.GetAssetPath(fileName))))
        {
            conf.Initialize(sr.ReadToEnd());
        }
#else
        AssetBundleManager.Instance.LoadAssetSync(fileName, (abInfo) =>
        {
            TextAsset asset = abInfo.Require(null) as TextAsset;
            if (null != asset)
            {
                conf.Initialize(asset.text);
            }
        });
#endif
    }
Example #3
0
 public Worker2(IBaseConfig config) : base(config)
 {
     this._config = config;
 }
Example #4
0
 public Worker1(IBaseConfig config) : base(config)
 {
     _config = config;
 }
Example #5
0
 protected WorkerFactory(IBaseConfig config)
 {
     this._config = config;
 }
Example #6
0
 public BaseHandler(IBaseConfig baseConfig)
 {
     BaseConfig = baseConfig;
 }
Example #7
0
 public override void Work(IBaseConfig options)
 {
     Console.WriteLine("Hello world");
 }
Example #8
0
 public override void Work(IBaseConfig op)
 {
     //do something
 }
Example #9
0
 public virtual void Work(IBaseConfig options)
 {
 }