44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
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);
|
|
}
|
|
}
|