mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-27 03:35:20 +00:00
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
|
using Epic.OnlineServices;
|
|||
|
using QSB.Utility;
|
|||
|
using QSB.WorldSync;
|
|||
|
using System;
|
|||
|
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;
|
|||
|
}
|
|||
|
|
|||
|
DebugLog.DebugWrite($"Create character dialogue tree!");
|
|||
|
|
|||
|
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);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|