40 lines
1.1 KiB
C#
Raw Normal View History

2022-02-01 08:58:52 +00:00
using QSB.Utility;
using QSB.WorldSync;
2021-12-23 11:37:37 +00:00
using System.Linq;
using UnityEngine;
namespace QSB.EyeOfTheUniverse.GalaxyMap
2021-12-23 11:37:37 +00:00
{
internal class GalaxyMapManager : MonoBehaviour, IAddComponentOnStart
{
public static GalaxyMapManager Instance { get; private set; }
2021-12-23 11:37:37 +00:00
public QSBCharacterDialogueTree Tree { get; private set; }
private void Awake()
2021-12-23 11:37:37 +00:00
{
Instance = this;
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
}
2021-12-23 11:37:37 +00:00
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;
2021-12-23 11:37:37 +00:00
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);
}
2021-12-23 11:37:37 +00:00
}
}