Answers for "unity get all gameobjects with a script"

C#
1

unity find all objects with script

public void GetAllObjectsWithScript() {                
     ScriptName[] list = FindObjectsOfType(typeof(ScriptName)) as ScriptName[];
     foreach(ScriptName obj in list) {             
     	// Do whatever          
     }     
}
Posted by: Guest on November-09-2020
2

unity get all components in gameobject

GetComponents<Component>()
Posted by: Guest on December-27-2020

Code answers related to "unity get all gameobjects with a script"

C# Answers by Framework

Browse Popular Code Answers by Language