// Use this for initialization void Start() { controller = GameObject.Find ("Player").GetComponent<RemoteControl>(); controller.AddSelector(gameObject); if(hasHalos){ closeHalo = (Behaviour)transform.GetChild (0).GetComponent ("Halo"); farHalo = (Behaviour)transform.GetChild (1).GetComponent ("Halo"); leftHalo = (Behaviour)transform.GetChild (2).GetComponent ("Halo"); rightHalo = (Behaviour)transform.GetChild (3).GetComponent ("Halo"); closeHalo.enabled = false; farHalo.enabled = false; leftHalo.enabled = false; rightHalo.enabled = false; } for(int i = 0; i < controlledRepulsors.Length; i++){ Selector sel = ((GameObject)controlledRepulsors[i]).GetComponent<Selector>(); if(sel != null){ sel.AddSwitch(gameObject); } } }