Photon Quantum 3.0.0

Static Public Member Functions | List of all members
Quantum.GameObjectUtils Class Reference

Unity game object utility methods for Quantum. More...

Static Public Member Functions

static void Hide (this Component component)
 Set the component game object to inactive after checking for null. More...
 
static void Hide (this GameObject gameObject)
 Will GameObject.SetActive(bool) to false if the game object is not null and is active."/> More...
 
static void Hide (this GameObject[] gameObjects)
 Hiding will GameObject.SetActive(bool) to false on all game objects in the array. More...
 
static void Hide< T > (this T[] components)
 Set all game objects found the component list to in-active after checking for null. More...
 
static void Show (this Component component)
 Sets the component game object to active after checking for null. More...
 
static void Show (this GameObject gameObject)
 Will GameObject.SetActive(bool) to true if the game object is not null and not already active. More...
 
static void Show (this GameObject[] gameObjects)
 Showing will GameObject.SetActive(bool) to true on all game objects in the array. More...
 
static void Show (this Image component, Sprite sprite)
 Sets the image sprite and sets the game object to active after checking the component for null. More...
 
static void Show< T > (this T[] components)
 Set all game objects found the component list to active after checking for null. More...
 
static bool Toggle (this Component component, bool state)
 Set the component's game object active state into the desired state after checking for null. More...
 
static bool Toggle (this GameObject gameObject)
 Toggle the game object's active state after checking for null. More...
 
static bool Toggle (this GameObject gameObject, bool state)
 Set game object active state into the desired state after checking for null. More...
 

Detailed Description

Unity game object utility methods for Quantum.

Member Function Documentation

◆ Show() [1/4]

static void Quantum.GameObjectUtils.Show ( this GameObject[]  gameObjects)
inlinestatic

Showing will GameObject.SetActive(bool) to true on all game objects in the array.

Parameters
gameObjectsList of game objects to process

◆ Hide() [1/3]

static void Quantum.GameObjectUtils.Hide ( this GameObject[]  gameObjects)
inlinestatic

Hiding will GameObject.SetActive(bool) to false on all game objects in the array.

Parameters
gameObjectsList of game objects to process

◆ Show() [2/4]

static void Quantum.GameObjectUtils.Show ( this GameObject  gameObject)
inlinestatic

Will GameObject.SetActive(bool) to true if the game object is not null and not already active.

Parameters
gameObjectGame object to show

◆ Hide() [2/3]

static void Quantum.GameObjectUtils.Hide ( this GameObject  gameObject)
inlinestatic

Will GameObject.SetActive(bool) to false if the game object is not null and is active."/>

Parameters
gameObjectGame object to hide

◆ Toggle() [1/3]

static bool Quantum.GameObjectUtils.Toggle ( this GameObject  gameObject)
inlinestatic

Toggle the game object's active state after checking for null.

Parameters
gameObjectGame object to toggle
Returns
Returns the final state of the game object active state of false if null

◆ Toggle() [2/3]

static bool Quantum.GameObjectUtils.Toggle ( this GameObject  gameObject,
bool  state 
)
inlinestatic

Set game object active state into the desired state after checking for null.

Parameters
gameObjectGame object to toggle
stateThe state to toggle into
Returns
Returns the final game object active state or false when null

◆ Toggle() [3/3]

static bool Quantum.GameObjectUtils.Toggle ( this Component  component,
bool  state 
)
inlinestatic

Set the component's game object active state into the desired state after checking for null.

Parameters
componentComponent to toggle its game object
stateThe desired active state
Returns
The final active state of the components game object or false if null

◆ Show() [3/4]

static void Quantum.GameObjectUtils.Show ( this Component  component)
inlinestatic

Sets the component game object to active after checking for null.

Parameters
componentInput component

◆ Show() [4/4]

static void Quantum.GameObjectUtils.Show ( this Image  component,
Sprite  sprite 
)
inlinestatic

Sets the image sprite and sets the game object to active after checking the component for null.

Parameters
componentImage component
spriteSprite to set

◆ Hide() [3/3]

static void Quantum.GameObjectUtils.Hide ( this Component  component)
inlinestatic

Set the component game object to inactive after checking for null.

Parameters
componentInput component

◆ Show< T >()

static void Quantum.GameObjectUtils.Show< T > ( this T[]  components)
inlinestatic

Set all game objects found the component list to active after checking for null.

Template Parameters
TType must be derived from component
Parameters
componentsComponent list to enabled game objects on
Type Constraints
T :Component 

◆ Hide< T >()

static void Quantum.GameObjectUtils.Hide< T > ( this T[]  components)
inlinestatic

Set all game objects found the component list to in-active after checking for null.

Template Parameters
TType must be derived from component
Parameters
componentsComponent list to disable game objects on
Type Constraints
T :Component