private static void OnCreate(GameObject sender) { try { if (!sender.Name.Contains("Katarina_")) { return; } switch (sender.Name) { case "Katarina_Base_Q_Dagger_Land_Stone": case "Katarina_Base_Q_Dagger_Land_Water": case "Katarina_Base_Q_Dagger_Land_Grass": case "Katarina_Base_Q_Dagger_Land_Dirt": case "Katarina_Base_W_Indicator_Ally": case "Katarina_Base_E_Beam": case "Katarina_Base_Dagger_Ground_Indicator": Daggers.Add(new MyDaggerManager(sender, sender.Position, Variables.GameTimeTickCount)); break; case "Katarina_Base_Dagger_PickUp_Cas": case "Katarina_Base_Dagger_PickUp_Tar": var firstDagger = Daggers.OrderBy(x => x.Dagger.Position.Distance(sender.Position)) .FirstOrDefault(); Daggers.Remove(firstDagger); break; } } catch (Exception ex) { Console.WriteLine("Error in MyEventManager.OnCreate." + ex); } }