Turn on remnant after supernova

This commit is contained in:
Noah Pilarski 2022-08-18 08:59:54 -04:00
parent 0d60e5ee8b
commit 135794fa29
2 changed files with 4 additions and 14 deletions

View File

@ -257,25 +257,13 @@ namespace NewHorizons.Components.SizeControllers
private void DisableStar(bool start = false)
{
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
base.gameObject.SetActive(false);
if (_stellarRemnantController != null) _stellarRemnantController.gameObject.SetActive(true);
if (start && _planetDestructionVolume != null)
{
foreach (var collider in Physics.OverlapSphere(_planetDestructionVolume.transform.position, _planetDestructionVolume.GetComponent<SphereCollider>().radius * supernovaSize * 0.9f))

View File

@ -215,6 +215,8 @@ namespace NewHorizons.Handlers
stellarRemnantController.SetStarEvolutionController(starEvolutionController);
starEvolutionController.SetStellarRemnantController(stellarRemnantController);
sector.gameObject.SetActive(false);
SharedGenerateBody(body, existingPlanet, sector, rb);
}
catch (Exception ex)