Add submerge controller to dark matter

This commit is contained in:
Nick 2023-01-21 23:52:51 -05:00
parent 086ca65f9d
commit d7c3e06e3a
2 changed files with 17 additions and 1 deletions

View File

@ -39,7 +39,7 @@ namespace NewHorizons.Builder.Body
if (_oceanAmbientLight == null) _oceanAmbientLight = SearchUtilities.Find("Ocean_GD").GetComponent<OceanLODController>()._ambientLight.gameObject.InstantiateInactive().Rename("OceanAmbientLight").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) public static RadialFluidVolume Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module)
{ {
InitPrefabs(); InitPrefabs();
@ -148,6 +148,8 @@ namespace NewHorizons.Builder.Body
waterGO.transform.position = planetGO.transform.position; waterGO.transform.position = planetGO.transform.position;
waterGO.SetActive(true); waterGO.SetActive(true);
return fluidVolume;
} }
} }
} }

View File

@ -62,6 +62,20 @@ namespace NewHorizons.Builder.Volumes
var visorFrostEffectVolume = go.AddComponent<VisorFrostEffectVolume>(); var visorFrostEffectVolume = go.AddComponent<VisorFrostEffectVolume>();
visorFrostEffectVolume._frostRate = 0.5f; visorFrostEffectVolume._frostRate = 0.5f;
visorFrostEffectVolume._maxFrost = 0.91f; visorFrostEffectVolume._maxFrost = 0.91f;
var water = planetGO.GetComponentInChildren<RadialFluidVolume>();
if (water != null)
{
var submerge = go.AddComponent<DarkMatterSubmergeController>();
submerge._activeWhenSubmerged = false;
submerge._effectVolumes = new EffectVolume[] { visorFrostEffectVolume };
// THERE ARE NO RENDERERS??? RUH ROH!!!
var detector = go.AddComponent<ConstantFluidDetector>();
detector.AddVolume(water);
submerge._fluidDetector = detector;
}
} }
else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.ELECTRICITY) else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.ELECTRICITY)
{ {