mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
29 lines
814 B
C#
29 lines
814 B
C#
using NewHorizons.Handlers;
|
|
using UnityEngine;
|
|
|
|
namespace NewHorizons.Components.Volumes
|
|
{
|
|
internal class WarpVolume : BaseVolume
|
|
{
|
|
public string TargetSolarSystem;
|
|
public string TargetSpawnID;
|
|
|
|
public override void OnTriggerVolumeEntry(GameObject hitObj)
|
|
{
|
|
if (hitObj.CompareTag("PlayerDetector"))
|
|
{
|
|
if (Main.Instance.CurrentStarSystem != TargetSolarSystem) // Otherwise it really breaks idk why
|
|
{
|
|
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
|
PlayerSpawnHandler.TargetSpawnID = TargetSpawnID;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnTriggerVolumeExit(GameObject hitObj)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|