UnityObjectExtensions Class

Definition

Extension methods for Unity's Object class

C++
public ref class UnityObjectExtensions abstract sealed
Inheritance
UnityObjectExtensions

Methods

DestroyObject(Object, Single)

Destroys a Unity object appropriately depending if running in edit or play mode.

DontDestroyOnLoad(Object)

Enable Unity objects to skip "DontDestroyOnLoad" when editor isn't playing so test runner passes.

IsNotNull<T>(T)

Tests if an interface is null, taking potential UnityEngine.Object derived class implementers into account which require their overridden operators to be called.

IsNull<T>(T)

Tests if an interface is null, taking potential UnityEngine.Object derived class implementers into account which require their overridden operators to be called.

TryGetMonoBehaviour<T>(T, MonoBehaviour)

Properly checks an interface for null and returns the MonoBehaviour implementing it.

Applies to

Produit Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0