mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Put cloakfieldcontroller
This commit is contained in:
parent
c5e2cc23a5
commit
675f033a11
31
NewHorizons/Builder/Body/CloakBuilder.cs
Normal file
31
NewHorizons/Builder/Body/CloakBuilder.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using NewHorizons.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Body
|
||||
{
|
||||
static class CloakBuilder
|
||||
{
|
||||
public static void Make(GameObject body, OWRigidbody rigidbody, float radius)
|
||||
{
|
||||
var cloak = SearchUtilities.Find("RingWorld_Body/CloakingField_IP");
|
||||
|
||||
var newCloak = GameObject.Instantiate(cloak, body.transform);
|
||||
newCloak.transform.localPosition = Vector3.zero;
|
||||
|
||||
// Get all the mesh renders
|
||||
var renderers = new List<Renderer>();
|
||||
|
||||
foreach(var renderer in body.GetComponentsInChildren<Renderer>())
|
||||
{
|
||||
renderers.SafeAdd(renderer);
|
||||
renderer.enabled = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
1
NewHorizons/External/BaseModule.cs
vendored
1
NewHorizons/External/BaseModule.cs
vendored
@ -21,6 +21,7 @@ namespace NewHorizons.External
|
||||
public bool HasReferenceFrame { get; set; } = true;
|
||||
public bool CenterOfSolarSystem { get; set; } = false;
|
||||
public bool IsSatellite { get; set; }
|
||||
public float CloakRadius { get; set; } = 0f;
|
||||
|
||||
// Old, see SingularityModule instead
|
||||
public float BlackHoleSize { get; set; }
|
||||
|
||||
@ -351,6 +351,10 @@ namespace NewHorizons.Handlers
|
||||
if (body.Config.Funnel != null)
|
||||
FunnelBuilder.Make(go, go.GetComponentInChildren<ConstantForceDetector>(), rb, body.Config.Funnel);
|
||||
|
||||
// Has to go last probably
|
||||
if (body.Config.Base.CloakRadius != 0f)
|
||||
CloakBuilder.Make(go, rb, body.Config.Base.CloakRadius);
|
||||
|
||||
return go;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user