private void validateCounter() { // check if goalColor has enough buttons if (counter[0] == goalNumber) { open = true; // if so check if others are 0 for (int i = 1; i < counter.Length; i++) { if (counter[i] != 0) { open = false; // play audio clip that only red buttons should be pressed if (!this.didPlay) { AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.queueAudioClip(audioFiles.R4_NurRoteButtons, 3); } break; } } if (open == true) { this.GetComponent <Door>().move = true; } } }
public void ButtonPressed() { if (Input.GetButtonDown("ButtonPressed")) { if (pushPop) { transform.gameObject.GetComponentInParent <Animator> ().Play("Push"); } else { transform.gameObject.GetComponentInParent <Animator> ().Play("PushStay"); } // if it is the plattform button from level 2 also check if the door is already open, then play an audio file if (this.platform != null) { if (this.platform.name.Equals("Plattform 4x4")) { // check if the door is already open if (GameObject.Find("Door").GetComponent <Door>().move&& !this.didPlayGuteAlteSchalterClip) { AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.queueAudioClip(audioFiles.R2_GuteAlteSchalter, 1.0f); this.didPlayGuteAlteSchalterClip = true; } } } } }
// Use this for initialization void Start() { active = 0; buttonFrame = this.transform.GetChild(1); buttonCenter = this.transform.GetChild(2); //door = GameObject.Find ("Door AudioButtons"); this.audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2> (); }
// Use this for initialization void Start() { this.audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); // disable the four buttons GameObject.Find("AudioButton").GetComponent <AudioButton> ().setShouldAct(false); GameObject.Find("AudioButton 1").GetComponent <AudioButton> ().setShouldAct(false); GameObject.Find("AudioButton 2").GetComponent <AudioButton> ().setShouldAct(false); GameObject.Find("AudioButton 3").GetComponent <AudioButton> ().setShouldAct(false); }
// Use this for initialization void Start() { counterPressed = 0; counterHit = 0; buttons = GameObject.Find("ButtonWall"); audioButtons = buttons.GetComponentsInChildren <AudioColorButton>(); colorButtons = buttons.GetComponentsInChildren <ColorButton>(); audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); }
// Use this for initialization void Start() { counter = 0; open = false; audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); for (int i = 0; i < 5; i++) { code[i] = GameObject.Find("CodeCube" + (i + 1)); } }
void Update() { if (move) { if (time <= 1) { time += Time.deltaTime / duration; } transform.localScale = new Vector3(transform.localScale.x, Mathf.Lerp(minimum, maximum, time), transform.localScale.z); if (this.name.Equals("First Door")) { // tell the L2_R1SchalterSoundCollider Script that the player solved the riddle! GameObject.Find("R1SchalterSoundCollider").GetComponent <L2_R1SchalterSoundCollider>().setDidSolveRiddle(true); if (!this.didPlayFirstDoorOpenSound) { AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.firstRiddleSuccessSound); this.didPlayFirstDoorOpenSound = true; } } if (this.name.Equals("Door ColorButtons") && !this.didPlayR4_ReiseGehtWeiter) { // it is the red door in room 4 (level 2) AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.firstRiddleSuccessSound); AudioManager.instance.queueAudioClip(audioFiles.R4_ReiseGehtWeiter, 3); // play door sound AudioManager.instance.playSoundEffect(audioFiles.firstRiddleSuccessSound); this.didPlayR4_ReiseGehtWeiter = true; } if (this.name.Equals("Door") && !this.didPlaySecondDoorOpenSound) { AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.firstRiddleSuccessSound); this.didPlaySecondDoorOpenSound = true; } if (this.name.Equals("Door AudioButtons") && !this.didPlayAudioButtonDoorOpenSound) { AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.firstRiddleSuccessSound); this.didPlayAudioButtonDoorOpenSound = true; } } }
public void TriggerPlatform() { // load audio files level 2 AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.platformMovingSound); Invoke("playButtonReleaseDelayed", 0.35f); if (platform != null) { platform.GetComponent <Patrol>().NextPatrolPoint(); } }
public void hit(Collider col) { if (!pushed) { alive = lifetime; if (oldMaterial == null) { // play audio sound AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.buttonGazedSound); changeColor(buttonFrame); } } }
// Use this for initialization void Start() { this.audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2> (); }
private void playButtonReleaseDelayed() { AudioFilesLevel2 audioFiles = GameObject.Find("GM").GetComponent <AudioFilesLevel2>(); AudioManager.instance.playSoundEffect(audioFiles.buttonReleasedSound); }