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

ToggleObjects.SetObject

public static bool SetObject(GameObject gameObject, bool active)

Sets the state of the provided GameObject and syncs for all users

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

Parameter Description
gameObject The object to set
active New status

public static bool SetObject(Behaviour behaviour, bool enabled)

Sets the state of the provided Behaviour and syncs for all users

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

Parameter Description
behaviour
enabled

public static bool SetObject(Renderer renderer, bool enabled)

Sets the state of the provided Renderer and syncs for all users

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

Parameter Description
renderer
enabled

public static bool SetObject(Collider collider, bool enabled)

Sets the state of the provided Collider and syncs for all users

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

Parameter Description
collider
enabled