Don't error at eye of universe

This commit is contained in:
Noah Pilarski 2022-08-27 00:05:08 -04:00
parent f2dd6b04d2
commit c958ec6f44

View File

@ -98,6 +98,8 @@ namespace NewHorizons.Components.SizeControllers
{ {
var sun = GameObject.FindObjectOfType<SunController>(); var sun = GameObject.FindObjectOfType<SunController>();
if (sun == null) return;
// Need to grab all this early bc the star might only Start after the solar system was made (remnants) // Need to grab all this early bc the star might only Start after the solar system was made (remnants)
_defaultCollapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial); _defaultCollapseStartSurfaceMaterial = new Material(sun._collapseStartSurfaceMaterial);
_defaultCollapseEndSurfaceMaterial = new Material(sun._collapseEndSurfaceMaterial); _defaultCollapseEndSurfaceMaterial = new Material(sun._collapseEndSurfaceMaterial);