public void DispatchEventBelongChange(Belong belong) { if (BelongChangeHandler != null) { BelongChangeHandler(belong); } }
public void DispatchEventMovingTiles(List <VTile> tiles, Belong belong) { if (MovingTilesHandler != null) { MovingTilesHandler(tiles, belong); } }
public void DispatchEventAttackTiles(List <VTile> tiles, Belong belong) { if (AttackTilesHandler != null) { AttackTilesHandler(tiles, belong); } }
public JsonResult Edit(Belong model) { try { if (model.BelongId > 0) { var entity = _BelongService.GetById(model.BelongId); //修改 entity.BelongId = model.BelongId; entity.Title = model.Title; entity.UTime = DateTime.Now; entity.Sort = model.Sort; _BelongService.Update(entity); } else { if (_BelongService.IsExistName(model.Title)) { return(Json(new { Status = Successed.Repeat }, JsonRequestBehavior.AllowGet)); } //添加 model.CTime = DateTime.Now; model.UTime = DateTime.Now; _BelongService.Insert(model); } return(Json(new { Status = Successed.Ok }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { Status = Successed.Error }, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 动作结束后处理 /// </summary> public IEnumerator ActionOverNext() { if (cBattlefield.battleMode == CBattlefield.BattleMode.moving) { this.mCharacter.Action = ActionType.idle; } yield return(cBattlefield.StartCoroutine(ActionEndSkillsRun())); this.mCharacter.ActionOver = true; this.mCharacter.roadLength = 0; cBattlefield.tilesManager.ClearCurrentTiles(); cBattlefield.HideBattleCharacterPreviewDialog(); cBattlefield.battleMode = CBattlefield.BattleMode.none; Belong belong = this.mCharacter.Belong; this.mCharacter = null; if (!System.Array.Exists(mBaseMap.Characters, c => c.Hp > 0 && !c.IsHide && c.Belong == belong && !c.ActionOver)) { ChangeBelong(belong); } else { cBattlefield.CloseOperatingMenu(); } }
/// <summary> /// 动作结束后处理 /// </summary> public IEnumerator ActionOverNext() { if (battleMode == BattleMode.moving) { currentVCharacter.action = ActionType.idle; } yield return(AppManager.CurrentScene.StartCoroutine(ActionEndSkillsRun())); currentVCharacter.actionOver = true; currentMCharacter.roadLength = 0; tilesManager.ClearCurrentTiles(); Global.battleEvent.DispatchEventCharacterPreview(null); battleMode = BattleMode.none; Belong belong = currentMCharacter.belong; this.currentMCharacter = null; this.currentVCharacter = null; if (!Global.charactersManager.mCharacters.Exists(c => c.hp > 0 && !c.isHide && c.belong == belong && !c.actionOver)) { ChangeBelong(belong); } else { Global.battleEvent.DispatchEventOperatingMenu(false); } }
public bool IsSameBelong(Belong belong1, Belong belong2) { if (belong1 == Belong.enemy) { return(belong2 == Belong.enemy); } return(belong2 == Belong.self || belong2 == Belong.friend); }
public void ChangeBelong() { Player.number += number + 1; number = 0; number_str = number.ToString(); belong = Belong.Own; this.gameObject.GetComponent <Image>().color = Color.gray; Text.GetComponent <Text>().text = number_str; }
/// <summary> /// 反向 /// </summary> public static Belong opposite(Belong belong) { if (belong == Belong.Player) { return(Belong.Enemy); } if (belong == Belong.Enemy) { return(Belong.Player); } return(belong); }
public void BoutWave(Belong belong) { currentBelong = belong; if (belong == Belong.self) { boutCount++; } charactersManager.ActionRestore(); System.Action closeEvent = () => { this.StartCoroutine(OnBoutStart()); }; foreach (MCharacter mCharacter in mBaseMap.Characters) { mCharacter.boutEventComplete = false; } Request req = Request.Create("belong", belong, "bout", boutCount, "maxBout", maxBout, "closeEvent", closeEvent); this.StartCoroutine(Global.SceneManager.ShowDialog(SceneManager.Prefabs.BoutWaveDialog, req)); }
private void BoutWave(Belong belong) { Debug.LogError("BoutWave belong=" + belong); Global.battleManager.currentBelong = belong; if (belong == Belong.self) { boutCount++; } Global.charactersManager.ActionRestore(); System.Action closeEvent = () => { this.StartCoroutine(Global.battleEvent.OnBoutStart()); }; foreach (MCharacter mCharacter in Global.charactersManager.mCharacters) { mCharacter.boutEventComplete = false; } Request req = Request.Create("belong", belong, "bout", boutCount, "maxBout", maxBout, "closeEvent", closeEvent); this.StartCoroutine(Global.AppManager.ShowDialog(Util.Dialog.BoutWaveDialog, req)); }
public System.Collections.IEnumerator OnBoutStart() { UnityEngine.Debug.LogError("OnBoutStart"); Manager.BattleCharactersManager charactersManager = Global.charactersManager; Belong currentBelong = Global.battleManager.currentBelong; while (true) { MCharacter mCharacter = charactersManager.mCharacters.Find((c) => { return(c.belong == currentBelong && c.hp > 0 && !c.isHide && !c.boutEventComplete); }); if (mCharacter == null) { break; } Model.Master.MSkill skill = mCharacter.boutFixedDamageSkill; if (skill != null) { List <VCharacterBase> characters = charactersManager.vCharacters.FindAll((c) => { return(c.hp > 0 && !c.isHide && !charactersManager.IsSameBelong(c.belong, currentBelong)); }); yield return(OnBoutFixedDamage(mCharacter, skill, characters)); } mCharacter.boutEventComplete = true; } UnityEngine.Debug.LogError("OnBoutStart currentBelong=" + currentBelong); if (currentBelong != Belong.self) { Global.battleManager.aiManager.Execute(currentBelong); } else { Global.battleEvent.DispatchEventOperatingMenu(false); /*if (scriptWaitPaths != null) * { * WaitScript(scriptWaitPaths); * }*/ } }
public void ChangeBelong(Belong belong) { if (belong == Belong.self) { if (System.Array.Exists(mBaseMap.Characters, c => c.Hp > 0 && !c.IsHide && c.Belong == Belong.friend && !c.ActionOver)) { cBattlefield.BoutWave(Belong.friend); } else { cBattlefield.BoutWave(Belong.enemy); } } else if (belong == Belong.friend) { cBattlefield.BoutWave(Belong.enemy); } else if (belong == Belong.enemy) { cBattlefield.BoutWave(Belong.self); } }
public void ChangeBelong(Belong belong) { if (belong == Belong.self) { if (Global.charactersManager.mCharacters.Exists(c => c.hp > 0 && !c.isHide && c.belong == Belong.friend && !c.actionOver)) { Global.battleEvent.DispatchEventBelongChange(Belong.friend); } else { Global.battleEvent.DispatchEventBelongChange(Belong.enemy); } } else if (belong == Belong.friend) { Global.battleEvent.DispatchEventBelongChange(Belong.enemy); } else if (belong == Belong.enemy) { Global.battleEvent.DispatchEventBelongChange(Belong.self); } }
public void Execute(Belong belong) { this.belong = belong; cBattlefield.StartCoroutine(Execute()); }
/// <summary> /// 删除实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Delete(Belong model) { this._repoBelong.Delete(model); }
/// <summary> /// 修改实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Update(Belong model) { this._repoBelong.Update(model); }
/// <summary> /// 添加实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public Belong Insert(Belong model) { return(this._repoBelong.Insert(model)); }
/// <summary> /// 修改实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Update(Belong model) { this._BelongBiz.Update(model); }
/// <summary> /// 删除实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Delete(Belong model) { this._BelongBiz.Delete(model); }
public Grid(Belong belong) { setup(belong); }
/// <summary> /// 改变方块归属 /// </summary> /// <param name="type"></param> public void changeBelong(Belong belong) { this.belong = belong; _refreshRequest = true; }
void setup(Belong belong) { this.belong = belong; }
public void Execute(Belong belong) { this.belong = belong; AppManager.CurrentScene.StartCoroutine(Execute()); }
/// <summary> /// 添加实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public Belong Insert(Belong model) { return(this._BelongBiz.Insert(model)); }