Learn / Documentation / Script Reference / UIPopupDatabase
Manual

UIPopupDatabase

class in Doozy.Engine.UI / Inherits from ScriptableObject

Description

The UIPopupDatabase class is a database model used by the UIPopupManager to store references of pairs of UIPopup prefab and popup name.

Properties

  • public bool IsEmpty – Returns TRUE if the Database is empty

Public Variables

Public Methods

  • public bool Add(string popupName, GameObject prefab, bool performUndo, bool saveAssets) – Adds a new entry to the database. Returns TRUE if the operation was successful

  • public bool Contains(string popupName) – Returns TRUE if the popup name has been defined in the database

  • public bool Contains(UIPopup prefab) – Returns TRUE if the prefab has a reference in the database

  • public bool Delete(UIPopupNameToPrefabLink reference) – Deletes a reference from the database. Returns TRUE if the operation was successful

  • public GameObject GetPrefab(string popupName) – Returns the prefab reference associated with the given popup name. Returns null if the popup name has not been defined in the database.

  • public string GetPopupName(UIPopup prefab) – Returns the popup name defined for the given prefab. Returns null if the prefab has not been referenced in the database.

  • public int IndexOf(string popupName) – Iterates through the database and returns the index where the popup name is found. Returns -1 if the popup name was not found.

  • public int IndexOf(UIPopup prefab) – Iterates through the database and returns the index where the prefab reference is found. Returns -1 if the prefab reference was not found.

  • public void RefreshDatabase(bool performUndo, bool saveAssets) – Refreshes the entire database by adding removing empty and null entries, sorting the database and updating the category names list.

  • public bool Remove(string popupName, bool performUndo,bool saveAssets) – Iterates through the database to look for the popup name. If found, removes the entry and returns TRUE.

  • public bool Remove(UIPopup prefab, bool performUndo, bool saveAssets) – Iterates through the database to look for the prefab. If found, removes the entry and returns TRUE.

  • public void RemoveDuplicateEntries(bool performUndo, bool saveAssets = false) – Removes any duplicate entries found in the database

  • public bool RemoveReferencesWithNoName(bool performUndo, bool saveAssets = false) – Iterates through the database and removes any entry that does not have a name. If no entry is removed it returns FALSE.

  • public bool RemoveReferencesWithNullPrefabs(bool performUndo, bool saveAssets = false) – Iterates through the database and removes any entry that has a null prefab reference. If no entry is removed it returns FALSE.

  • public bool RemoveNullReferences(bool performUndo, bool saveAssets = false) – Iterates through the database and removes any null entry. If no entry is removed it returns FALSE.

  • public bool ResetDatabase(bool saveAssets = true) – Resets the entire database by removing all the entries

  • public void UndoRecord(string undoMessage) – Records any changes done on the object after this function

  • public void SetDirty(bool saveAssets) – [Editor Only] Marks target object as dirty. (Only suitable for non-scene objects)

  • public void Sort(bool performUndo, bool saveAssets = false) – Sorts the entire database

  • public void UpdateNames() – Updates the list of all the popup names as defined in the database