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
Object
ScriptableObject
EditorWindow
NewAssetDialog
Inherited Members
EditorWindow.focusedWindowChanged
EditorWindow.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.dataModeController
EditorWindow.rootVisualElement
EditorWindow.overlayCanvas
EditorWindow.wantsMouseMove
EditorWindow.wantsMouseEnterLeaveWindow
EditorWindow.wantsLessLayoutEvents
EditorWindow.autoRepaintOnSceneChange
EditorWindow.maximized
EditorWindow.hasFocus
EditorWindow.docked
EditorWindow.focusedWindow
EditorWindow.mouseOverWindow
EditorWindow.hasUnsavedChanges
EditorWindow.saveChangesMessage
EditorWindow.minSize
EditorWindow.maxSize
EditorWindow.title
EditorWindow.titleContent
EditorWindow.depthBufferBits
EditorWindow.antiAlias
EditorWindow.position
EditorWindow.windowFocusChanged
ScriptableObject.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.name
Object.hideFlags

Constructors

NewAssetDialog()

public NewAssetDialog()

Fields

DefaultFolder

Folder used when nothing else was picked yet.

public const string DefaultFolder = "Assets/TDMakerContent/Units"

Field Value

string

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

dialogTitle string
defaultName string
name string
chosenFolder string

Returns

bool

EnsureFolder(string)

Creates folder and its missing parents (project-relative, under Assets).

public static bool EnsureFolder(string folder)

Parameters

folder string

Returns

bool

IsPackageFolder(string)

Whether folder lies inside the 2D Tower Defense Maker package folder (samples included).

public static bool IsPackageFolder(string folder)

Parameters

folder string

Returns

bool

NextFolder()

The folder offered for the next new asset.

public static string NextFolder()

Returns

string

RememberFolder(string)

Remembers folder as the next suggestion (package folders are never remembered).

public static void RememberFolder(string folder)

Parameters

folder string

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

levelData string
lastUsed string

Returns

string

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

lastUsed string

Returns

string