Add tutorial system. Fox bugs raised by the group chat

This commit is contained in:
WillJeynes
2026-08-29 19:51:34 +01:00
parent 44c59c425c
commit fec7b392b5
23 changed files with 1075 additions and 124 deletions
+43
View File
@@ -0,0 +1,43 @@
using System.Collections.Generic;
using UnityEngine;
using Utils;
using Utils.Utils;
public class TutorialManager : Singleton<TutorialManager>
{
public List<GameEntry<GameObject>> tutorialOne;
public List<GameEntry<GameObject>> tutorialTwo;
private int index = 0;
public void LogAction(string action)
{
if (LevelLoader.Instance.GlobalModifier != "TUT1" && LevelLoader.Instance.GlobalModifier != "TUT2")
{
return;
}
var tutorial = LevelLoader.Instance.GlobalModifier == "TUT1" ? tutorialOne : tutorialTwo;
if (index < tutorial.Count && tutorial[index].key == action)
{
tutorial[index].value.SetActive(false);
index++;
if (index < tutorial.Count)
{
tutorial[index].value.SetActive(true);
}
}
}
public void ShowFirst()
{
if (LevelLoader.Instance.GlobalModifier != "TUT1" && LevelLoader.Instance.GlobalModifier != "TUT2")
{
return;
}
var tutorial = LevelLoader.Instance.GlobalModifier == "TUT1" ? tutorialOne : tutorialTwo;
tutorial[index].value.SetActive(true);
}
}