EasyTalk API
Loading...
Searching...
No Matches
EasyTalk.Utils.SetupUtils Class Reference

Provides utility functions for correctly setting up prefabs and GameObjects in the scene. More...

Static Public Member Functions

static void SetUpEventSystem ()
 
static void SetUpTextComponents (GameObject gameObject, bool forceStandardText=false)
 If TextMeshPro is enabled/installed and forceStandardText is false, this method enables all TextMeshPro components and disables all Unity standard Text components on the GameObject provided; otherwise, all TextMeshPro components are disabled and the standard text components will be enabled.

Parameters
gameObjectThe GameObject to enable/disable text components on.
forceStandardTextWhether the GameObject should be forced to use standard text components, even if TextMeshPro is installed/enabled.

 

Static Private Member Functions

static void DisableTextMeshProObjects (GameObject gameObject)
 Finds all TextMeshPro components in the children of the provided GameObject (including itself) and sets them to be inactive.
 
static void EnableTextMeshProObjects (GameObject gameObject)
 Finds all TextMeshPro components in the children of the provided GameObject (including itself) and sets them to be active.
 
static void DisableStandardTextObjects (GameObject gameObject)
 Finds all Unity standard Text components in the children of the provided GameObject (including itself) and sets them to be inactive.
 
static void EnableStandardTextObjects (GameObject gameObject)
 Finds all Unity standard Text components in the children of the provided GameObject (including itself) and sets them to be active.
 
static void DisableTextMeshProObjectsByName (GameObject gameObject)
 Finds all components in the children of the provided GameObject (including itself) with names which include the text '(TMP)' and sets them to be inactive.
 

Detailed Description

Provides utility functions for correctly setting up prefabs and GameObjects in the scene.

Member Function Documentation

◆ DisableStandardTextObjects()

static void EasyTalk.Utils.SetupUtils.DisableStandardTextObjects ( GameObject gameObject)
staticprivate

Finds all Unity standard Text components in the children of the provided GameObject (including itself) and sets them to be inactive.

Parameters
gameObjectThe GameObject to search and disable GameObjects on if they contain Text components.

◆ DisableTextMeshProObjects()

static void EasyTalk.Utils.SetupUtils.DisableTextMeshProObjects ( GameObject gameObject)
staticprivate

Finds all TextMeshPro components in the children of the provided GameObject (including itself) and sets them to be inactive.

Parameters
gameObjectThe GameObject to search and disable GameObjects on if they contain TextMeshPro components.

◆ DisableTextMeshProObjectsByName()

static void EasyTalk.Utils.SetupUtils.DisableTextMeshProObjectsByName ( GameObject gameObject)
staticprivate

Finds all components in the children of the provided GameObject (including itself) with names which include the text '(TMP)' and sets them to be inactive.

Parameters
gameObjectThe GameObject to search and disable GameObjects on if they contain TextMeshPro components.

◆ EnableStandardTextObjects()

static void EasyTalk.Utils.SetupUtils.EnableStandardTextObjects ( GameObject gameObject)
staticprivate

Finds all Unity standard Text components in the children of the provided GameObject (including itself) and sets them to be active.

Parameters
gameObjectThe GameObject to search and enable GameObjects on if they contain Text components.

◆ EnableTextMeshProObjects()

static void EasyTalk.Utils.SetupUtils.EnableTextMeshProObjects ( GameObject gameObject)
staticprivate

Finds all TextMeshPro components in the children of the provided GameObject (including itself) and sets them to be active.

Parameters
gameObjectThe GameObject to search and enable GameObjects on if they contain TextMeshPro components.

◆ SetUpEventSystem()

static void EasyTalk.Utils.SetupUtils.SetUpEventSystem ( )
static

◆ SetUpTextComponents()

static void EasyTalk.Utils.SetupUtils.SetUpTextComponents ( GameObject gameObject,
bool forceStandardText = false )
static

If TextMeshPro is enabled/installed and forceStandardText is false, this method enables all TextMeshPro components and disables all Unity standard Text components on the GameObject provided; otherwise, all TextMeshPro components are disabled and the standard text components will be enabled.

Parameters
gameObjectThe GameObject to enable/disable text components on.
forceStandardTextWhether the GameObject should be forced to use standard text components, even if TextMeshPro is installed/enabled.