// Initializ public void Start() { //initialize dialogue Assets.Scripts.ParserXML.Parser parser = new Assets.Scripts.ParserXML.Parser(); List <NPC> npcs = parser.npcs; MarthaLines = new string[2]; Replies1 = new string[2]; MarthaLines[0] = npcs[2].dialogues[0].Text; MarthaLines[1] = npcs[2].dialogues[1].Text; Replies1[0] = npcs[2].dialogues[0].Options[0]; Replies1[1] = npcs[2].dialogues[0].Options[1]; // Initialize variables InitializeCtrlVariables(); _textComp = GameObject.Find("otherText").GetComponent <Text>(); // Load possible actions _answersList = new List <string[]>(); _answersList.Add(Replies1); // _answersList.Add(Replies2); // Initialize buttons _answerA = GameObject.Find("answerA").GetComponent <Button>(); _answerB = GameObject.Find("answerB").GetComponent <Button>(); // Start actions HideButtons(); ContinueDialogue(); }
private void Start() { Assets.Scripts.ParserXML.Parser parser = new Assets.Scripts.ParserXML.Parser(); List <NPC> npcs = parser.npcs; professorLines = new string[2]; jimmyLines = new string[2]; professorLines[0] = npcs[4].dialogues[2].Options[0]; professorLines[1] = npcs[4].dialogues[2].Options[1]; jimmyLines[0] = npcs[4].dialogues[3].Options[0]; jimmyLines[1] = npcs[4].dialogues[3].Options[1]; // Get main character's speech objects _mainCharacterSpeechBalloon = GameObject.Find("mainCharacterSpeech").GetComponent <Image>(); _mainCharacterSpeech = GameObject.Find("mainCharacterSpeechText").GetComponent <Text>(); _mainCharacterSpeechText = _mainCharacterSpeech.text; // Get cmt character's speech objects _cmtCharacterSpeechBalloon = GameObject.Find("CMTcharacterSpeech").GetComponent <Image>(); _scottSpeech = GameObject.Find("CMTcharacterSpeechText").GetComponent <Text>(); _cmtCharacterSpeechText = _mainCharacterSpeech.text; _mainCharacterTurn = false; _interactionOver = false; _displayButton = false; _professorCounter = _jimmyCounter = 0; Interaction(); }
public void Start() { Assets.Scripts.ParserXML.Parser cenas = new Assets.Scripts.ParserXML.Parser(); List <NPC> npcs = cenas.npcs; _facts = new string[4]; _facts[0] = npcs[5].dialogues[0].Options[0]; _facts[1] = npcs[5].dialogues[0].Options[1]; _facts[2] = npcs[5].dialogues[0].Options[2]; _facts[3] = npcs[5].dialogues[0].Options[3]; // Initialize Variables _rand = new System.Random(); _textObject = GameObject.Find("Canvas/Content/Random Fact"); _text = _textObject.GetComponent <Text>(); // Generate Random Number int r = _rand.Next(0, _facts.Length); _fact = _facts[r]; // Set random fact text _text.text = _fact; }
// Initializ public void Start() { Assets.Scripts.ParserXML.Parser cenas = new Assets.Scripts.ParserXML.Parser(); List <NPC> npcs = cenas.npcs; Messages = new string[3]; Replies1 = new string[2]; Replies2 = new string[2]; Messages[0] = npcs[0].dialogues[0].Text; Messages[1] = npcs[0].dialogues[1].Text; Messages[2] = npcs[0].dialogues[1].Answer; Replies1[0] = npcs[0].dialogues[0].Options[0]; Replies1[1] = npcs[0].dialogues[0].Options[1]; Replies2[0] = npcs[0].dialogues[1].Options[0]; Replies2[1] = npcs[0].dialogues[1].Options[1]; _nomessage = npcs[0].dialogues[6].Text; // Initialize variables InitializeCtrlVariables(); _textComp = GameObject.Find("otherText").GetComponent <Text>(); // Load possible actions _answersList = new List <string[]>(); _answersList.Add(Replies1); _answersList.Add(Replies2); // Initialize buttons _answerA = GameObject.Find("answerA").GetComponent <Button>(); _answerB = GameObject.Find("answerB").GetComponent <Button>(); // Start actions HideButtons(); ContinueDialogue(); }
// Start interaction public void Start() { Assets.Scripts.ParserXML.Parser parser = new Assets.Scripts.ParserXML.Parser(); List <NPC> npcs = parser.npcs; _PlayerLines1 = new string[4]; _PlayerLines2A = new string[2]; _PlayerLines2B = new string[2]; _PlayerLines2C = new string[2]; _PlayerLines2D = new string[2]; _ScottLines1 = new string[4]; _ScottLines2A = new string[4]; _ScottLines2B = new string[4]; _ScottLines2C = new string[4]; _ScottLines2D = new string[4]; _PlayerLines1[0] = npcs[3].dialogues[0].Options[0]; _PlayerLines1[1] = npcs[3].dialogues[0].Options[1]; _PlayerLines1[2] = npcs[3].dialogues[0].Options[2]; _PlayerLines1[3] = npcs[3].dialogues[0].Options[3]; _PlayerLines2A[0] = npcs[3].dialogues[1].Options[0]; _PlayerLines2A[1] = npcs[3].dialogues[1].Options[1]; _PlayerLines2B[0] = npcs[3].dialogues[2].Options[0]; _PlayerLines2B[1] = npcs[3].dialogues[2].Options[1]; _PlayerLines2C[0] = npcs[3].dialogues[3].Options[0]; _PlayerLines2C[1] = npcs[3].dialogues[3].Options[1]; _PlayerLines2D[0] = npcs[3].dialogues[4].Options[0]; _PlayerLines2D[1] = npcs[3].dialogues[4].Options[1]; _ScottLines1[0] = npcs[3].dialogues[5].Options[0]; _ScottLines1[1] = npcs[3].dialogues[5].Options[1]; _ScottLines1[2] = npcs[3].dialogues[5].Options[2]; _ScottLines1[3] = npcs[3].dialogues[5].Options[3]; _ScottLines2A[0] = npcs[3].dialogues[6].Options[0]; _ScottLines2A[1] = npcs[3].dialogues[6].Options[1]; _ScottLines2B[0] = npcs[3].dialogues[7].Options[0]; _ScottLines2B[1] = npcs[3].dialogues[7].Options[1]; _ScottLines2C[0] = npcs[3].dialogues[8].Options[0]; _ScottLines2C[1] = npcs[3].dialogues[8].Options[1]; _ScottLines2D[0] = npcs[3].dialogues[9].Options[0]; _ScottLines2D[1] = npcs[3].dialogues[9].Options[1]; // initialize control variables _playerLevelScore = 0; _mainCharacterDialogueCounter = 0; _cmtCharacterDialogueCounter = 0; _mainCharacterTurn = true; _interactionOver = false; _writing = false; _displayChoices = true; _displayNextButton = false; _interactionIterator = 0; // Get Character's Lines // XMLParser("level1, mainCharacterLines ,cmtCharacterLines"); // Get main character's speech objects _mainCharacterSpeechBalloon = GameObject.Find("mainCharacterSpeech").GetComponent <Image>(); _mainCharacterSpeech = GameObject.Find("mainCharacterSpeechText").GetComponent <Text>(); _mainCharacterSpeechText = _mainCharacterSpeech.text; // Get cmt character's speech objects cmtCharacterSpeechBalloon = GameObject.Find("CMTcharacterSpeech").GetComponent <Image>(); scottSpeech = GameObject.Find("CMTcharacterSpeechText").GetComponent <Text>(); _cmtCharacterSpeechText = _mainCharacterSpeech.text; // Get buttons _answerA = GameObject.Find("answerA").GetComponent <Button>(); _answerB = GameObject.Find("answerB").GetComponent <Button>(); _answerC = GameObject.Find("answerC").GetComponent <Button>(); _answerD = GameObject.Find("answerD").GetComponent <Button>(); // Hide Speech balloons _mainCharacterSpeechBalloon.enabled = false; cmtCharacterSpeechBalloon.enabled = false; // Init Reactions & hide everything _excellent = GameObject.Find("excellent").GetComponent <Image>(); _excellent.enabled = false; _good = GameObject.Find("good").GetComponent <Image>(); _good.enabled = false; _bad = GameObject.Find("bad").GetComponent <Image>(); _bad.enabled = false; _awful = GameObject.Find("awful").GetComponent <Image>(); _awful.enabled = false; // initialize questions and answers _PlayerLinesList = new List <string[]>(); _PlayerLinesList.Add(_PlayerLines2A); _PlayerLinesList.Add(_PlayerLines2B); _PlayerLinesList.Add(_PlayerLines2C); _PlayerLinesList.Add(_PlayerLines2D); //Initialize interaction controller _answerController = new List <int[]>(); _answerController.Add(_answer1Controller); // _answerController.Add(_answer2Controller); // _answerController.Add(_answer2Controller); //Initialize scores controller _playerScore = new List <int[]>(); /* _playerScore.Add(_q1Scores); * _playerScore.Add(_q2Scores); * _playerScore.Add(_q3Scores);*/ _ScottLinesList = new List <string[]> { _ScottLines1, _ScottLines2A, /*_answers3*/ }; // Hide response buttons HideButtons(); StartCoroutine(Wait2Seconds()); // start actions }
// Start interaction public void Start() { // initialize control variables _playerLevelScore = 0; _mainCharacterDialogueCounter = 0; _cmtCharacterDialogueCounter = 0; _mainCharacterTurn = true; _interactionOver = false; _writing = false; _displayChoices = true; _displayNextButton = false; _questionsIterator = 0; //initialize dialogue Assets.Scripts.ParserXML.Parser cenas = new Assets.Scripts.ParserXML.Parser(); List <NPC> npcs = cenas.npcs; _mainCharacterLines = new string[1]; _cmtCharacterLines = new string[1]; _questionChoices1 = new string[2]; _answers1 = new string[2]; _questionChoices2 = new string[4]; _answers2 = new string[4]; _questionChoices3 = new string[4]; _answers3 = new string[4]; _mainCharacterLines[0] = npcs[0].dialogues[2].Text; _cmtCharacterLines[0] = npcs[0].dialogues[2].Answer; _questionChoices1[0] = npcs[0].dialogues[2].Options[0]; _questionChoices1[1] = npcs[0].dialogues[2].Options[1]; _answers1[0] = npcs[0].dialogues[3].Answer; _answers1[1] = npcs[0].dialogues[4].Answer; _questionChoices2[0] = npcs[0].dialogues[3].Options[0]; _questionChoices2[1] = npcs[0].dialogues[3].Options[1]; _questionChoices2[2] = npcs[0].dialogues[3].Options[2]; _questionChoices2[3] = npcs[0].dialogues[3].Options[3]; _answers2[0] = npcs[0].dialogues[5].Options[0]; _answers2[1] = npcs[0].dialogues[5].Options[1]; _answers2[2] = npcs[0].dialogues[5].Options[2]; _answers2[3] = npcs[0].dialogues[5].Options[3]; _questionChoices3[0] = npcs[0].dialogues[4].Options[0]; _questionChoices3[1] = npcs[0].dialogues[4].Options[1]; _questionChoices3[2] = npcs[0].dialogues[4].Options[2]; _questionChoices3[3] = npcs[0].dialogues[4].Options[3]; _answers3[0] = npcs[0].dialogues[6].Options[0]; _answers3[1] = npcs[0].dialogues[6].Options[1]; _answers3[2] = npcs[0].dialogues[6].Options[2]; _answers3[3] = npcs[0].dialogues[6].Options[3]; // Get main character's speech objects _mainCharacterSpeechBalloon = GameObject.Find("mainCharacterSpeech").GetComponent <Image>(); _mainCharacterSpeech = GameObject.Find("mainCharacterSpeechText").GetComponent <Text>(); // Get cmt character's speech objects _cmtCharacterSpeechBalloon = GameObject.Find("CMTcharacterSpeech").GetComponent <Image>(); _cmtCharacterSpeech = GameObject.Find("CMTcharacterSpeechText").GetComponent <Text>(); // Get buttons _answerA = GameObject.Find("answerA").GetComponent <Button>(); _answerB = GameObject.Find("answerB").GetComponent <Button>(); _answerC = GameObject.Find("answerC").GetComponent <Button>(); _answerD = GameObject.Find("answerD").GetComponent <Button>(); // Hide Speech balloons _mainCharacterSpeechBalloon.enabled = false; _cmtCharacterSpeechBalloon.enabled = false; // Init Reactions & hide everything _excellent = GameObject.Find("excellent").GetComponent <Image>(); _excellent.enabled = false; _good = GameObject.Find("good").GetComponent <Image>(); _good.enabled = false; _bad = GameObject.Find("bad").GetComponent <Image>(); _bad.enabled = false; _awful = GameObject.Find("awful").GetComponent <Image>(); _awful.enabled = false; // initialize questions and answers // TODO: Should be done with the xmlParser _questionsList = new List <string[]>(); _questionsList.Add(_questionChoices1); _questionsList.Add(_questionChoices2); _questionsList.Add(_questionChoices3); //Initialize interaction controller _answerController = new List <int[]>(); _answerController.Add(_answer1Controller); _answerController.Add(_answer2Controller); _answerController.Add(_answer2Controller); //Initialize scores controller _playerScore = new List <int[]>(); _playerScore.Add(_q1Scores); _playerScore.Add(_q2Scores); _playerScore.Add(_q3Scores); _cmtCharacterSpeechList = new List <string[]> { _answers1, _answers2, _answers3 }; // Hide response buttons HideButtons(); // start actions ContinueDialogue(); }