private void OnTriggerEnter2D(Collider2D collision) { SceneMasterScript sceneMaster = GameObject.FindObjectOfType <SceneMasterScript>(); GameManagerScript gameManager = GameObject.FindObjectOfType <GameManagerScript>(); TornadoRunSoundController soundController = GameObject.FindObjectOfType <TornadoRunSoundController>(); sceneMaster.SetConditionsState(true); gameManager.FinishGameScene(); soundController.FadeAndStopAllSounds(); }
private void Update() { // Shake effect if (buttonsLeft > 0) { Vector3 newPosition = originalCameraPos + Random.insideUnitSphere * shakeAmount; newPosition.z = originalCameraPos.z; mainCamera.transform.localPosition = newPosition; } else { mainCamera.transform.localPosition = originalCameraPos; SceneMasterScript sceneMaster = GameObject.FindObjectOfType <SceneMasterScript>(); sceneMaster.SetConditionsState(true); GameManagerScript gameManager = GameObject.FindObjectOfType <GameManagerScript>(); gameManager.FinishGameScene(); Destroy(this); } }
// Use this for initialization void Start() { sceneMasterScript = sceneMaster.GetComponent <SceneMasterScript>(); LoadMainMenuScene(); }