Class UnityObjectExtensions
Extension methods for Unity's Object class
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit
Assembly: cs.temp.dll.dll
Syntax
public static class UnityObjectExtensions
Methods
DestroyObject(Object, Single)
Destroys a Unity object appropriately depending if running in in edit or play mode.
Declaration
public static void DestroyObject(Object obj, float t = 0F)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Unity object to destroy |
Single | t | Time in seconds at which to destroy the object, if applicable. |
DontDestroyOnLoad(Object)
Enable Unity objects to skip "DontDestroyOnLoad" when editor isn't playing so test runner passes.
Declaration
public static void DontDestroyOnLoad(this Object target)
Parameters
Type | Name | Description |
---|---|---|
Object | target |
IsNull(Object)
Tests if the Unity object is null. Checks both the managed object and the underly Unity-managed native object
Declaration
public static bool IsNull(Object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean | True if either the managed or native object is null, false otherwise |