// Update is called once per frame void Update() { //if (current == incant.A1) // setA1(true); if (!Input.anyKey && Input.GetAxis("Horizontal") == 0 && Input.GetAxis("HorizontalR") == 0 && Input.GetAxis("Vertical") == 0 && Input.GetAxis("VerticalR") == 0 && !GameObject.Find("Panel").GetComponent<Image>().enabled) { if (incA1()) { if (!camera_KHÖÖMEI.GetComponent<AudioSource>().isPlaying) { camera_INDIAN.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().Stop(); camera_KHÖÖMEI.GetComponent<AudioSource>().volume = 0.5f; camera_KHÖÖMEI.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[2].Select(); current = incant.A1; } if (incA2()) { if (!camera_KHÖÖMEI.GetComponent<AudioSource>().isPlaying) { camera_INDIAN.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().Stop(); camera_KHÖÖMEI.GetComponent<AudioSource>().volume = 0.5f; camera_KHÖÖMEI.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[3].Select(); if (current == incant.A1) { camera_KHÖÖMEI.GetComponent<AudioSource>().volume = 1f; incantiees.startFire(); } current = incant.A2; } if (incB1()) { if (!camera_INDIAN.GetComponent<AudioSource>().isPlaying) { camera_KHÖÖMEI.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().Stop(); camera_INDIAN.GetComponent<AudioSource>().volume = 0.5f; camera_INDIAN.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[0].Select(); current = incant.B1; } if (incB2()) { if (!camera_INDIAN.GetComponent<AudioSource>().isPlaying) { camera_KHÖÖMEI.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().Stop(); camera_INDIAN.GetComponent<AudioSource>().volume = 0.5f; camera_INDIAN.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[1].Select(); if (current == incant.B1) { camera_INDIAN.GetComponent<AudioSource>().volume = 1f; incantiees.startRain(); } current = incant.B2; } if (incC1()) { if (!camera_NATIVEAMERICAN.GetComponent<AudioSource>().isPlaying) { camera_KHÖÖMEI.GetComponent<AudioSource>().Stop(); camera_INDIAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().volume = 0.5f; camera_NATIVEAMERICAN.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[4].Select(); current = incant.C1; } if (incC2()) { if (!camera_NATIVEAMERICAN.GetComponent<AudioSource>().isPlaying) { camera_KHÖÖMEI.GetComponent<AudioSource>().Stop(); camera_INDIAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().volume = 0.5f; camera_NATIVEAMERICAN.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[5].Select(); if (current == incant.C1) { camera_NATIVEAMERICAN.GetComponent<AudioSource>().volume = 1f; incantiees.startRain(); } current = incant.C2; } if (incD1()) { if (!camera_TIBETANMONK.GetComponent<AudioSource>().isPlaying) { camera_KHÖÖMEI.GetComponent<AudioSource>().Stop(); camera_INDIAN.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().volume = 0.5f; camera_TIBETANMONK.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[6].Select(); current = incant.D1; } if (incD2()) { if (!camera_TIBETANMONK.GetComponent<AudioSource>().isPlaying) { camera_KHÖÖMEI.GetComponent<AudioSource>().Stop(); camera_INDIAN.GetComponent<AudioSource>().Stop(); camera_NATIVEAMERICAN.GetComponent<AudioSource>().Stop(); camera_TIBETANMONK.GetComponent<AudioSource>().volume = 0.5f; camera_TIBETANMONK.GetComponent<AudioSource>().Play(); } canvas.GetComponentsInChildren<Button>()[7].Select(); if (current == incant.D1) { camera_TIBETANMONK.GetComponent<AudioSource>().volume = 1f; incantiees.startFire(); } current = incant.D2; } } }
public void setA1(bool lerp) { current = lerp ? incant.A1 : incant.none; character.RightArm.rotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.RightArm.rotation.eulerAngles, new Vector3(0, 0, 90), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 90)); character.RightArm.GetChild(0).transform.localRotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.RightArm.GetChild(0).transform.localRotation.eulerAngles, new Vector3(0, 0, 90), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 90)); character.LeftArm.rotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.LeftArm.rotation.eulerAngles, new Vector3(0, 0, 270), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 270)); character.LeftArm.GetChild(0).transform.localRotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.LeftArm.GetChild(0).transform.localRotation.eulerAngles, new Vector3(0, 0, 90), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 90)); character.RightLeg.rotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.RightLeg.rotation.eulerAngles, new Vector3(0, 0, 45), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 45)); character.RightLeg.GetChild(0).transform.localRotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.RightLeg.GetChild(0).transform.localRotation.eulerAngles, new Vector3(0, 0, 315), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 315)); character.LeftLeg.rotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.LeftLeg.rotation.eulerAngles, new Vector3(0, 0, 0), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 0)); character.LeftLeg.GetChild(0).transform.localRotation = lerp ? Quaternion.Euler(Vector3.Lerp(character.LeftLeg.GetChild(0).transform.localRotation.eulerAngles, new Vector3(0, 0, 0), Time.deltaTime)) : Quaternion.Euler(new Vector3(0, 0, 0)); }