public override void DrawGUISetting_ItemInfoLibrary() { if (animator == null) { return; } using (new GUILayoutToggleAreaScope(itemInfoLibraryToggleTween, "Library")) { if (animator.runtimeAnimatorController == null) { EditorGUILayout.HelpBox("Library is empty\nruntimeAnimatorController==null", MessageType.Warning); } else { AnimationClip[] animationClips = animator.runtimeAnimatorController.animationClips; if (animationClips.Length <= 0) { EditorGUILayout.HelpBox("Library is empty\nanimationClips==null", MessageType.Warning); } else { isItemInfoLibrarySorted = GUILayout.Toggle(isItemInfoLibrarySorted, "Sort", "button"); if (isItemInfoLibrarySorted) { Array.Sort(animationClips, (x, y) => x.name.AlphanumCompareTo(y.name)); } for (int i = 0; i < animationClips.Length; i++) { var animationClip = animationClips[i]; if (GUILayout.Button(animationClip.name)) { var newItemInfo = new AnimationTimelinableItemInfo(); newItemInfo.time = curTime; newItemInfo.duration = animationClip.length; newItemInfo.animationClip = animationClip; newItemInfo.name = animationClip.name; AddItemInfo(newItemInfo); } } } } } }
public MountTimelinableItemInfo(AnimationTimelinableItemInfo other) { CopyFrom(other); }