using System;
using UnityEngine;
using UnityEngine.EventSystems;
public abstract class ActController : MonoBehaviour
{
[Header("Settings")]
public ActSettings settings = null;
protected ActPhase phase = ActPhase.NONE;
[Header("Results")]
public ActResults results = null;
[Header("Objects")]
public Canvas canvas = null;
public EventSystem eventSystem = null;
[Serializable]
public class InvalidPhaseException : Exception {
public readonly ActPhase currentPhase;
public InvalidPhaseException(ActPhase currentPhase) {
this.currentPhase = currentPhase;
}
};
[Serializable]
public class MissingSettingsException : Exception {};
public ActPhase Phase { get; }
///
/// 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