Select Git revision
ScrollDetails.cs
ScrollDetails.cs 18.32 KiB
using Newtonsoft.Json;
using REST_JSON_API;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using static CommunicationEvents;
public class ScrollDetails : MonoBehaviour
{
public static ScrollDetails Instance
{
get => _Instance;
set
{
if (_Instance == null)
_Instance = value;
else
if (_Instance != value)
Destroy(value);
}
}
private static ScrollDetails _Instance;
public WorldCursor cursor;
public GameObject parameterDisplayPrefab;
public static Scroll ActiveScroll { get; private set; }
public GameObject mmtAnswerPopUp;
private PopupBehavior Popup;
public static List<RenderedScrollFact> ParameterDisplays { get; private set; }
private static List<ScrollAssignment> LatestBackwartsCompletions;
private static List<Fact> LatestRenderedHints;
public string currentMmtAnswer;
public bool DynamicScrollDescriptionsActive = true;
public bool AutomaticHintGenerationActive = true;
private bool SendingViewDone = true;
private bool DynamicScrollInQue = false;
private bool MagicInQue = false;
private readonly IReadOnlyList<string> NoDynamicScroll = new List<string>()
{
// Insert ScrollURIS that are poorly optimized
};
void Awake()
{
Instance = this;
if (cursor == null)
cursor = FindObjectOfType<WorldCursor>();
Popup = mmtAnswerPopUp.GetComponent<PopupBehavior>();
Popup.gameObject.SetActive(true); // force Awake
}
private void OnEnable()
{
ScrollFactHintEvent.AddListener(animateHint);
NewAssignmentEvent.AddListener(NewAssignmentTrigger);
}
private void OnDisable()
{
ScrollFactHintEvent.RemoveListener(animateHint);