Class SaveSlotScreen

Namespace
TDMaker.Unity.Campaign
Assembly
TDMaker.Unity.dll

Save slot picker built from code (styled by a HudTheme): one row per slot of a CampaignSaveSlots with its stars, levels won and last play time, a Continue / New Campaign button and Delete (with a confirmation dialog: Delete, Cancel). One click on a slot opens it (SlotChosen); a new slot needs no name or extra confirmation. Keys: 1-9 choose a slot, Esc cancels the dialog and then goes back. Texts use HudTexts keys.

[AddComponentMenu("2D Tower Defense Maker/Campaign/Save Slot Screen")]
public sealed class SaveSlotScreen : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
SaveSlotScreen
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
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

SaveSlotScreen()

public SaveSlotScreen()

Properties

ConfirmOpen

Whether the delete confirmation is open.

public bool ConfirmOpen { get; }

Property Value

bool

PendingDelete

Slot the open confirmation would delete, or -1.

public int PendingDelete { get; }

Property Value

int

Slots

The slots shown, or null.

public CampaignSaveSlots Slots { get; }

Property Value

CampaignSaveSlots

Theme

The theme (the default theme when none is set).

public HudTheme Theme { get; set; }

Property Value

HudTheme

Methods

Back()

Raises BackRequested.

public void Back()

CancelDelete()

Closes the delete confirmation without deleting.

public void CancelDelete()

Choose(int)

Picks slot slot (raises SlotChosen).

public void Choose(int slot)

Parameters

slot int

ConfirmDelete()

Deletes the slot of the open confirmation.

public void ConfirmDelete()

Create(Transform, HudTheme)

Creates the screen under parent (a canvas or a rect inside one), stretched to fill it.

public static SaveSlotScreen Create(Transform parent, HudTheme theme)

Parameters

parent Transform
theme HudTheme

Returns

SaveSlotScreen

FormatSavedTime(DateTime)

Formats the stored local time with the Gregorian calendar, independent of the player's culture.

public static string FormatSavedTime(DateTime localTime)

Parameters

localTime DateTime

Returns

string

Refresh()

Re-reads every slot summary.

public void Refresh()

RequestDelete(int)

Opens the delete confirmation for slot.

public void RequestDelete(int slot)

Parameters

slot int

Show(CampaignSaveSlots)

Shows the slots of saveSlots.

public void Show(CampaignSaveSlots saveSlots)

Parameters

saveSlots CampaignSaveSlots

Events

BackRequested

Raised by the Back button (or Esc without an open dialog).

public event Action BackRequested

Event Type

Action

SlotChosen

Raised when the player picks a slot (its index).

public event Action<int> SlotChosen

Event Type

Action<int>

SlotDeleted

Raised after a slot was deleted (its index).

public event Action<int> SlotDeleted

Event Type

Action<int>