using System.Collections.Generic; using System.Linq; using BitStrap; using UnityEngine; public class HelpManager : MonoBehaviour { public HelpButton prevButton; public HelpButton nextButton; public List helpWindows = new List(); [ReadOnly] public HelpWindow currentWindow; public GameObject hideIfNoDLC; private void OnEnable() { if (helpWindows.Count == 0) { helpWindows = GetComponentsInChildren().ToList(); } Show(helpWindows[0]); if ((bool)hideIfNoDLC && (bool)DLCManager.Instance && !DLCManager.Instance.IsDLCInstalled(DLCManager.DLC_ID.GREENLAND)) { hideIfNoDLC.SetActive(false); } } public void HideAll() { foreach (HelpWindow helpWindow in helpWindows) { helpWindow.Show(false); } } public void Show(HelpWindow window) { HideAll(); window.Show(true); prevButton.helpWindow = window.prevWindow; nextButton.helpWindow = window.nextWindow; prevButton.gameObject.SetActive(window.prevWindow); nextButton.gameObject.SetActive(window.nextWindow); } public void ShowScreen(int screenId) { Show(helpWindows[screenId]); } }