Skip to content
Snippets Groups Projects
Select Git revision
  • 87ca31b019b71f816d3fee3f928f926d74765391
  • master default
  • JS-based-scroll-rendering
  • Paul_Marius_Level
  • Paul_Marius_2
  • Paul_Marius
  • Andi_Mark
  • be-UnityWebView
  • gitignoreFrameitServer
  • ZimmerBSc
  • Bugfix_StageLoading
  • stages
  • MAZIFAU_Experimental
  • tsc/coneworld
  • tsc/fact-interaction
  • marcel
  • MaZiFAU_TopSort
  • mergeHelper
  • zwischenSpeichern
  • tempAndrToMaster
  • SebBranch
  • 3.0
  • v2.1
  • v2.0
  • v1.0
25 results

ScrollDetails.cs

Blame
  • 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);