2022-08-27 03:43:01 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using HeavenStudio.Editor.Track;
|
|
|
|
|
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Editor
|
|
|
|
{
|
|
|
|
public class Dialog : MonoBehaviour
|
|
|
|
{
|
2023-05-07 20:33:15 +00:00
|
|
|
public bool IsOpen { get { return dialog.activeSelf; } }
|
2022-08-27 03:43:01 +00:00
|
|
|
[SerializeField] protected GameObject dialog;
|
|
|
|
public void ForceState(bool onoff = false)
|
|
|
|
{
|
2023-05-07 20:33:15 +00:00
|
|
|
dialog.SetActive(onoff);
|
|
|
|
if (Editor.instance == null) return;
|
2022-10-13 16:20:48 +00:00
|
|
|
Editor.instance.canSelect = !onoff;
|
|
|
|
Editor.instance.inAuthorativeMenu = onoff;
|
2022-08-27 03:43:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void ResetAllDialogs()
|
|
|
|
{
|
|
|
|
foreach(var dialog in FindObjectsOfType<Dialog>())
|
|
|
|
{
|
|
|
|
dialog.ForceState(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|