/// <summary> /// 战斗结束事件 /// </summary> /// <param name="evt"></param> void EndSkill(CBaseEvent evt) { if (isUsing) { EndSkill(); } }
public void CastingSkill() { //高亮标记当前技能的外层背景图片 IsMarkingOuterImg(true); //在此发消息给技能系统 CBaseEvent cBaseEvent = new CBaseEvent(CEventType.RELEASE_SKILL, this.gameObject); CEventDispacher.GetInstance().DispatchEvent(cBaseEvent); }
void StartKongxi(CBaseEvent evt) { index++; if (index >= waves.Count || waves[index] == null) { return; } StopAllCoroutines(); StartCoroutine(Kongxi(waves[index])); }
public void DispatchEvent(CBaseEvent cBaseEvent) { CEventListenerDelegate cEventListenerDelegate = this.listeners[cBaseEvent.eventType]; if (cEventListenerDelegate != null) { try { cEventListenerDelegate(cBaseEvent); } catch (System.Exception e) { Debug.Log("An exception was thrown.The message was:" + e.Message + ".The detail of stack trace was:" + e.StackTrace); } } }
//启动技能状态机 public void StartSkillStateMachine(CBaseEvent cBaseEvent) { if (cBaseEvent.eventType == CEventType.RELEASE_SKILL) { SkillStateMachine skillStateMachine; this.playerSkillsInfo.TryGetValue(cBaseEvent.GetSender().name, out skillStateMachine); if (skillStateMachine != null) { skillStateMachine.SetSender(cBaseEvent.GetSender()); skillStateMachine.Sing(); //skillStateMachine.Release(); //skillStateMachine.HitTarget(); //skillStateMachine.Complete(); } } }
public void LoadEnemyGroup(CBaseEvent evt) { DungeonManager.enemyWave.Clear(); int number = ArrangementPanel.data.Count; for (int i = 0; i < number; i++) { JsonData enemy = JsonMapper.ToObject(ArrangementPanel.data[i].ToString()); int[] enemys = new int[enemy.Count]; for (int j = 0; j < enemy.Count; j++) { enemys[j] = int.Parse(enemy[j].ToString()); } DungeonManager.enemyWave.Add(enemys); } LoadScene.LoadDungeon(10101); Util.CloseDialog(DialogType.Arrangement); }
/// <summary> /// 进行结算 /// </summary> public void Evaluate(CBaseEvent evt) { dungeonEndTime = DungeonTime; EvaluatePanel.EvaluateData data = new EvaluatePanel.EvaluateData(); //时间分 data.timeScore = Const.CONST_DUNGEON_MAX_TIME_POINT - Mathf.Max(0, Mathf.RoundToInt((float)(dungeonEndTime - SceneSetting.standardTime) * Const.CONST_DUNGEON_TIME_FACTOR)); //血量分 data.healthScore = Mathf.FloorToInt( Mathf.Min(1f, (float)DungeonRecord.allHP / (DungeonRecord.totalHp * Const.CONST_DUNGEON_LIFE_PCT)) * Const.CONST_DUNGEON_MAX_LIFE_POINT); //连击分 data.comboScore = Mathf.Clamp(Mathf.RoundToInt((float)DungeonRecord.maxCombo * Const.CONST_DUNGEON_COMBO_FACTOR - Const.CONST_DUNGEON_COMBO_BASIC), 0, Const.CONST_DUNGEON_MAX_COMBO_POINT); //技巧分 data.skillScore = Const.CONST_DUNGEON_TECH_BASIC - Mathf.RoundToInt((float)(DungeonRecord.unKillDragObj + DungeonRecord.unKillWuya) * Const.CONST_DUNGEON_TECH_FACTOR); //死亡分 data.deathScore = Const.CONST_DUNGEON_DEATH_BASIC - Mathf.RoundToInt(Const.CONST_DUNGEON_DEATH_FACTOR * DungeonRecord.heroDieCount); //绝技分 data.uniqueSkillScore = Mathf.Clamp(DungeonRecord.uniqueSkillCount * Const.CONST_DUNGEON_SPECSKILL_FACTOR - Const.CONST_DUNGEON_SPECSKILL_BASIC, 0, Const.CONST_DUNGEON_MAX_SPECSKILL_POINT); EvaluatePanel.data = data; /*发送服务器分数,得到结果后才显示结算界面*/ StartCoroutine(LoadEvaluatePanel()); }
/// <summary> /// 使用字符串传递 /// </summary> /// <param name="evt"></param> public void DispatchStringEvent(CBaseEvent evt) { CEventListenerDelegate ceventListenerDelegate = this.listeners[evt.EventName] as CEventListenerDelegate; if (ceventListenerDelegate != null) { try { ceventListenerDelegate(evt); } catch (Exception ex) { throw new Exception(string.Concat(new string[] { "Error dispatching event ", evt.Type.ToString(), ": ", ex.Message, " ", ex.StackTrace }), ex); } } }
void StopKongxi(CBaseEvent evt) { StopAllCoroutines(); }
private void StopKongXi(CBaseEvent ce) { Debug.Log("StopKongXi"); }
/// <summary> /// 更新怪物波次的ui /// </summary> void UpdateWaveUI(CBaseEvent evt) { curWave++; ViewMapper <FightPanel> .instance.UpdateWave(); }
/// <summary> /// 游戏失败返回主界面 /// </summary> void OnGameOver(CBaseEvent evt) { Util.CloseDialog(DialogType.Fight); Application.LoadLevel("login"); io.panelManager.CreatePanel(DialogType.Duplicate); }
void OnMoveToNext(CBaseEvent evt) { Destroy(gameObject); }
void ResetAutoState(CBaseEvent evt) { isAutoUseSkill = false; isAutoUseUniqueSkill = false; }
/// <summary> /// 展现能量足够的特效 /// </summary> /// <param name="evt"></param> void EnergyEnoughEffect(CBaseEvent evt) { }
public void MyTestFun(CBaseEvent evt) { Debug.Log("收到消息" + evt.EventName); }
public void MyTestFunc(CBaseEvent evt) { print("我是参数abc:" + evt); }