55 lines
1.1 KiB
C#
55 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BitStrap;
|
|
using UnityEngine;
|
|
|
|
public class HelpManager : MonoBehaviour
|
|
{
|
|
public HelpButton prevButton;
|
|
|
|
public HelpButton nextButton;
|
|
|
|
public List<HelpWindow> helpWindows = new List<HelpWindow>();
|
|
|
|
[ReadOnly]
|
|
public HelpWindow currentWindow;
|
|
|
|
public GameObject hideIfNoDLC;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (helpWindows.Count == 0)
|
|
{
|
|
helpWindows = GetComponentsInChildren<HelpWindow>().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]);
|
|
}
|
|
}
|