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 Serialize(out string param, IAnimationEventAttribute attribute) { if (attribute != null) { KeyValueSerializer serializer = new KeyValueSerializer(); attribute.OnSerialize(serializer); param = serializer.SerializedText; } else { param = null; } }