internal static AnimationClip CreateNewClip(string gameObjectName) { string message = string.Format("Create a new animation for the game object '{0}':", gameObjectName); string path = ProjectWindowUtil.GetActiveFolderPath(); if (AnimationWindowUtility.s_LastPathUsedForNewClip != null) { string directoryName = Path.GetDirectoryName(AnimationWindowUtility.s_LastPathUsedForNewClip); if (directoryName != null && Directory.Exists(directoryName)) { path = directoryName; } } string text = EditorUtility.SaveFilePanelInProject("Create New Animation", "New Animation", "anim", message, path); AnimationClip result; if (text == "") { result = null; } else { result = AnimationWindowUtility.CreateNewClipAtPath(text); } return(result); }
internal static AnimationClip CreateNewClip(string gameObjectName) { string message = string.Format("Create a new animation for the game object '{0}':", (object)gameObjectName); string path = ProjectWindowUtil.GetActiveFolderPath(); if (AnimationWindowUtility.s_LastPathUsedForNewClip != null) { string directoryName = Path.GetDirectoryName(AnimationWindowUtility.s_LastPathUsedForNewClip); if (directoryName != null && Directory.Exists(directoryName)) { path = directoryName; } } string clipPath = EditorUtility.SaveFilePanelInProject("Create New Animation", "New Animation", "anim", message, path); if (clipPath == string.Empty) { return((AnimationClip)null); } return(AnimationWindowUtility.CreateNewClipAtPath(clipPath)); }