using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace BetterTee.Viewer
{
public abstract class ActViewer : MonoBehaviour
{
[Header("Settings")]
public ActSettings settings = null;
protected ActPhase phase = ActPhase.NONE;
[Header("Objects")]
public Canvas canvas = null;
public EventSystem eventSystem = null;
public ActPhase Phase {
get {
return phase;
}
}
[Serializable]
public class InvalidPhaseException : Exception {
public readonly ActPhase currentPhase;
public InvalidPhaseException(ActPhase currentPhase) {
this.currentPhase = currentPhase;
}
};
///
/// Call this to initialize the Act (GameObjects, ActSettings, etc). All interactable components should be disabled in this phase.
///
public virtual void ActInit() {
phase = ActPhase.INIT;
canvas = GameObject.FindGameObjectWithTag("Canvas")?.GetComponent