HeavenStudioPlus/Assets/Scripts/LevelEditor/DialogHelpers/Dialog.cs
minenice55 164c9e9d91 make all dialogs inherit one base class
- opening a new dialog closes the previous one
2022-08-26 23:43:01 -04:00

28 lines
No EOL
677 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public class Dialog : MonoBehaviour
{
[SerializeField] protected GameObject dialog;
public void ForceState(bool onoff = false)
{
Editor.instance.canSelect = onoff;
Editor.instance.inAuthorativeMenu = !onoff;
dialog.SetActive(onoff);
}
public static void ResetAllDialogs()
{
foreach(var dialog in FindObjectsOfType<Dialog>())
{
dialog.ForceState(false);
}
}
}
}