mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Renamed to new horizons, updated to current versions of OWML and Outer Wilds, added BlackHoleBuilder, LavaBuilder, RingBuilder. Added support to modify existing planets with configs.
27 lines
911 B
C#
27 lines
911 B
C#
using OWML.Utils;
|
|
using UnityEngine;
|
|
using Logger = NewHorizons.Utility.Logger;
|
|
|
|
namespace NewHorizons.General
|
|
{
|
|
static class DetectorBuilder
|
|
{
|
|
public static void Make(GameObject body, AstroObject primaryBody)
|
|
{
|
|
GameObject detectorGO = new GameObject("FieldDetector");
|
|
detectorGO.SetActive(false);
|
|
detectorGO.transform.parent = body.transform;
|
|
detectorGO.layer = 20;
|
|
|
|
ConstantForceDetector CFD = detectorGO.AddComponent<ConstantForceDetector>();
|
|
ForceVolume[] temp = new ForceVolume[1];
|
|
temp[0] = primaryBody.GetAttachedOWRigidbody().GetAttachedGravityVolume();
|
|
CFD.SetValue("_detectableFields", temp);
|
|
CFD.SetValue("_inheritElement0", true);
|
|
|
|
detectorGO.SetActive(true);
|
|
Logger.Log("Finished building detector", Logger.LogType.Log);
|
|
}
|
|
}
|
|
}
|