Class CampaignEditing

Namespace
TDMaker.Editor
Assembly
TDMaker.Editor.dll

Editing helpers for CampaignAsset shared by the inspector, the New Level wizard and tests.

public static class CampaignEditing
Inheritance
CampaignEditing
Inherited Members

Methods

AddLevel(CampaignAsset, LevelAsset, Vector2)

Appends level to the campaign at mapPosition (0..1) with a fresh key, its name as the title and the Previous Level rule (undoable). Returns the index of the new entry, or the existing one when the level is already in it.

public static int AddLevel(CampaignAsset campaign, LevelAsset level, Vector2 mapPosition)

Parameters

campaign CampaignAsset
level LevelAsset
mapPosition Vector2

Returns

int

MakeKey(CampaignAsset, string)

A key for a new level from name (lower case, words joined by '_'), unique in the campaign.

public static string MakeKey(CampaignAsset campaign, string name)

Parameters

campaign CampaignAsset
name string

Returns

string

NextPosition(CampaignAsset)

A free spot for a new point: right of the last level (wrapping to the next row), or the map centre.

public static Vector2 NextPosition(CampaignAsset campaign)

Parameters

campaign CampaignAsset

Returns

Vector2