mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Renamed it and fixed it for the sun
This commit is contained in:
parent
5a5ea46b05
commit
b1eac0748e
@ -303,7 +303,7 @@ namespace NewHorizons.Components.SizeControllers
|
||||
private void DisableStar(bool start = false)
|
||||
{
|
||||
if (controller != null) SunLightEffectsController.RemoveStar(controller);
|
||||
if (!isProxy) SunLightEffectsController.RemoveStarLight(gameObject.FindChild("SunLight").GetAddComponent<Light>());
|
||||
if (!isProxy) SunLightEffectsController.RemoveStarLight(gameObject.FindChild("SunLight").GetComponent<Light>());
|
||||
|
||||
if (_stellarRemnant != null)
|
||||
{
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using NewHorizons.Builder.Atmosphere;
|
||||
using NewHorizons.Utility;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Logger = NewHorizons.Utility.Logger;
|
||||
@ -31,6 +32,13 @@ namespace NewHorizons.Components.Stars
|
||||
_sunLightParamUpdater._sunLightController = _sunLightController;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
// Using GameObject.Find here so that if its null we just dont find it
|
||||
var sunlight = GameObject.Find("Sun_Body/Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>();
|
||||
if (sunlight != null) AddStarLight(sunlight);
|
||||
}
|
||||
|
||||
public static void AddStar(StarController star)
|
||||
{
|
||||
if (star == null) return;
|
||||
@ -58,16 +66,18 @@ namespace NewHorizons.Components.Stars
|
||||
|
||||
public static void AddStarLight(Light light)
|
||||
{
|
||||
if (light == null) return;
|
||||
|
||||
Instance._lights.Add(light);
|
||||
if (light != null)
|
||||
{
|
||||
Instance._lights.SafeAdd(light);
|
||||
}
|
||||
}
|
||||
|
||||
public static void RemoveStarLight(Light light)
|
||||
{
|
||||
if (light == null) return;
|
||||
|
||||
if (Instance._lights.Contains(light)) Instance._lights.Remove(light);
|
||||
if (light != null && Instance._lights.Contains(light))
|
||||
{
|
||||
Instance._lights.Remove(light);
|
||||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
@ -118,7 +118,7 @@ namespace NewHorizons.Handlers
|
||||
case AstroObject.Name.Sun:
|
||||
var starController = ao.gameObject.GetComponent<StarController>();
|
||||
SunLightEffectsController.RemoveStar(starController);
|
||||
SunLightEffectsController.RemoveStarLight(ao.gameObject.FindChild("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
|
||||
SunLightEffectsController.RemoveStarLight(ao.transform.Find("Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
|
||||
GameObject.Destroy(starController);
|
||||
|
||||
var audio = ao.GetComponentInChildren<SunSurfaceAudioController>();
|
||||
|
||||
@ -354,6 +354,7 @@ namespace NewHorizons
|
||||
|
||||
var map = GameObject.FindObjectOfType<MapController>();
|
||||
if (map != null) map._maxPanDistance = FurthestOrbit * 1.5f;
|
||||
|
||||
// Fix the map satellite
|
||||
SearchUtilities.Find("HearthianMapSatellite_Body", false).AddComponent<MapSatelliteOrbitFix>();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user