private void BTN_ECompileSave_Click(object sender, EventArgs e) { if (ECompileCFG == null) { try { ECompileCFG = new EConfig(); ECompileCFG.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); } catch (Exception ex) { ExceptionBox.ExceptionForm tmp = new ExceptionBox.ExceptionForm(ref ex); tmp.ShowDialog(this); } } foreach (CheckBox ThisBox in PNL_ECompileFlags.Controls) { ECompileCFG.Option(ThisBox.Name.Substring(15), ThisBox.Checked); } foreach (TextBox ThisBox in PNL_ECompilePaths.Controls) { ECompileCFG.Option(ThisBox.Name.Substring(11), ThisBox.Text); } ECompileCFG.SaveConfig(); }
private void BTN_EcompileLoad_Click(object sender, EventArgs e) { try { ECompileCFG = new EConfig(); ECompileCFG.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); foreach (CheckBox ThisBox in PNL_ECompileFlags.Controls) { ThisBox.Checked = Settings.Global.ToBoolean(ECompileCFG.Option(ThisBox.Name.Substring(15))); Settings.Global.Ecompile[ThisBox.Name.Substring(15)] = ECompileCFG.Option(ThisBox.Name.Substring(15)); } foreach (TextBox ThisBox in PNL_ECompilePaths.Controls) { ThisBox.Text = ECompileCFG.Option(ThisBox.Name.Substring(11)); Settings.Global.Ecompile[ThisBox.Name.Substring(11)] = ECompileCFG.Option(ThisBox.Name.Substring(11)); } foreach (TextBox ThisBox in PNL_ECompilePathsEditTBS.Controls) { ThisBox.Text = ECompileCFG.Option(ThisBox.Name.Substring(20)); Settings.Global.Ecompile[ThisBox.Name.Substring(20)] = ECompileCFG.Option(ThisBox.Name.Substring(20)); } } catch (Exception ex) { ExceptionBox.ExceptionForm tmp = new ExceptionBox.ExceptionForm(ref ex); tmp.ShowDialog(this); } }
/// <summary> /// Build the fileSpecs_ List of files to add to the archive. /// </summary> /// <returns> /// true if it was able to fully build the list. /// </returns> bool BuildFileList() { if (bool.Parse(Settings.Global.DataBackup["BackupData"])) { // Ok, they want to backup the Data Directory. Let's Scan this // directory to get all the files and move on. foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\data")) { fileSpecs_.Add(filename); } } if (bool.Parse(Settings.Global.DataBackup["BackupScripts"])) { // Ok, they want to backup all the Scripts. Let's Scan this // directory to get all the files and move on. Let's remember, we also // need to check everything within each Package Root. OH MY! fileSpecs_.Add(Settings.Global.Properties["POLPath"] + @"\pol.cfg"); fileSpecs_.Add(Settings.Global.Properties["POLPath"] + @"\uoconvert.cfg"); foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\config")) { fileSpecs_.Add(filename); } foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\regions")) { fileSpecs_.Add(filename); } foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\scripts")) { fileSpecs_.Add(filename); } // Now we read the PackageRoot Entries from Ecompile.Cfg in order to get // all the user's "pkg" directories. OH YAY! EConfig MyConfig = new EConfig(); MyConfig.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); foreach (string pathname in MyConfig.GetPackageRoots()) { foreach (string filename in FileSystemUtil.GetAllFileNames(pathname)) { fileSpecs_.Add(filename); } } } if (bool.Parse(Settings.Global.DataBackup["BackupRealms"])) { foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\realm")) { fileSpecs_.Add(filename); } } if (bool.Parse(Settings.Global.DataBackup["BackupLogs"])) { foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\log")) { fileSpecs_.Add(filename); } } return(fileSpecs_.Count > 0); }
/// <summary> /// 碰撞到技能触发器 /// </summary> /// <param name="eConfig"></param> /// <param name="trrigerObject"></param> public void OnSkillTrriger(EConfig eConfig, GameObject trrigerObject) { bool isDestroy = false; //角色 if (trrigerObject.CompareTag("Player")) { PlayerCtrl hitPlayerCtrl = trrigerObject.transform.GetComponent <PlayerCtrl>(); PlayerInfo hitPlayerInfo = hitPlayerCtrl.playerInfo; //判断是否同个阵营的 if (hitPlayerInfo.TeamID != playerInfo.TeamID) { hitPlayerCtrl.OnSkillHit(50); if (eConfig.destroyMode == DestroyMode.OnHit_DifferentCampPlayer || eConfig.destroyMode == DestroyMode.OnHit_AllPlayer) { isDestroy = true; } } else { //如果是同个阵营的 return; } } ////野怪 //else if (other.CompareTag("Monster")) //{ // //让他扣血 并且让它进入对应的状态 //} ////兵 //else if (other.CompareTag("Soldier")) //{ // //如果不是同个阵营 让他扣血 并且让它进入对应的状态 //} ////防御塔或者水晶 //else if (other.CompareTag("Tower")) //{ // //如果不是同个阵营 让他扣血 并且让它进入对应的状态 //} ////水晶 //else if (other.CompareTag("Crystal")) //{ // //如果不是同个阵营 让他扣血 并且让它进入对应的状态 //} //克隆爆炸特效 if (isDestroy && eConfig.hitLoad != null) { //克隆爆炸物 GameObject hitObj = GameObject.Instantiate(eConfig.hitLoad); //hitObj.transform.position = trrigerObject.transform.position; hitObj.transform.position = eConfig.moveRoot.gameObject.transform.position; //并且销毁 Destroy(eConfig.gameObject); } }
/// <summary> /// 在E环境中,初始化组建和插件。 /// </summary> /// <param name="config">Config</param> public void Initialize(EConfig config) { //注册依赖 RegisterDependencies(config); //启动任务 if (!config.IgnoreStartupTasks) { RunStartupTasks(); } }
public RedisCacheManager(EConfig config) { if (String.IsNullOrEmpty(config.RedisCachingConnectionString)) { throw new Exception("Redis connection string is empty"); } this._muxer = ConnectionMultiplexer.Connect(config.RedisCachingConnectionString); this._db = _muxer.GetDatabase(); this._perRequestCacheManager = EngineContext.Current.Resolve <ICacheManager>(); }
//生成特效 public void SpawnEffect(string key) { GameObject effect = ResManager.Instance.LoadEffect(playerInfo.HeroID, key); effect.transform.position = transform.position; effect.transform.eulerAngles = transform.eulerAngles; effect.gameObject.SetActive(true); EConfig eConfig = effect.transform.GetComponent <EConfig>(); BattleUserInputC2S skillCMD = playerCtrl.playerFSM.skillCMD.CMD; //playerCtrl.OnSkillTrriger 技能触发回调 由释放者 eConfig.Init(skillCMD.RolesID, skillCMD.LockTag, skillCMD.LockID, transform.forward, transform.position, playerCtrl.OnSkillTrriger); }
/// <summary> /// 注册依赖 /// </summary> /// <param name="config">Config</param> protected virtual void RegisterDependencies(EConfig config) { var builder = new ContainerBuilder(); var container = builder.Build(); this._containerManager = new ContainerManager(container); //创造containerbuilder新实例 //在一个containerbuilder,因为build()或update()方法只能调用一次。 //dependencies var typeFinder = new WebAppTypeFinder(); builder = new ContainerBuilder(); builder.RegisterInstance(config).As <EConfig>().SingleInstance(); //注册config单例 builder.RegisterInstance(this).As <IEngine>().SingleInstance(); //注册单例ECEngine builder.RegisterInstance(typeFinder).As <ITypeFinder>().SingleInstance(); //注册WebAppTypeFinder builder.Update(container); //register dependencies provided by other assemblies builder = new ContainerBuilder(); var drTypes = typeFinder.FindClassesOfType <IDependencyRegistrar>(); var drInstances = new List <IDependencyRegistrar>(); foreach (var drType in drTypes) { drInstances.Add((IDependencyRegistrar)Activator.CreateInstance(drType)); } //sort drInstances = drInstances.AsQueryable().OrderBy(t => t.Order).ToList(); foreach (var dependencyRegistrar in drInstances) { dependencyRegistrar.Register(builder, typeFinder, config); } builder.Update(container); //set dependency resolver DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); }
internal void Init(EConfig eConfig) { this.eConfig = eConfig; }