Class NewLevelBuilder
- Namespace
- TDMaker.Editor
- Assembly
- TDMaker.Editor.dll
Headless core of Tools > 2D Tower Defense Maker > New Level: creates a level folder with a Level asset, a Wave Set, starter
units (sample kit or Unit Workshop presets), a HUD theme and a sprite material, and a scene built by the sample scene builder
(Simulation Runner, Level Authoring, one path across the frame, six build slots with rally points on the road, camera,
Game HUD, Level View, audio and music players). The result passes the Project Validator and plays in the Dry Run: lost
without towers, won with a defense. Usable from tests and -executeMethod; the window only collects the settings.
public static class NewLevelBuilder
- Inheritance
-
NewLevelBuilder
- Inherited Members
Fields
ContentRoot
Parent of the default level folders.
public const string ContentRoot = "Assets/TDMakerContent"
Field Value
MaxWaves
Highest wave count the wizard accepts.
public const int MaxWaves = 30
Field Value
Methods
Create(NewLevelSettings)
Creates the level. Replaces the open scenes with the new scene (callers ask to save modified scenes first). Throws ArgumentException when Validate(NewLevelSettings) reports a problem.
public static NewLevelResult Create(NewLevelSettings settings)
Parameters
settingsNewLevelSettings
Returns
DefaultFolder(string)
The default folder for a level name: Assets/TDMakerContent/<Name>.
public static string DefaultFolder(string levelName)
Parameters
levelNamestring
Returns
ResolveFolder(NewLevelSettings)
The folder settings resolves to (normalized; the default folder when empty).
public static string ResolveFolder(NewLevelSettings settings)
Parameters
settingsNewLevelSettings
Returns
SampleKitAvailable()
Whether the Basic sample assets the sample kit uses are in the project.
public static bool SampleKitAvailable()
Returns
ScenePathFor(NewLevelSettings)
The scene path the level will be saved to.
public static string ScenePathFor(NewLevelSettings settings)
Parameters
settingsNewLevelSettings
Returns
Validate(NewLevelSettings)
Checks the settings; returns a message describing the first problem, or null when they can be used.
public static string Validate(NewLevelSettings settings)
Parameters
settingsNewLevelSettings