public void Clicked() { // Uses the same basic method as guidance but stats counting at // 10 if you need more space in the guidance system you'll need to tweak a few numbrs here for (int i = 0; i < 10; i++) { GameObject arrow = GameObject.Find("Arrow" + i); Arrow_Control arrows = arrow.GetComponent <Arrow_Control>(); arrows.ActivateGuidance(); } // This script will also make an emergency trigger arrow appear, hitting this arrow // is what will activate the emergency system and disble the others GameObject triggerarrow = GameObject.Find("EmergencyTriggerArrow"); Arrow_Control triggerarrows = triggerarrow.GetComponent <Arrow_Control>(); triggerarrows.ActivateGuidance(); GameObject beam = GameObject.Find("EmergencyLightBeam"); Pillar_Controller bluebeam = beam.GetComponent <Pillar_Controller>(); bluebeam.GuidancePillar(); Destroy(gameObject); Destroy(GameObject.Find("book1(Clone)")); }
public void Clicked() { //This will need to be repeated for every arrow we need, in order to work all arrows must follow the same naming convention! for (int i = 0; i < 10; i++) { GameObject arrow = GameObject.Find("Arrow" + i); Arrow_Control arrows = arrow.GetComponent <Arrow_Control>(); arrows.ActivateGuidance(); } GameObject beam = GameObject.Find("LightBeam"); Pillar_Controller bluebeam = beam.GetComponent <Pillar_Controller>(); bluebeam.GuidancePillar(); Destroy(gameObject); Destroy(GameObject.Find("book2(Clone)")); }