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"); } } }
public void RemoveAmbient(AudioClip ac) { AmbientNoise am = GetComponent <AmbientNoise> (); if (am == null) { return; } am.RemoveSound(ac); }
public void AddAmbient(AudioClip ac) { AmbientNoise am = GetComponent <AmbientNoise> (); if (am == null) { am = gameObject.AddComponent <AmbientNoise> (); } am.AddSound(ac); }
void Awake() { if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
public void Start() { tutorialCamera = FindObjectOfType <TutorialCamera>(); MainGUI = GameObject.Find("MainGUI").GetComponent <Animator>(); if (TutorialCamera.Enabled()) { enabled = false; return; } else { enabled = true; initialCameraPosition = transform.position; initialCameraRotation = transform.rotation; AmbientNoise.Play(); PauseButton.paused = false; player = GameObject.Find("Player"); grapplingHook = player.GetComponent <GrapplingHook>(); playerMovements = player.GetComponent <PlayerMovements>(); //ControlManager.Disabled = true; if (!GameRecorder.playingBack) { GameRecorder.StopPlayback(); if (LevelSelectGUI.currentLevel != null) { GUIController.ShowText("LevelName", LevelSelectGUI.currentLevel.name); } #if UNITY_ANDROID || UNITY_IPHONE GUIController.ShowText("Text", "Tap to begin"); #else //GUIController.ShowText("Text", "Click to begin"); //tutorialCamera.ShowTutorialText("Click to begin", false); StartCoroutine(ShowStartText()); #endif GUIController.GUILevelPause(); GUIController.HideText("Paused"); } EnableCameraController(); } }