quantum-space-buddies/QSB/EyeOfTheUniverse/GalaxyMap/GalaxyMapManager.cs
Mister_Nebula ae219fef01 cleanup
2021-12-23 19:00:26 +00:00

40 lines
1.1 KiB
C#

using QSB.WorldSync;
using System.Linq;
using UnityEngine;
namespace QSB.EyeOfTheUniverse.GalaxyMap
{
internal class GalaxyMapManager : MonoBehaviour
{
public static GalaxyMapManager Instance { get; private set; }
public QSBCharacterDialogueTree Tree { get; private set; }
private void Awake()
{
Instance = this;
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
}
private void OnSceneLoaded(OWScene oldScene, OWScene newScene, bool inUniverse)
{
if (newScene != OWScene.EyeOfTheUniverse)
{
return;
}
var mapController = QSBWorldSync.GetUnityObjects<GalaxyMapController>().First();
var map = mapController._interactVolume.gameObject;
map.SetActive(false);
Tree = map.AddComponent<QSBCharacterDialogueTree>();
Tree._xmlCharacterDialogueAsset = QSBCore.TextAssetsBundle.LoadAsset<TextAsset>("Assets/TextAssets/GalaxyMap.txt");
Tree._attentionPoint = map.transform;
Tree._attentionPointOffset = new Vector3(0, 1, 0);
Tree._turnOffFlashlight = true;
Tree._turnOnFlashlight = true;
map.SetActive(true);
}
}
}