void Start() { scrollingCamera = GameObject.FindObjectOfType <ScrollingCamera>(); instance = this; canSpin = true; LevelSelectGUI.menuState = MenuState.TITLE; AmbientNoise.Play(); ScreenFade.FadeFrom(new Color(0, 0, 0, 0)); GUIController.DisableTexts(); RecordingManager.enableGUI = false; // Change skybox based on which world is unlocked GetComponent <Skybox>().material = skyboxes[SaveManager.save.worldUnlocked - 1]; if (worldToShow != "") { GameObject.Find(worldToShow).SendMessage("OnMouseDown", SendMessageOptions.DontRequireReceiver); GameObject.Find(worldToShow).SendMessage("OnMouseUp", SendMessageOptions.DontRequireReceiver); Camera.main.GetComponent <ScrollingCamera>().FinishImmediate(); RotateToLevel(levelToShow); if (worldTransition) { worldTransition = false; StartCoroutine("WorldTransition"); } } }
// Update is called once per frame void Update() { transform.localScale = Vector3.Lerp(transform.localScale, originalScale, 5.0f * Time.deltaTime); // Load the level once the button is back to it's original size. if (pressed) { timer -= Time.deltaTime; if (timer < 0) { gameObject.layer = LayerMask.NameToLayer("Ignore Raycast"); Camera.main.GetComponent <GUILayer>().enabled = false; LevelSelectGUI.worldToShow = LevelSelectGUI.currentWorld; LevelSelectGUI.levelToShow = LevelSelectGUI.currentLevel.number; LevelSelectGUI.LoadSelectedLevel(); pressed = false; } } }
void Start() { scrollingCamera = GameObject.FindObjectOfType<ScrollingCamera>(); instance = this; canSpin = true; LevelSelectGUI.menuState = MenuState.TITLE; AmbientNoise.Play(); ScreenFade.FadeFrom(new Color(0, 0, 0, 0)); GUIController.DisableTexts(); RecordingManager.enableGUI = false; // Change skybox based on which world is unlocked GetComponent<Skybox>().material = skyboxes[SaveManager.save.worldUnlocked-1]; if (worldToShow != "") { GameObject.Find(worldToShow).SendMessage("OnMouseDown", SendMessageOptions.DontRequireReceiver); GameObject.Find(worldToShow).SendMessage("OnMouseUp", SendMessageOptions.DontRequireReceiver); Camera.mainCamera.GetComponent<ScrollingCamera>().FinishImmediate(); RotateToLevel(levelToShow); if (worldTransition) { worldTransition = false; StartCoroutine("WorldTransition"); } } }