mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add a prefab for ambient light too
This commit is contained in:
parent
39dba583b0
commit
fb12317c9c
@ -4,12 +4,18 @@ namespace NewHorizons.Builder.General
|
||||
{
|
||||
public static class AmbientLightBuilder
|
||||
{
|
||||
private static GameObject _ambientLightPrefab;
|
||||
|
||||
internal static void InitPrefab()
|
||||
{
|
||||
if (_ambientLightPrefab == null) _ambientLightPrefab = SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM").InstantiateInactive().Rename("Prefab_QM_AmbientLight").DontDestroyOnLoad();
|
||||
}
|
||||
|
||||
public static Light Make(GameObject planetGO, Sector sector, float scale, float intensity)
|
||||
{
|
||||
var ambientLight = Main.Instance.CurrentStarSystem == "EyeOfTheUniverse" ? SearchUtilities.Find("EyeOfTheUniverse_Body/Sector_EyeOfTheUniverse/SixthPlanet_Root/QuantumMoonProxy_Pivot/QuantumMoonProxy_Root/MoonState_Root/AmbientLight_QM") : SearchUtilities.Find("QuantumMoon_Body/AmbientLight_QM");
|
||||
if (ambientLight == null) return null;
|
||||
InitPrefab();
|
||||
|
||||
GameObject lightGO = GameObject.Instantiate(ambientLight, sector?.transform ?? planetGO.transform);
|
||||
GameObject lightGO = GameObject.Instantiate(_ambientLightPrefab, sector?.transform ?? planetGO.transform);
|
||||
lightGO.transform.position = planetGO.transform.position;
|
||||
lightGO.name = "AmbientLight";
|
||||
|
||||
|
||||
@ -268,6 +268,7 @@ namespace NewHorizons
|
||||
{
|
||||
try
|
||||
{
|
||||
AmbientLightBuilder.InitPrefab();
|
||||
AtmosphereBuilder.InitPrefabs();
|
||||
BrambleDimensionBuilder.InitPrefabs();
|
||||
BrambleNodeBuilder.InitPrefabs();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user