mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Turn off reference frame and map marker for dead stars
This commit is contained in:
parent
a5b14591f3
commit
cbc8275587
@ -137,6 +137,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
if (starModule.curve != null) controller.SetScaleCurve(starModule.curve);
|
if (starModule.curve != null) controller.SetScaleCurve(starModule.curve);
|
||||||
controller.size = starModule.size;
|
controller.size = starModule.size;
|
||||||
controller.atmosphere = sunAtmosphere;
|
controller.atmosphere = sunAtmosphere;
|
||||||
|
controller.controller = starController;
|
||||||
controller.supernova = supernova;
|
controller.supernova = supernova;
|
||||||
controller.StartColour = starModule.tint;
|
controller.StartColour = starModule.tint;
|
||||||
controller.EndColour = starModule.endTint;
|
controller.EndColour = starModule.endTint;
|
||||||
|
|||||||
@ -14,6 +14,7 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
public class StarEvolutionController : SizeController
|
public class StarEvolutionController : SizeController
|
||||||
{
|
{
|
||||||
public GameObject atmosphere;
|
public GameObject atmosphere;
|
||||||
|
public StarController controller;
|
||||||
public SupernovaEffectController supernova;
|
public SupernovaEffectController supernova;
|
||||||
public bool WillExplode { get; set; }
|
public bool WillExplode { get; set; }
|
||||||
public MColor StartColour { get; set; }
|
public MColor StartColour { get; set; }
|
||||||
@ -29,6 +30,8 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
private HeatHazardVolume _heatVolume;
|
private HeatHazardVolume _heatVolume;
|
||||||
private DestructionVolume _destructionVolume;
|
private DestructionVolume _destructionVolume;
|
||||||
private SolarFlareEmitter _flareEmitter;
|
private SolarFlareEmitter _flareEmitter;
|
||||||
|
private MapMarker _mapMarker;
|
||||||
|
private OWRigidbody _rigidbody;
|
||||||
|
|
||||||
private bool _isCollapsing;
|
private bool _isCollapsing;
|
||||||
private float _collapseStartSize;
|
private float _collapseStartSize;
|
||||||
@ -64,6 +67,9 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
|
_rigidbody = this.GetAttachedOWRigidbody();
|
||||||
|
if (_rigidbody != null) _mapMarker = _rigidbody.GetComponent<MapMarker>();
|
||||||
|
|
||||||
var sun = GameObject.FindObjectOfType<SunController>();
|
var sun = GameObject.FindObjectOfType<SunController>();
|
||||||
_collapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial);
|
_collapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial);
|
||||||
_collapseEndSurfaceMaterial = new Material(sun._collapseEndSurfaceMaterial);
|
_collapseEndSurfaceMaterial = new Material(sun._collapseEndSurfaceMaterial);
|
||||||
@ -207,6 +213,22 @@ namespace NewHorizons.Components.SizeControllers
|
|||||||
|
|
||||||
if (Time.time > _supernovaStartTime + 45f)
|
if (Time.time > _supernovaStartTime + 45f)
|
||||||
{
|
{
|
||||||
|
if (_rigidbody != null)
|
||||||
|
{
|
||||||
|
ReferenceFrameTracker referenceFrameTracker = Locator.GetPlayerBody().GetComponent<ReferenceFrameTracker>();
|
||||||
|
if (referenceFrameTracker.GetReferenceFrame() != null && referenceFrameTracker.GetReferenceFrame().GetOWRigidBody() == _rigidbody) referenceFrameTracker.UntargetReferenceFrame();
|
||||||
|
_rigidbody._isTargetable = false;
|
||||||
|
if (_rigidbody._attachedRFVolume != null)
|
||||||
|
{
|
||||||
|
_rigidbody._attachedRFVolume._minColliderRadius = 0;
|
||||||
|
_rigidbody._attachedRFVolume._maxColliderRadius = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_mapMarker != null) _mapMarker.DisableMarker();
|
||||||
|
|
||||||
|
if (controller != null) StarLightController.RemoveStar(controller);
|
||||||
|
|
||||||
// Just turn off the star entirely
|
// Just turn off the star entirely
|
||||||
base.gameObject.SetActive(false);
|
base.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user