Class BakedLevel

Namespace
TDMaker.Unity.Authoring
Assembly
TDMaker.Unity.dll

The result of baking a level: core inputs plus lookups back to authoring assets for the view.

public sealed class BakedLevel
Inheritance
BakedLevel
Inherited Members

Properties

CameraFraming

Camera framing of the level (from its LevelAsset or a scene override); never null after baking.

public CameraFramingData CameraFraming { get; }

Property Value

CameraFramingData

HeroSpawns

Spawn position for each hero, index-aligned with Heroes.

public IReadOnlyList<Vector2> HeroSpawns { get; }

Property Value

IReadOnlyList<Vector2>

Heroes

Hero assets in Level.AvailableHeroes order.

public IReadOnlyList<HeroAsset> Heroes { get; }

Property Value

IReadOnlyList<HeroAsset>

Level

Level definition for the simulation.

public LevelDef Level { get; }

Property Value

LevelDef

Music

Music of the level (from its LevelAsset); never null after baking.

public LevelMusicData Music { get; }

Property Value

LevelMusicData

Paths

Authoring paths (with lane settings) used to build the level.

public IReadOnlyList<PathData> Paths { get; }

Property Value

IReadOnlyList<PathData>

RaisesRemains

Whether any baked template raises bodies (the view then draws body markers).

public bool RaisesRemains { get; }

Property Value

bool

Spells

Spell assets in Level.AvailableSpells (and Simulation.Spells) order.

public IReadOnlyList<SpellAsset> Spells { get; }

Property Value

IReadOnlyList<SpellAsset>

Templates

Resolved templates for the simulation.

public TemplateRegistry Templates { get; }

Property Value

TemplateRegistry

Methods

GetHero(string)

Finds the hero asset for a template id.

public HeroAsset GetHero(string templateId)

Parameters

templateId string

Returns

HeroAsset

GetSpell(int)

Finds the spell asset for a spell index (Simulation.Spells order).

public SpellAsset GetSpell(int index)

Parameters

index int

Returns

SpellAsset

GetTower(string)

Finds the tower asset for a template id.

public TowerAsset GetTower(string templateId)

Parameters

templateId string

Returns

TowerAsset

GetTowerTier(string)

One-based upgrade depth of a tower template (1 = buildable base), or 0 when unknown.

public int GetTowerTier(string templateId)

Parameters

templateId string

Returns

int

IsBossWave(int)

Whether the one-based wave waveNumber is flagged as a boss wave (presentation hint).

public bool IsBossWave(int waveNumber)

Parameters

waveNumber int

Returns

bool

RateVictory(int)

Stars (0..3) the level's VictoryRating gives for lives remaining. During play read GameState.VictoryStars or the Victory event's IntValue instead.

public int RateVictory(int lives)

Parameters

lives int

Returns

int

TryGetAsset(string, out EntityAssetBase)

Finds the authoring asset for a template id.

public bool TryGetAsset(string templateId, out EntityAssetBase asset)

Parameters

templateId string
asset EntityAssetBase

Returns

bool

TryGetEffect(string, out StatusEffectAsset)

Finds the status effect asset for an effect id (from effect events).

public bool TryGetEffect(string effectId, out StatusEffectAsset asset)

Parameters

effectId string
asset StatusEffectAsset

Returns

bool

TryGetMechanicVisual(string, out MechanicVisual)

Finds the colour and VFX of a keyed mechanic (chain, multi-target attack or region pulse) from its event key.

public bool TryGetMechanicVisual(string key, out MechanicVisual visual)

Parameters

key string
visual MechanicVisual

Returns

bool

TryGetProjectile(string, out ProjectileAsset)

Finds a projectile asset by view key.

public bool TryGetProjectile(string viewKey, out ProjectileAsset asset)

Parameters

viewKey string
asset ProjectileAsset

Returns

bool

WithTemplates(TemplateRegistry)

Returns a copy that uses templates (for example decorated by SimulationRunner.AddTemplateDecorator) and keeps every authoring lookup.

public BakedLevel WithTemplates(TemplateRegistry templates)

Parameters

templates TemplateRegistry

Returns

BakedLevel