public void OnLoad(Events.SynapseEventArguments.SOEventArgs ev) { foreach (var handler in Handlers) { var name = handler.Name; foreach (var attribute in ev.Object.CustomAttributes) { if (attribute == null) { continue; } var args = attribute.Split(':'); if (args[0].ToLower() != handler.Name.ToLower()) { continue; } var newargs = args.Segment(1); handler.SynapseObjects.Add(ev.Object); handler.OnLoad(ev.Object, newargs); return; } } }
public void OnUpdate(Events.SynapseEventArguments.SOEventArgs ev) { foreach (var handler in Handlers) { if (handler.SynapseObjects.Contains(ev.Object)) { handler.OnUpdate(ev.Object); } } }
public void OnDestroy(Events.SynapseEventArguments.SOEventArgs ev) { foreach (var handler in Handlers) { if (handler.SynapseObjects.Contains(ev.Object)) { handler.OnDestroy(ev.Object); handler.SynapseObjects.Remove(ev.Object); } } }