void SendEvent(BezierZone zone, BezierZoneEventType eventType) { MonoBehaviour component = zone; var type = component.GetType(); var methodInfo = type.GetMethod("OnBezierZoneEvent"); if (methodInfo == null) { Debug.LogWarning(zone + " is missing OnBezierZoneEvent"); } else { //Debug.Log(eventType + ": " + this + " -> " + zone); methodInfo.Invoke(component, new object[] { new BezierZoneEvent(zone, this, eventType) }); } }
public BezierZoneEvent(BezierZone zone, BezierPoint point, BezierZoneEventType type) { this.zone = zone; this.point = point; this.type = type; }