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
-
ObjectComponentBehaviourMonoBehaviourSaveSlotScreen
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
Constructors
SaveSlotScreen()
public SaveSlotScreen()
Properties
ConfirmOpen
Whether the delete confirmation is open.
public bool ConfirmOpen { get; }
Property Value
PendingDelete
Slot the open confirmation would delete, or -1.
public int PendingDelete { get; }
Property Value
Slots
The slots shown, or null.
public CampaignSaveSlots Slots { get; }
Property Value
Theme
The theme (the default theme when none is set).
public HudTheme Theme { get; set; }
Property Value
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
slotint
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
parentTransformthemeHudTheme
Returns
FormatSavedTime(DateTime)
Formats the stored local time with the Gregorian calendar, independent of the player's culture.
public static string FormatSavedTime(DateTime localTime)
Parameters
localTimeDateTime
Returns
Refresh()
Re-reads every slot summary.
public void Refresh()
RequestDelete(int)
Opens the delete confirmation for slot.
public void RequestDelete(int slot)
Parameters
slotint
Show(CampaignSaveSlots)
Shows the slots of saveSlots.
public void Show(CampaignSaveSlots saveSlots)
Parameters
saveSlotsCampaignSaveSlots
Events
BackRequested
Raised by the Back button (or Esc without an open dialog).
public event Action BackRequested
Event Type
SlotChosen
Raised when the player picks a slot (its index).
public event Action<int> SlotChosen
Event Type
SlotDeleted
Raised after a slot was deleted (its index).
public event Action<int> SlotDeleted