/// <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; }
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 }
public Worker2(IBaseConfig config) : base(config) { this._config = config; }
public Worker1(IBaseConfig config) : base(config) { _config = config; }
protected WorkerFactory(IBaseConfig config) { this._config = config; }
public BaseHandler(IBaseConfig baseConfig) { BaseConfig = baseConfig; }
public override void Work(IBaseConfig options) { Console.WriteLine("Hello world"); }
public override void Work(IBaseConfig op) { //do something }
public virtual void Work(IBaseConfig options) { }