public class AutoFindDemo : MonoBehaviour { // will search for collider attached to gameobject [AutoFind(typeof(Collider))] public Collider boxCollider; // will search for renderer attached to gameobject + children [AutoFind(typeof(Renderer), true)] public Renderer sphereRenderer; }