Answers for "unity find all objects in scene with component"

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

get all the game objects in a scene unity

Resources.FindObjectsOfTypeAll(typeof(urFavClass));
Posted by: Guest on October-20-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language