/// <summary> /// Makes sure we have a UIRoot and logs warnings if any critical controls are unassigned. /// </summary> private void FindControls() { if (uiRoot == null) uiRoot = GetComponentInChildren<UIRoot>(); nguiUIRoot = new NGUIUIRoot(uiRoot, deactivateUIRootWhenHidden); nguiQTEControls = new NGUIQTEControls(qteIndicators); SetupContinueButton(dialogue.npcSubtitle.continueButton); SetupContinueButton(dialogue.pcSubtitle.continueButton); SetupContinueButton(alert.continueButton); if (DialogueDebug.LogErrors) { if (uiRoot == null) Debug.LogError(string.Format("{0}: NGUIDialogueUI can't find UIRoot and won't be able to display dialogue.", DialogueDebug.Prefix)); if (DialogueDebug.LogWarnings) { if (dialogue.npcSubtitle.line == null) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI NPC Subtitle Line needs to be assigned.", DialogueDebug.Prefix)); if (dialogue.pcSubtitle.line == null) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI PC Subtitle Line needs to be assigned.", DialogueDebug.Prefix)); if (dialogue.responseMenu.buttons.Length == 0) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI Response buttons need to be assigned.", DialogueDebug.Prefix)); if (alert.line == null) Debug.LogWarning(string.Format("{0}: NGUIDialogueUI Alert Line needs to be assigned.", DialogueDebug.Prefix)); } } }
/// <summary> /// Makes sure we have a UIRoot and logs warnings if any critical controls are unassigned. /// </summary> private void FindControls() { if (uiRoot == null) { uiRoot = GetComponentInChildren <UIRoot>(); } nguiUIRoot = new NGUIUIRoot(uiRoot, deactivateUIRootWhenHidden); nguiQTEControls = new NGUIQTEControls(qteIndicators); SetupContinueButton(dialogue.npcSubtitle.continueButton); SetupContinueButton(dialogue.pcSubtitle.continueButton); SetupContinueButton(alert.continueButton); if (DialogueDebug.LogErrors) { if (uiRoot == null) { Debug.LogError(string.Format("{0}: NGUIDialogueUI can't find UIRoot and won't be able to display dialogue.", DialogueDebug.Prefix)); } if (DialogueDebug.LogWarnings) { if (dialogue.npcSubtitle.line == null) { Debug.LogWarning(string.Format("{0}: NGUIDialogueUI NPC Subtitle Line needs to be assigned.", DialogueDebug.Prefix)); } if (dialogue.pcSubtitle.line == null) { Debug.LogWarning(string.Format("{0}: NGUIDialogueUI PC Subtitle Line needs to be assigned.", DialogueDebug.Prefix)); } if (dialogue.responseMenu.buttons.Length == 0) { Debug.LogWarning(string.Format("{0}: NGUIDialogueUI Response buttons need to be assigned.", DialogueDebug.Prefix)); } if (alert.line == null) { Debug.LogWarning(string.Format("{0}: NGUIDialogueUI Alert Line needs to be assigned.", DialogueDebug.Prefix)); } } } }