public void turnOffAllCP() { GameObject go_one = GameObject.Find("cp1"); cp_ONE_class one_class = (cp_ONE_class)go_one.GetComponent(typeof(cp_ONE_class)); one_class.turnOffCP_ONE(); //*************************************// GameObject go_two = GameObject.Find("cp2"); cp_TWO_class two_class = (cp_TWO_class)go_two.GetComponent(typeof(cp_TWO_class)); two_class.turnOffCP_TWO(); //*************************************// GameObject go_three = GameObject.Find("cp3"); cp_THREE_class three_class = (cp_THREE_class)go_three.GetComponent(typeof(cp_THREE_class)); three_class.turnOffCP_THREE(); //*************************************// GameObject go_four = GameObject.Find("cp4"); cp_FOUR_class four_class = (cp_FOUR_class)go_four.GetComponent(typeof(cp_FOUR_class)); four_class.turnOffCP_FOUR(); //*************************************// GameObject go_five = GameObject.Find("cp5"); cp_FIVE_class five_class = (cp_FIVE_class)go_five.GetComponent(typeof(cp_FIVE_class)); five_class.turnOffCP_FIVE(); //*************************************// GameObject go_six = GameObject.Find("cp6"); cp_SIX_class six_class = (cp_SIX_class)go_six.GetComponent(typeof(cp_SIX_class)); six_class.turnOffCP_SIX(); //*************************************// }
public void changeTheDude() { randomInt = Random.Range(1, 4); //randomInt = Random.Range(2,3); if (randomInt == 1) { animator.SetInteger("movementInt", 1); stretchToBeDone = 1; timerIsGoing = false; playDoneAudio(); isBlinking = false; isSolid = false; //*************************************// GameObject go = GameObject.Find("cp2"); cp_TWO_class secondDisplay = (cp_TWO_class)go.GetComponent(typeof(cp_TWO_class)); secondDisplay.turnOnCP_TWO(); //*************************************// GameObject go2 = GameObject.Find("cp4"); cp_FOUR_class another_go_class = (cp_FOUR_class)go2.GetComponent(typeof(cp_FOUR_class)); another_go_class.turnOnCP_FOUR(); //***************** PAN THE CAMERA BELOW ********************// giveTheCameraAPan(); } else if (randomInt == 2) { animator.SetInteger("movementInt", 4); stretchToBeDone = 4; timerIsGoing = false; playDoneAudio(); isBlinking = false; isSolid = false; //*************************************// GameObject go = GameObject.Find("cp1"); cp_ONE_class secondDisplay = (cp_ONE_class)go.GetComponent(typeof(cp_ONE_class)); secondDisplay.turnOnCP_ONE(); //*************************************// GameObject go2 = GameObject.Find("cp3"); cp_THREE_class another_go_class = (cp_THREE_class)go2.GetComponent(typeof(cp_THREE_class)); another_go_class.turnOnCP_THREE(); //***************** PAN THE CAMERA BELOW ********************// giveTheCameraAPan(); } else if (randomInt == 3) { animator.SetInteger("movementInt", 7); stretchToBeDone = 7; timerIsGoing = false; playDoneAudio(); isBlinking = false; isSolid = false; //*************************************// GameObject go = GameObject.Find("cp1"); cp_ONE_class secondDisplay = (cp_ONE_class)go.GetComponent(typeof(cp_ONE_class)); secondDisplay.turnOnCP_ONE(); //*************************************// GameObject go2 = GameObject.Find("cp4"); cp_FOUR_class another_go_class = (cp_FOUR_class)go2.GetComponent(typeof(cp_FOUR_class)); another_go_class.turnOnCP_FOUR(); //***************** PAN THE CAMERA BELOW ********************// giveTheCameraAPan(); } }