// Use this for initialization void Start() { switchR = GameObject.Find("switchR").GetComponent <RedSwitchScript> (); switchG = GameObject.Find("switchG").GetComponent <GreenSwitchScript> (); switchB = GameObject.Find("switchB").GetComponent <BlueSwitchScript> (); chest = transform.parent.GetComponentInChildren <ChestScript>(); }
void Start() { spriteRend = this.GetComponent <SpriteRenderer> (); deactivate(); name = gameObject.name; switchR = GameObject.Find("switchR").GetComponent <RedSwitchScript> (); switchB = GameObject.Find("switchB").GetComponent <BlueSwitchScript> (); trapSwitch = GameObject.Find("trap1").GetComponent <TrapSwitchT2Script> (); }