void Update() { collectCounter = playerMovement.collectCount; goalObj.GetComponent <Renderer> ().material.color = new Color(1, 1, 1, alpha); if (collectCounter == goal) { alpha = 1; } timer += Time.deltaTime; if (entered == true) { StartCoroutine(ScaleTime(1.0f, 0.0f, 1.0f)); //to reverse it: StartCoroutine(ScaleTime(0.0f, 1.0f, 1.0f)); //Non-LERP slow-mo /*timePct = new Vector3(Mathf.Lerp(1, 0, t), 0, 0); * timePct-= Time.deltaTime; * if (timePct < 0.0001f){ * timePct = 0; * }*/ } if (canProgress == true) { Debug.Log("2ay"); if (Input.GetButtonDown("Jump")) { Debug.Log("3ay"); SceneManager.LoadScene(nextLevel); BGM = FindObjectOfType <BGMusic>(); BGM.ChangeMusic(); } if (Input.GetButtonDown("Jump")) { Debug.Log("takeHOME"); SceneManager.LoadScene("lab"); BGM = FindObjectOfType <BGMusic>(); BGM.ChangeMusic(); } } }
// Update is called once per frame void Update() { playInScene = Application.loadedLevelName; if ((playInScene == "Act1S1Title") || (playInScene == "Act1S2TitleRygn") || (playInScene == "Act2TitleRygn") || (playInScene == "Act3Title") || (playInScene == "Act3PART2TITLE") || (playInScene == "Act4PART1TITLE") || (playInScene == "Act4PART3TITLE") || (playInScene == "MothDied") || (playInScene == "PrologueAct4part1")) { clip = 11; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "Act 1 Scene 1 Remake") { clip = 10; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "Act 1 Scene 2MONO") { clip = 2; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "Act 1 Scene 3A") { clip = 13; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act 2") { clip = 3; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act 3 Scene 1") { clip = 12; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act4 Part2 Scene4 room1") { clip = 6; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act3 PArt2 Scene 1") { clip = 1; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act4 Part3 Scene3") { clip = 7; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act4 Part3 Scene1") { clip = 5; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "New Act4 Part1 Scene1") { clip = 4; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } if (playInScene == "THE END") { clip = 9; bgmusic.ChangeMusic(clip, waitForSequence, keepTimeAndVolume, trackVolume, fadeIn, fadeOutPrevious); } }