public static string FormatEvent(GameObject root, AnimationEvent evt) { if (string.IsNullOrEmpty(evt.functionName)) { return("(No Function Selected)"); } if (AnimationEventPopup.IsLogicGraphEvent(evt)) { return(AnimationEventPopup.FormatLogicGraphEvent(evt)); } if (!AnimationEventPopup.IsSupportedMethodName(evt.functionName)) { return(evt.functionName + " (Function Not Supported)"); } MonoBehaviour[] components = root.GetComponents <MonoBehaviour>(); for (int i = 0; i < components.Length; i++) { MonoBehaviour monoBehaviour = components[i]; if (!(monoBehaviour == null)) { Type type = monoBehaviour.GetType(); if (type != typeof(MonoBehaviour) && (type.BaseType == null || !(type.BaseType.Name == "GraphBehaviour"))) { MethodInfo method = type.GetMethod(evt.functionName, BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (method != null) { IEnumerable <Type> paramTypes = from p in method.GetParameters() select p.ParameterType; return(evt.functionName + AnimationEventPopup.FormatEventArguments(paramTypes, evt)); } } } } return(evt.functionName + " (Function Not Supported)"); }