mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 12:05:23 +01:00
25 lines
934 B
C#
25 lines
934 B
C#
using NewHorizons.External.Modules;
|
|
using UnityEngine;
|
|
namespace NewHorizons.Builder.Atmosphere
|
|
{
|
|
public static class SunOverrideBuilder
|
|
{
|
|
public static void Make(GameObject planetGO, Sector sector, AtmosphereModule atmo, float surfaceSize)
|
|
{
|
|
GameObject overrideGO = new GameObject("SunOverride");
|
|
overrideGO.SetActive(false);
|
|
overrideGO.transform.parent = sector?.transform ?? planetGO.transform;
|
|
|
|
GiantsDeepSunOverrideVolume GDSOV = overrideGO.AddComponent<GiantsDeepSunOverrideVolume>();
|
|
GDSOV._sector = sector;
|
|
GDSOV._cloudsOuterRadius = atmo.size;
|
|
GDSOV._cloudsInnerRadius = atmo.size * 0.9f;
|
|
GDSOV._waterOuterRadius = surfaceSize;
|
|
GDSOV._waterInnerRadius = 0f;
|
|
|
|
overrideGO.transform.position = planetGO.transform.position;
|
|
overrideGO.SetActive(true);
|
|
}
|
|
}
|
|
}
|