Created
October 9, 2023 20:32
-
-
Save drusepth/0257ae9d982396863876c16d38bc3b1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Start() | |
{ | |
StartCoroutine(Script()); | |
} | |
private void Update() | |
{ | |
if (waitingForClick && (Input.GetMouseButtonDown(0) || Input.GetKeyDown(KeyCode.Space))) | |
waitingForClick = false; | |
} | |
IEnumerator Script() | |
{ | |
// Silent pan & zoom to computer | |
cameraController.TriggerPanAndZoom(); | |
yield return new WaitForSeconds(Mathf.Max(cameraController.panDuration, cameraController.zoomDuration)); | |
yield return new WaitForSeconds(1f); | |
// Tutorial/background story intro | |
tutorialContainer.SetActive(true); | |
foreach (Transform child in tutorialContainer.transform) | |
{ | |
child.gameObject.SetActive(true); | |
yield return new WaitForSeconds(3f); | |
} | |
yield return new WaitForSeconds(2f); | |
// Wait for the user to click to the next section | |
waitingForClick = true; | |
clickToContinue.SetActive(true); | |
while (waitingForClick) | |
yield return null; | |
clickToContinue.SetActive(false); | |
// Hide tutorial and show how to play | |
tutorialContainer.SetActive(false); | |
howToPlayContainer.SetActive(true); | |
// Wait for the user to click to the next section | |
waitingForClick = true; | |
clickToContinue.SetActive(true); | |
while (waitingForClick) | |
yield return null; | |
clickToContinue.SetActive(false); | |
// Hide how to play and show how to win | |
howToPlayContainer.SetActive(false); | |
howToWinContainer.SetActive(true); | |
// Wait for the user to click to start the game | |
waitingForClick = true; | |
clickToContinue.SetActive(true); | |
while (waitingForClick) | |
yield return null; | |
clickToContinue.SetActive(false); | |
// Quickly zoom into the computer to transition into the main game scene | |
cameraController.startPoint = cameraController.transform.position; | |
cameraController.startCameraSize = cameraController.GetComponent<Camera>().orthographicSize; | |
cameraController.finishPoint = new Vector2(-10.82f, 1.23f); | |
cameraController.endCameraSize = 0.2f; | |
cameraController.zoomDuration = 1f; | |
cameraController.panDuration = 1f; | |
cameraController.TriggerPanAndZoom(); | |
yield return new WaitForSeconds(1f); | |
SceneManager.LoadScene("Remote Desktop Viewer"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment