mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Me when
This commit is contained in:
parent
1182865753
commit
b8c28e3734
@ -12,6 +12,7 @@ namespace NewHorizons.Builder.Body
|
||||
private static MeshGroup _oceanMeshGroup;
|
||||
private static Material[] _oceanLowAltitudeMaterials;
|
||||
private static GameObject _oceanFog;
|
||||
private static GameObject _oceanAmbientLight;
|
||||
|
||||
internal static void InitPrefabs()
|
||||
{
|
||||
@ -30,6 +31,7 @@ namespace NewHorizons.Builder.Body
|
||||
}
|
||||
if (_oceanLowAltitudeMaterials == null) _oceanLowAltitudeMaterials = SearchUtilities.Find("Ocean_GD").GetComponent<TessellatedSphereLOD>()._lowAltitudeMaterials.MakePrefabMaterials();
|
||||
if (_oceanFog == null) _oceanFog = SearchUtilities.Find("GiantsDeep_Body/Sector_GD/Sector_GDInterior/Effects_GDInterior/OceanFog").InstantiateInactive().Rename("Prefab_GD_OceanFog").DontDestroyOnLoad();
|
||||
if (_oceanAmbientLight == null) _oceanAmbientLight = SearchUtilities.Find("Ocean_GD").GetComponent<OceanLODController>()._ambientLight.gameObject.InstantiateInactive().Rename("OceanAmbientLight").DontDestroyOnLoad();
|
||||
}
|
||||
|
||||
public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module)
|
||||
@ -74,7 +76,7 @@ namespace NewHorizons.Builder.Body
|
||||
|
||||
var OLC = waterGO.AddComponent<OceanLODController>();
|
||||
OLC._sector = sector;
|
||||
OLC._ambientLight = null; // this needs to be set or else is black
|
||||
OLC._ambientLight = _oceanAmbientLight.GetComponent<Light>(); // this needs to be set or else is black
|
||||
|
||||
// trigger sector enter
|
||||
Delay.FireOnNextUpdate(() =>
|
||||
|
||||
@ -447,10 +447,24 @@ namespace NewHorizons
|
||||
|
||||
var distantSun = eyeSector.gameObject.FindChild("DistantSun/Directional light");
|
||||
var starController = distantSun.AddComponent<StarController>();
|
||||
starController.Light = distantSun.GetComponent<Light>();
|
||||
var sunLight = distantSun.GetComponent<Light>();
|
||||
starController.Light = sunLight;
|
||||
var ambientLightFake = new GameObject("AmbientLightFake", typeof(Light));
|
||||
ambientLightFake.transform.SetParent(distantSun.transform, false);
|
||||
ambientLightFake.SetActive(false);
|
||||
var ambientLight = ambientLightFake.GetComponent<Light>();
|
||||
ambientLight.intensity = 0;
|
||||
ambientLight.range = 0;
|
||||
ambientLight.enabled = false;
|
||||
starController.AmbientLight = ambientLight;
|
||||
starController.Intensity = 0.2f;
|
||||
starController.SunColor = new Color(0.3569f, 0.7843f, 1, 1);
|
||||
distantSun.AddComponent<StarLightController>().Awake();
|
||||
var sunLightController = distantSun.AddComponent<SunLightController>();
|
||||
sunLightController._sunLight = sunLight;
|
||||
sunLightController._ambientLight = ambientLight;
|
||||
sunLightController.Initialize();
|
||||
var starLightController = distantSun.AddComponent<StarLightController>();
|
||||
starLightController.Awake();
|
||||
StarLightController.AddStar(starController);
|
||||
|
||||
if (IsWarpingFromShip && _ship != null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user