mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-03 17:38:30 +00:00
40 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|