unity get all components on gameobject code example
Example 1: unity get all gameobjects
//Get's all gameobjects and puts it in a list called "GameobjectList"
Object[] GameobjectList = Resources.FindObjectsOfTypeAll(typeof(GameObject));
Example 2: unity get all components in gameobject
GetComponents<Component>()