/// <summary>
 /// Attempts to find the GUI root and scroll view if they weren't set.
 /// Sets up the scroll view.
 /// </summary>
 public override void Awake()
 {
     base.Awake();
     if (guiRoot == null)
     {
         guiRoot = GetComponentInChildren <GUIRoot>();
     }
     if (scrollView == null)
     {
         scrollView = GetComponentInChildren <GUIScrollView>();
     }
     if (scrollView != null)
     {
         scrollView.MeasureContentHandler += OnMeasureContent;
         scrollView.DrawContentHandler    += OnDrawContent;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Awakes this instance. Attempts to find the GUI root and scroll view if they weren't
 /// set.
 /// </summary>
 public void Awake()
 {
     IsOpen = false;
     if (guiRoot == null)
     {
         guiRoot = GetComponentInChildren <GUIRoot>();
     }
     if (scrollView == null)
     {
         scrollView = GetComponentInChildren <GUIScrollView>();
     }
     if (scrollView != null)
     {
         scrollView.MeasureContentHandler += OnMeasureContent;
         scrollView.DrawContentHandler    += OnDrawContent;
     }
 }
		/// <summary>
		/// On Awake, make sure that all properties have been set up properly.
		/// </summary>
		void Awake() {
			if (fpFreezePlayer == null) {
				Debug.LogError("You must assign FPFreezePlayer to " + name);
				enabled = false;
			}
			if (fpInventory == null) {
				Debug.LogError("You must assign vp_Inventory to " + name);
				enabled = false;
			}
			guiRoot = GetComponentInChildren<GUIRoot>();
			if (guiRoot == null) {
				Debug.LogError("No GUIRoot found under " + name);
				enabled = false;
			} else {
				guiRoot.gameObject.SetActive(false);
			}
			if (weaponPanels.Length <= 0) {
				Debug.LogError("You must assign at least one weapon panel to " + name);
				enabled = false;
			}
		}
 /// <summary>
 /// Attempts to find the GUI root and scroll view if they weren't set.
 /// Sets up the scroll view.
 /// </summary>
 public override void Awake()
 {
     base.Awake();
     if (guiRoot == null)
     {
         guiRoot = GetComponentInChildren <GUIRoot>();
     }
     if (scrollView == null)
     {
         scrollView = GetComponentInChildren <GUIScrollView>();
     }
     if (scrollView != null)
     {
         scrollView.MeasureContentHandler += OnMeasureContent;
         scrollView.DrawContentHandler    += OnDrawContent;
     }
     if (string.IsNullOrEmpty(groupHeadingGuiStyleName))
     {
         groupHeadingGuiStyleName = questHeadingGuiStyleName;
     }
 }
 /// <summary>
 /// Makes sure we have a GUIRoot and logs warnings if any critical controls are unassigned.
 /// </summary>
 private void FindControls()
 {
     if (guiRoot == null)
     {
         guiRoot = GetComponentInChildren <GUIRoot>();
     }
     unityUIRoot      = new UnityUIRoot(guiRoot);
     unityQTEControls = new UnityQTEControls(qteIndicators);
     SetupContinueButton(dialogue.npcSubtitle.continueButton);
     SetupContinueButton(dialogue.pcSubtitle.continueButton);
     SetupContinueButton(alert.continueButton);
     if (DialogueDebug.LogErrors)
     {
         if (guiRoot == null)
         {
             Debug.LogError(string.Format("{0}: UnityDialogueUI can't find GUIRoot and won't be able to display dialogue.", new System.Object[] { DialogueDebug.Prefix }));
         }
         if (DialogueDebug.LogWarnings)
         {
             if (dialogue.npcSubtitle.line == null)
             {
                 Debug.LogWarning(string.Format("{0}: UnityDialogueUI NPC Subtitle Line needs to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             }
             if (dialogue.pcSubtitle.line == null)
             {
                 Debug.LogWarning(string.Format("{0}: UnityDialogueUI PC Subtitle Line needs to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             }
             if (dialogue.responseMenu.buttons.Length == 0)
             {
                 Debug.LogWarning(string.Format("{0}: UnityDialogueUI Response buttons need to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             }
             if (alert.line == null)
             {
                 Debug.LogWarning(string.Format("{0}: UnityDialogueUI Alert Line needs to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             }
         }
     }
 }
Beispiel #6
0
 public UnityUIRoot(GUIRoot guiRoot)
 {
     this.guiRoot = guiRoot;
 }
 /// <summary>
 /// Makes sure we have a GUIRoot and logs warnings if any critical controls are unassigned.
 /// </summary>
 private void FindControls()
 {
     if (guiRoot == null) guiRoot = GetComponentInChildren<GUIRoot>();
     unityUIRoot = new UnityUIRoot(guiRoot);
     unityQTEControls = new UnityQTEControls(qteIndicators);
     SetupContinueButton(dialogue.npcSubtitle.continueButton);
     SetupContinueButton(dialogue.pcSubtitle.continueButton);
     SetupContinueButton(alert.continueButton);
     if (DialogueDebug.LogErrors) {
         if (guiRoot == null) Debug.LogError(string.Format("{0}: UnityDialogueUI can't find GUIRoot and won't be able to display dialogue.", new System.Object[] { DialogueDebug.Prefix }));
         if (DialogueDebug.LogWarnings) {
             if (dialogue.npcSubtitle.line == null) Debug.LogWarning(string.Format("{0}: UnityDialogueUI NPC Subtitle Line needs to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             if (dialogue.pcSubtitle.line == null) Debug.LogWarning(string.Format("{0}: UnityDialogueUI PC Subtitle Line needs to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             if (dialogue.responseMenu.buttons.Length == 0) Debug.LogWarning(string.Format("{0}: UnityDialogueUI Response buttons need to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
             if (alert.line == null) Debug.LogWarning(string.Format("{0}: UnityDialogueUI Alert Line needs to be assigned.", new System.Object[] { DialogueDebug.Prefix }));
         }
     }
 }
Beispiel #8
0
 public UnityUIRoot(GUIRoot guiRoot)
 {
     this.guiRoot = guiRoot;
 }
 /// <summary>
 /// Attempts to find the GUI root and scroll view if they weren't set.
 /// Sets up the scroll view.
 /// </summary>
 public override void Awake()
 {
     base.Awake();
     if (guiRoot == null) guiRoot = GetComponentInChildren<GUIRoot>();
     if (scrollView == null) scrollView = GetComponentInChildren<GUIScrollView>();
     if (scrollView != null) {
         scrollView.MeasureContentHandler += OnMeasureContent;
         scrollView.DrawContentHandler += OnDrawContent;
     }
 }