mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Vessel Position
This commit is contained in:
parent
3c17bfe8fe
commit
77e7ebb20c
20
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
20
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
@ -63,6 +63,26 @@ namespace NewHorizons.External.Configs
|
||||
/// </summary>
|
||||
public NomaiCoordinates coords;
|
||||
|
||||
/// <summary>
|
||||
/// The position in the solar system the vessel will warp to.
|
||||
/// </summary>
|
||||
public MVector3 vesselPosition;
|
||||
|
||||
/// <summary>
|
||||
/// Euler angles by which the vessel will be oriented.
|
||||
/// </summary>
|
||||
public MVector3 vesselRotation;
|
||||
|
||||
/// <summary>
|
||||
/// The relative position to the vessel that you will be teleported to when you exit the vessel through the black hole.
|
||||
/// </summary>
|
||||
public MVector3 warpExitPosition;
|
||||
|
||||
/// <summary>
|
||||
/// Euler angles by which the warp exit will be oriented.
|
||||
/// </summary>
|
||||
public MVector3 warpExitRotation;
|
||||
|
||||
public class NomaiCoordinates
|
||||
{
|
||||
public int[] x;
|
||||
|
||||
@ -359,15 +359,24 @@ namespace NewHorizons
|
||||
|
||||
private EyeSpawnPoint CreateVessel()
|
||||
{
|
||||
var system = SystemDict[_currentStarSystem];
|
||||
Logger.Log("Checking for Vessel Prefab");
|
||||
if (VesselPrefab == null) return null;
|
||||
Logger.Log("Creating Vessel");
|
||||
var vesselObject = GameObject.Instantiate(VesselPrefab);
|
||||
vesselObject.name = VesselPrefab.name;
|
||||
vesselObject.transform.parent = null;
|
||||
if (system.Config.vesselPosition != null)
|
||||
vesselObject.transform.position += system.Config.vesselPosition;
|
||||
if (system.Config.vesselRotation != null)
|
||||
vesselObject.transform.eulerAngles = system.Config.vesselRotation;
|
||||
vesselObject.SetActive(true);
|
||||
VesselWarpController vesselWarpController = vesselObject.GetComponentInChildren<VesselWarpController>(true);
|
||||
vesselWarpController._targetWarpPlatform.OnReceiveWarpedBody += (OWRigidbody warpedBody, NomaiWarpPlatform startPlatform, NomaiWarpPlatform targetPlatform) => OnReceiveWarpedBody(vesselObject, warpedBody, startPlatform, targetPlatform);
|
||||
if (system.Config.warpExitPosition != null)
|
||||
vesselWarpController._targetWarpPlatform.transform.localPosition = system.Config.warpExitPosition;
|
||||
if (system.Config.warpExitRotation != null)
|
||||
vesselObject.transform.localEulerAngles = system.Config.warpExitRotation;
|
||||
MapMarker mapMarker = vesselObject.AddComponent<MapMarker>();
|
||||
mapMarker._labelID = (UITextType)TranslationHandler.AddUI("Vessel");
|
||||
mapMarker._markerType = MapMarker.MarkerType.Planet;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user