dialogCode GetCommandCode(string input) { string output = ""; char[] tempArray = input.ToCharArray(); List <char> workingList = new List <char>(); foreach (char character in tempArray) { workingList.Add(character); } foreach (char character in workingList) { if (character == '[') { continue; } else if (character == ']') { break; } else { output = output + character; } } switch (output) { case "Dialog": current = dialogCode.Dialog; return(dialogCode.Dialog); case "Option": current = dialogCode.Option; return(dialogCode.Option); case "End": current = dialogCode.End; string location = GameObject.FindGameObjectWithTag("Data").GetComponent <DataScript>().data.location; if (location == "dorm") { SceneManager.LoadScene("Dorm"); } if (location == "oliver") { SceneManager.LoadScene("Oliver"); } return(dialogCode.End); case "Scene": current = dialogCode.Scene; return(dialogCode.Scene); } return(dialogCode.Malformation); }
void DisplayBackground(dialogCode backgroundCode) { //if (backgroundCode != dialogCode.End) //{ // foreach (GameObject item in backgrounds) // { // item.SetActive(false); // } //} foreach (GameObject item in background) { item.SetActive(false); } switch (backgroundCode) { case dialogCode.Dialog: dialogBackground.SetActive(true); break; case dialogCode.Option: optionDailogBackground.SetActive(true); break; case dialogCode.End: endText.SetActive(true); break; } }
void DisplaySpeaker(dialogCode speaker) { foreach (GameObject item in speakers) { item.SetActive(false); } switch (speaker) { case dialogCode.Amini: amini.SetActive(true); break; case dialogCode.Arun: arun.SetActive(true); break; case dialogCode.Conrad: conrad.SetActive(true); break; case dialogCode.Danny: danny.SetActive(true); break; case dialogCode.Jace: jace.SetActive(true); break; case dialogCode.Ryn: ryn.SetActive(true); break; case dialogCode.Seth: seth.SetActive(true); break; case dialogCode.Player: player.SetActive(true); break; case dialogCode.Narrator: narrator.SetActive(true); break; } }