protected override void Awake() { base.Awake(); contentManager = new UnityUIInstancedContentManager(); if (contentContainer == null && Debug.isDebugBuild) { Debug.LogError("Quest Machine: Content Container is unassigned.", this); } if (activeQuestHeadingTemplate != null) { activeQuestHeadingTemplate.gameObject.SetActive(false); } if (activeQuestBodyTemplate != null) { activeQuestBodyTemplate.gameObject.SetActive(false); } if (completedQuestHeadingTemplate != null) { completedQuestHeadingTemplate.gameObject.SetActive(false); } if (completedQuestBodyTemplate != null) { completedQuestBodyTemplate.gameObject.SetActive(false); } }
protected override void Awake() { base.Awake(); contentManager = new UnityUIInstancedContentManager(); if (contentContainer == null && Debug.isDebugBuild) { Debug.LogError("Quest Machine: Content Container is unassigned.", this); } }
public void Assign(string text, bool expanded) { if (contentManager == null) { contentManager = new UnityUIInstancedContentManager(); } contentManager.Clear(); name = text; foldoutText.text = text; interiorPanel.gameObject.SetActive(expanded); }
/// <summary> /// Shows a quest alert. /// </summary> /// <param name="questID">Quest ID.</param> /// <param name="contents">Complete quest alert content.</param> public virtual void ShowAlert(string questID, List <QuestContent> contents) { if (contents == null || contents.Count == 0) { return; } if (!isVisible) { Show(); } UnityUIContentTemplate alertInstance; if (contents.Count == 1) { AddContent(contents[0]); alertInstance = (contentManager.instancedContent.Count == 0) ? null : contentManager.instancedContent[contentManager.instancedContent.Count - 1]; } else { var container = Instantiate <UnityUIContainerTemplate>(alertContainerTemplate); alertInstance = container; contentManager.Add(container, currentContentContainer); var realContentManager = contentManager; // Don't add sub-contents to real content manager. contentManager = new UnityUIInstancedContentManager(); for (int i = 0; i < contents.Count; i++) { AddContent(contents[i]); container.AddInstanceToContainer(contentManager.GetLastAdded()); } contentManager = realContentManager; } if (alertInstance != null) { StartCoroutine(TimedDespawn(alertInstance, GetDisplayDuration(contents))); } onShowAlert.Invoke(); }
protected override void Awake() { base.Awake(); selectionPanelContentManager = new UnityUIInstancedContentManager(); detailsPanelContentManager = new UnityUIInstancedContentManager(); }