mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
added staticPosition to Orbit config
This commit is contained in:
parent
9a3d01bc10
commit
4b25a11fde
@ -25,9 +25,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
//-11096.95 -22786.44 4657.534
|
//-11096.95 -22786.44 4657.534
|
||||||
//-8716.807 -22786.44 4496.394
|
//-8716.807 -22786.44 4496.394
|
||||||
|
|
||||||
private static int DIMENSION_COUNTER = 0;
|
|
||||||
|
|
||||||
|
|
||||||
// keys are all node names that have been referenced as an exit by at least one dimension but do not (yet) exist
|
// keys are all node names that have been referenced as an exit by at least one dimension but do not (yet) exist
|
||||||
// values are all dimensions' warp controllers that link to a given dimension
|
// values are all dimensions' warp controllers that link to a given dimension
|
||||||
// unpairedNodes[name of node that doesn't exist yet] => List{warp controller for dimension that exits to that node, ...}
|
// unpairedNodes[name of node that doesn't exist yet] => List{warp controller for dimension that exits to that node, ...}
|
||||||
@ -49,8 +47,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
dimension.name = name.Replace(" ", "").Replace("'", "") + "_Body";
|
dimension.name = name.Replace(" ", "").Replace("'", "") + "_Body";
|
||||||
|
|
||||||
// set position
|
// set position
|
||||||
ao.transform.position = new Vector3(6904.48f, 17048.44f, 5574.479f) + new Vector3(0, 3000, 0)*DIMENSION_COUNTER;
|
ao.transform.position = body.Config.Orbit.staticPosition;
|
||||||
DIMENSION_COUNTER++;
|
|
||||||
|
|
||||||
// fix children's names and remove base game props (mostly just bramble nodes that are children to Interactibles) and set up the OuterWarp child
|
// fix children's names and remove base game props (mostly just bramble nodes that are children to Interactibles) and set up the OuterWarp child
|
||||||
var dimensionSector = SearchUtilities.FindChild(dimension, "Sector_HubDimension");
|
var dimensionSector = SearchUtilities.FindChild(dimension, "Sector_HubDimension");
|
||||||
|
|||||||
9
NewHorizons/External/Modules/OrbitModule.cs
vendored
9
NewHorizons/External/Modules/OrbitModule.cs
vendored
@ -1,4 +1,4 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using NewHorizons.Components.Orbital;
|
using NewHorizons.Components.Orbital;
|
||||||
using NewHorizons.Utility;
|
using NewHorizons.Utility;
|
||||||
@ -8,7 +8,12 @@ namespace NewHorizons.External.Modules
|
|||||||
{
|
{
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
public class OrbitModule : IOrbitalParameters
|
public class OrbitModule : IOrbitalParameters
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Specify this if you want the body to remain stationary at a given location (ie not orbit its parent). Required for Bramble dimensions
|
||||||
|
/// </summary>
|
||||||
|
public MVector3 staticPosition;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of the body this one will orbit around
|
/// The name of the body this one will orbit around
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -268,6 +268,12 @@ namespace NewHorizons.Handlers
|
|||||||
{
|
{
|
||||||
if (body.Config?.Bramble?.dimension != null)
|
if (body.Config?.Bramble?.dimension != null)
|
||||||
{
|
{
|
||||||
|
if (body.Config?.Orbit?.staticPosition == null)
|
||||||
|
{
|
||||||
|
Logger.LogError($"Unable to build bramble dimension {body.Config?.name} because it does not have Orbit.staticPosition defined.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return GenerateBrambleDimensionBody(body);
|
return GenerateBrambleDimensionBody(body);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -378,6 +384,10 @@ namespace NewHorizons.Handlers
|
|||||||
if (!body.Config.Orbit.isStatic)
|
if (!body.Config.Orbit.isStatic)
|
||||||
{
|
{
|
||||||
DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config);
|
DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config);
|
||||||
|
}
|
||||||
|
else if (body.Config.Orbit.staticPosition != null)
|
||||||
|
{
|
||||||
|
ao.transform.position = body.Config.Orbit.staticPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ao.GetAstroObjectName() == AstroObject.Name.CustomString)
|
if (ao.GetAstroObjectName() == AstroObject.Name.CustomString)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user