//---------------------------------------------------------------------------- // AddSingleDeathEvent //---------------------------------------------------------------------------- #region AddSingleDeathEvent public void AddSingleDeathEvent(IHasTurn hasTurn, IDeathEvent deathEvent) { if (!DeathEventDict.ContainsKey(hasTurn)) { DeathEventDict[hasTurn] = new List <IDeathEvent>(); } DeathEventDict[hasTurn].Add(deathEvent); }
//---------------------------------------------------------------------------- // Die //---------------------------------------------------------------------------- #region Die public IEnumerator Die(IHasTurn hasTurn) { DyingHasTurn = hasTurn; if (DeathEventDict.ContainsKey(hasTurn)) { foreach (IDeathEvent deathEvent in DeathEventDict[hasTurn]) { yield return(StartCoroutine(deathEvent.ReactToDeath(hasTurn))); } } foreach (IDeathEvent globalDeathEvent in GlobalDeathEvents) { yield return(StartCoroutine(globalDeathEvent.ReactToDeath(hasTurn))); } MyAttackManager.AddEndAttackEvent(this); }