Don't register proxy stars

This commit is contained in:
Noah Pilarski 2022-08-18 22:20:36 -04:00
parent f993a0870c
commit f3a1e38f40
2 changed files with 4 additions and 1 deletions

View File

@ -210,6 +210,7 @@ namespace NewHorizons.Builder.Body
starGO.SetActive(false); starGO.SetActive(false);
var controller = starGO.AddComponent<StarEvolutionController>(); var controller = starGO.AddComponent<StarEvolutionController>();
controller._isProxy = true;
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.supernovaSize = starModule.supernovaSize; controller.supernovaSize = starModule.supernovaSize;

View File

@ -14,6 +14,8 @@ namespace NewHorizons.Components.SizeControllers
{ {
public class StarEvolutionController : SizeController public class StarEvolutionController : SizeController
{ {
public bool _isProxy;
public GameObject atmosphere; public GameObject atmosphere;
public StarController controller; public StarController controller;
public SupernovaEffectController supernova; public SupernovaEffectController supernova;
@ -159,7 +161,7 @@ namespace NewHorizons.Components.SizeControllers
_flareEmitter = GetComponentInChildren<SolarFlareEmitter>(); _flareEmitter = GetComponentInChildren<SolarFlareEmitter>();
_surfaceMaterial = supernova._surface._materials[0]; _surfaceMaterial = supernova._surface._materials[0];
SupernovaEffectHandler.RegisterStar(this); if (!_isProxy) SupernovaEffectHandler.RegisterStar(this);
var secondsElapsed = TimeLoop.GetSecondsElapsed(); var secondsElapsed = TimeLoop.GetSecondsElapsed();
var lifespanInSeconds = lifespan * 60; var lifespanInSeconds = lifespan * 60;