private void M_OnDestroy(object sender, OnDestroyEventArgs e) { Monster monster = (Monster)e.destroyTarget; Reward reward = monster.Reward; Experience += reward.exp; foreach (Item item in reward.items) { Inventory.AddItem(item); } monster.OnDestroy -= M_OnDestroy; }
private static void GameEntity_OnDestroy(object sender, OnDestroyEventArgs e) { if (bindings.ContainsKey(e.destroyTarget)) { Vector2 destroyPosition = e.destroyTarget.Position; bindings[e.destroyTarget].SetChar(destroyPosition, groundChar[e.destroyTarget]); groundChar.Remove(e.destroyTarget); UnBind(e.destroyTarget); } else { throw new Exception(string.Format("Destroy Target {0} doesn't exists", e.destroyTarget.name)); } }
private void Ge_OnDestroy(object sender, OnDestroyEventArgs e) { gameEntities.Remove(e.destroyTarget); }