public void OnEntityDied(Object p_sender, EventArgs p_args) { if (p_sender == MyController) { if (MyController is Monster) { ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.ON_APPLY_MONSTER_BUFF); ((Monster)MyController).BuffHandler.FlushActionLog(MonsterBuffHandler.ELogEntryPhase.ON_GET_DAMAGE); ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.MONSTER_DIES); } m_StartTime = Time.time; m_Targettime = m_StartTime + m_RendererDisableTime; m_DieStart = true; Destroy(this.gameObject, 10f); if (m_Model != null) { GameObject gameObject = Helper.Instantiate <GameObject>(m_Model); gameObject.transform.position = transform.position + m_SpawnEffectOffset; gameObject.transform.rotation = transform.rotation; gameObject.SendEvent("SetMonster", new UnityEventArgs(this.gameObject, EventArgs.Empty)); DieFX dieFX = gameObject.AddComponent <DieFX>(); dieFX.Init(MyController, EventArgs.Empty, 2f); } } }
protected virtual void OnDie() { FXArgs pArgs = new FXArgs(gameObject, gameObject, gameObject, gameObject, Vector3.zero, Vector3.forward, Vector3.left, Vector3.zero); m_monsterCombatView.HandleAnimationOverrideFX(EAnimType.DIE, pArgs); Single p_dieAnimationDuration = m_monsterCombatView.PlayAnimation(EAnimType.DIE, CombatViewBase.EState.HIT, -1f, 1f); DieFX dieFX = gameObject.AddComponent <DieFX>(); dieFX.Init(MyController, EventArgs.Empty, p_dieAnimationDuration); }
public void OnEntityDied(Object p_sender, EventArgs p_args) { if (p_sender == MyController) { m_AnimatorControl.Die(); if (MyController is Monster) { ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.ON_APPLY_MONSTER_BUFF); ((Monster)MyController).BuffHandler.FlushActionLog(MonsterBuffHandler.ELogEntryPhase.ON_GET_DAMAGE); ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.MONSTER_DIES); } DieFX dieFX = gameObject.AddComponent <DieFX>(); dieFX.Init(MyController, EventArgs.Empty, 2f); } }
public void OnEntityDied(Object p_sender, EventArgs p_args) { if (p_sender == MyController) { m_AnimatorControl.Die(); if (MyController is Monster) { ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.ON_APPLY_MONSTER_BUFF); ((Monster)MyController).BuffHandler.FlushActionLog(MonsterBuffHandler.ELogEntryPhase.ON_GET_DAMAGE); ((Monster)MyController).AbilityHandler.FlushActionLog(EExecutionPhase.MONSTER_DIES); } if (m_DisableRendererTimed) { m_StartTime = Time.time; m_Targettime = m_StartTime + m_RendererDisableTime; m_AnimFreezeTime = m_StartTime + m_AnimFreezeTime; m_DieStart = true; Destroy(this.gameObject, m_AnimTime); for (Int32 i = 0; i < m_Effect.Length; i++) { if (m_Effect[i] != null) { GameObject gameObject = Helper.Instantiate <GameObject>(m_Effect[i]); gameObject.transform.position = transform.position + m_SpawnEffectOffset; gameObject.SendEvent("SetMonster", new UnityEventArgs(this.gameObject, EventArgs.Empty)); } } } if (!m_DisableRendererTimed) { DieFX dieFX = gameObject.AddComponent <DieFX>(); dieFX.Init(MyController, EventArgs.Empty, 2f); } else { Destroy(gameObject, 8f); } } }