private static void GameObjectOnOnDelete(GameObject sender, EventArgs args) { if (!(sender is Obj_AI_Minion)) { return; } var obj = (Obj_AI_Minion)sender; switch (obj.BaseSkinName.ToLower()) { case "sru_baron": Baron = null; return; case "sru_dragon": Dragon = null; return; case "sru_blue": BlueBuffs.RemoveAll(x => x.NetworkId == obj.NetworkId); return; case "sru_red": RedBuffs.RemoveAll(x => x.NetworkId == obj.NetworkId); return; } }
/// <summary> /// Fired when the game is updated. /// </summary> /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> private static void GameOnOnUpdate(EventArgs args) { if (Baron != null && (Baron.IsDead || !Baron.IsValid)) { Baron = null; OnObjectiveDead?.Invoke(Baron, ObjectiveType.Baron); } if (Dragon != null && (Dragon.IsDead || !Dragon.IsValid)) { Dragon = null; OnObjectiveDead?.Invoke(Dragon, ObjectiveType.Dragon); } foreach (var blue in BlueBuffs.ToArray().Where(x => x.IsDead || !x.IsValid)) { BlueBuffs.RemoveAll(x => x.NetworkId == blue.NetworkId); OnObjectiveDead?.Invoke(blue, ObjectiveType.Blue); } foreach (var red in RedBuffs.ToArray().Where(x => x.IsDead || !x.IsValid)) { RedBuffs.RemoveAll(x => x.NetworkId == red.NetworkId); OnObjectiveDead?.Invoke(red, ObjectiveType.Red); } }