}//End Text Blip Setter #endregion #region Behaviours private void Awake() { dialogueChoicePrefab = (GameObject)Resources.Load("Prefabs/Option"); conversationHUD = GameObject.FindGameObjectWithTag("HUD").GetComponent <ConversationHUD>(); conversationHUD.setNPCLineInBox(""); conversationHUD.setPlayerLineInBox(""); }//End Awake
} //End HUD int getter #endregion //Get the game objects and scripts for managing the HUD private void Start() { if (conversationHUDGameObject == null) { conversationHUDGameObject = GameObject.FindGameObjectWithTag("Conversation HUD"); }//End if if (explorationHUDGameObject == null) { explorationHUDGameObject = GameObject.FindGameObjectWithTag("Exploration HUD"); }//End if conversationHUDScript = gameObject.GetComponent <ConversationHUD>(); explorationHUDScript = gameObject.GetComponent <ExplorationHUD>(); activeHUD = (int)HUDOptions.exploration; }//End Start
} //End Type enumerator private IEnumerator TypeLineIntoBox() { playerSource = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AudioSource>(); float typingSpeed; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); stringBuilder.Insert(0, displayLine); ConversationHUD conversationHUD = GameObject.FindGameObjectWithTag("HUD").GetComponent <ConversationHUD>(); for (int i = 0; i < displayLine.Length; i++) { playerSource.PlayOneShot(playerSource.clip); conversationHUD.setPlayerLineInBox(conversationHUD.getPlayerLineInBox().text + displayLine[i]); typingSpeed = setTypingSpeedByChar(displayLine[i]); stringBuilder.Replace(stringBuilder.ToString()[i], ' ', i, 1); text.text = stringBuilder.ToString(); yield return(new WaitForSeconds(typingSpeed)); }//End for yield return(new WaitForSeconds(0.5f)); DialogueManager dialogueManager = GameObject.FindGameObjectWithTag("Game Manager").GetComponent <DialogueManager>(); dialogueManager.runDialogue(setLine); }//End UntypeLine