public static IAnimationEventAttribute CreateAttribute(string functionName, string text) { if (animationEventInfoList == null) { //Init(); Debug.LogError("AnimationEventUtil Init Error"); return(null); } IAnimationEventAttribute attribute = null; for (int i = 0; i < animationEventInfoList.Count; ++i) { AnimationEventTypeInfo animationEventTypeInfo = animationEventInfoList[i]; if (animationEventTypeInfo.functionName == functionName) { if (animationEventTypeInfo.onCreate != null) { //Debug.Log(functionName); attribute = animationEventTypeInfo.onCreate(text); } break; } } return(attribute); }
public static void AddAnimationEventType(eAnimationEventTypeMask animationEventTypeMask, eAnimationEventType animationEventType, string functionName, System.Type type, OnCreate onCreate) { AnimationEventTypeInfo animationEventTypeInfo = new AnimationEventTypeInfo(); animationEventTypeInfo.AnimationEventTypeMask = animationEventTypeMask; animationEventTypeInfo.AnimationEventType = animationEventType; animationEventTypeInfo.functionName = functionName; animationEventTypeInfo.type = type; animationEventTypeInfo.onCreate = onCreate; animationEventInfoList.Add(animationEventTypeInfo); }