//setup for a cutscene void CutsceneSetup() { //since this is run on initilization, set the cutscene to be fresh TalkToGrandpa script = GameObject.Find("grandpa").GetComponent <TalkToGrandpa> (); script.setCutscene(true); }
//grandpaCutscene is the second cutscene of the game. It is a conversation between Grandblob and //the player blob. public void grandpaCutscene() { //change background so text will show up Image fadeImage = GameObject.Find("FadeImage").GetComponent <Image>(); fadeImage.color = new Color32(255, 255, 225, 50); Cursor.visible = false; GameObject UICanvas = GameObject.Find("UICanvas"); UI uiScript = UICanvas.GetComponent <UI>(); uiScript.setSkip(false); //Print grandblob scene string [] messages = new string[9]; messages [0] = "Grandblob! I found you!"; messages [1] = "H-h-hello t-t-t-here..."; messages [2] = "Grandblob? Are you okay?"; messages [3] = "I'm just... So... C-c-c-old..."; messages [4] = "Grandblob, you don't look so good..."; messages [5] = "......................................"; messages [6] = "Grandblob! Nooo! You're frozen!!!"; messages [7] = ""; messages [8] = "Go find someone to help!"; //create times array int[] times = new int[9]; for (int i = 0; i < times.Length; i++) { times [i] = 3; } //change color based on dialogue Color[] colors = new Color[9]; //set dialogue colors Color grandblobColor = new Color32(1, 12, 255, 255); Color blobColor = new Color32(0, 244, 225, 255); colors [0] = blobColor; colors [1] = grandblobColor; colors [2] = blobColor; colors [3] = grandblobColor; colors [4] = blobColor; colors [5] = grandblobColor; colors [6] = blobColor; colors [7] = grandblobColor; colors [8] = Color.white; StartCoroutine(uiScript.specialWait(messages, times, colors)); TalkToGrandpa script = GameObject.Find("grandpa").GetComponent <TalkToGrandpa> (); script.setCutscene(false); //activate the next cutscene Blobrarian scriptLibrary = GameObject.Find("Blobrarian").GetComponent <Blobrarian> (); scriptLibrary.setCutscene(true); }