public void init() { player = (playerChar)GameObject.FindObjectOfType(typeof(playerChar));//DYNAMICALLY GET OUR CHARACTER ON INIT! sceneEventTracker = (eventTracker)GameObject.FindObjectOfType(typeof(eventTracker));//Dynamically get our eventTracker on INIT. if(currentNode != null) { if (currentNode.myType != nodeType.textOnly) { progressIndex = 0; choiceID = 0; text.text = ""; qText.text = currentNode.question; choiceArray = currentNode.endAnswerArray; tinyTimer = resetTimer; textSpeed = resetTextSpeed; charArray = new char[choiceArray[progressIndex].Length];//We get the length of the string in our current conversationPoint. isFinishedDisplaying = false; //prepStrings(); horiIndex = 0; vertIndex = 0; deleteText(); createTextObjects(); } } }
//The initialization function for when our program has started running. public void init() { player = (playerChar)GameObject.FindObjectOfType(typeof(playerChar));//DYNAMICALLY GET OUR CHARACTER ON INIT! sceneEventTracker = (eventTracker)GameObject.FindObjectOfType(typeof(eventTracker));//Dynamically get our eventTracker on INIT. //We set these next two so that the timers will know what number to reset to. resetTimer = tinyTimer; resetTextSpeed = textSpeed; isFinishedDisplaying = false; conversationPoint = 0;//So that we start at the BEGINNING of the convo if (currentNode !=null) { if (currentNode.myType != nodeType.question) {//Make sure to check whether or not we should even be bothering to set up. convArray = currentNode.convoTextArray;//Load up our text to sidplay from our node. text.text = "";//Make sure our text is empty before we start. charArray = new char[convArray[conversationPoint].Length];//We get the length of the string in our current conversationPoint. resetNPCFace(); prepStrings(); } else//If it's just a question, immediately activate our Ask Box buddy. { disableBox(); askQuestion(currentNode); } } }