-
Notifications
You must be signed in to change notification settings - Fork 0
Unity Object Extension
Andrzej Kebab edited this page Feb 4, 2024
·
3 revisions
Finds all objects of a specified type in the scene.
Object[] foundObjects = UnityObjectExtension.FindObjects(typeof(MyType));Parameters:
-
type: The specified type of objects to find.
Returns:
-
Object[]: An array of objects of the specified type.
Finds all objects of a specified type in the scene.
MyType[] foundObjects = UnityObjectExtension.FindObjects<MyType>();Type Parameters:
-
T: The specified type of objects to find.
Returns:
-
T[]: An array of objects of the specified type.
Destroys the given Unity Object. This method provides a way to destroy an Object immediately if the application is not playing (in the Unity Editor), or normally if the application is playing.
Object myObject = GetObject();
myObject.Destroy();Parameters:
-
obj: The Unity Object to destroy.
Destroys the object immediately using Object.DestroyImmediate.
Object myObject = GetObject();
myObject.DestroyImmediate();Parameters:
-
obj: The object to destroy immediately.