Immerse SDK
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

ToggleObjects.ToggleObject

public static bool ToggleObject(GameObject gameObject)

Toggles the state of a passed in GameObject and sync for all users

Returns: True if object is in the scene and toggled successfully

Parameter Description
gameObject The object to toggle

public static bool ToggleObject(Behaviour behaviour)

Toggles the state of a passed in Behaviour and sync for all users

Returns: True if the behaviour is in the scene and was toggled successfully

Parameter Description
behaviour The behaviour to toggle

public static bool ToggleObject(Renderer renderer)

Toggles the state of a passed in Renderer and sync for all users

Returns: True if the renderer is in the scene and was toggled successfully

Parameter Description
renderer The renderer to toggle

public static bool ToggleObject(Collider collider)

Toggles the state of a passed in Collider and sync for all users

Returns: True if the collider is in the scene and was toggled successfully

Parameter Description
collider The collider to toggle