Class NewAssetDialog
- Namespace
- TDMaker.Editor
- Assembly
- TDMaker.Editor.dll
Small modal dialog of the Unit Workshop's New menu: asks for the asset name and the folder it is created in. The folder defaults to the current user level's Data folder, then a user content folder (DefaultFolder, or the last folder picked), never to the package's own sample folders unless the user picks one explicitly.
public sealed class NewAssetDialog : EditorWindow
- Inheritance
-
ObjectScriptableObjectEditorWindowNewAssetDialog
- Inherited Members
-
EditorWindow.focusedWindowChangedEditorWindow.BeginWindows()EditorWindow.EndWindows()EditorWindow.ShowNotification(GUIContent)EditorWindow.RemoveNotification()EditorWindow.ShowTab()EditorWindow.Focus()EditorWindow.ShowUtility()EditorWindow.ShowPopup()EditorWindow.ShowModalUtility()EditorWindow.ShowAsDropDown(Rect, Vector2)EditorWindow.Show()EditorWindow.ShowAuxWindow()EditorWindow.ShowModal()EditorWindow.GetWindow<T>()EditorWindow.HasOpenInstances<T>()EditorWindow.FocusWindowIfItsOpen<T>()EditorWindow.GetWindowWithRect<T>(Rect)EditorWindow.SaveChanges()EditorWindow.DiscardChanges()EditorWindow.Close()EditorWindow.Repaint()EditorWindow.SendEvent(Event)EditorWindow.GetExtraPaneTypes()EditorWindow.dataModeControllerEditorWindow.rootVisualElementEditorWindow.overlayCanvasEditorWindow.wantsMouseMoveEditorWindow.wantsMouseEnterLeaveWindowEditorWindow.wantsLessLayoutEventsEditorWindow.autoRepaintOnSceneChangeEditorWindow.maximizedEditorWindow.hasFocusEditorWindow.dockedEditorWindow.focusedWindowEditorWindow.mouseOverWindowEditorWindow.hasUnsavedChangesEditorWindow.saveChangesMessageEditorWindow.minSizeEditorWindow.maxSizeEditorWindow.titleEditorWindow.titleContentEditorWindow.depthBufferBitsEditorWindow.antiAliasEditorWindow.positionEditorWindow.windowFocusChangedScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Constructors
NewAssetDialog()
public NewAssetDialog()
Fields
DefaultFolder
Folder used when nothing else was picked yet.
public const string DefaultFolder = "Assets/TDMakerContent/Units"
Field Value
Methods
Ask(string, string, out string, out string)
Shows the dialog. Returns false when cancelled; otherwise the chosen name (file name without extension) and the project-relative folder (created if missing).
public static bool Ask(string dialogTitle, string defaultName, out string name, out string chosenFolder)
Parameters
Returns
EnsureFolder(string)
Creates folder and its missing parents (project-relative, under Assets).
public static bool EnsureFolder(string folder)
Parameters
folderstring
Returns
IsPackageFolder(string)
Whether folder lies inside the 2D Tower Defense Maker package folder (samples included).
public static bool IsPackageFolder(string folder)
Parameters
folderstring
Returns
NextFolder()
The folder offered for the next new asset.
public static string NextFolder()
Returns
RememberFolder(string)
Remembers folder as the next suggestion (package folders are never remembered).
public static void RememberFolder(string folder)
Parameters
folderstring
SuggestContextFolder(string, string)
Prefer the current user level's data folder, then the remembered folder, then the independent content root.
public static string SuggestContextFolder(string levelData, string lastUsed)
Parameters
Returns
SuggestFolder(string)
The folder offered for a new asset: the last folder the user picked, unless it is missing, outside the project or inside
the package (Assets/TDMaker/, which holds the samples), in which case DefaultFolder.
public static string SuggestFolder(string lastUsed)
Parameters
lastUsedstring