Answers for "gameobject find all objects unity"

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
0

unity get all gameobjects

//Get's all gameobjects and puts it in a list called "GameobjectList"
Object[] GameobjectList = Resources.FindObjectsOfTypeAll(typeof(GameObject));
Posted by: Guest on December-08-2020

C# Answers by Framework

Browse Popular Code Answers by Language