mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
added effect ruleset to any sector containing a bramble node to support the screen fog effect
This commit is contained in:
parent
65e50398f7
commit
11ddbe24ff
@ -214,6 +214,27 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
sector.RegisterFogLight(fogLight);
|
sector.RegisterFogLight(fogLight);
|
||||||
|
|
||||||
|
// set up screen fog effect
|
||||||
|
// (in the base game, any sector that contains a bramble node needs an EffectRuleset with type FogWarp)
|
||||||
|
// (this isn't jank I swear, this is how it's supposed to work)
|
||||||
|
var sectorHasFogEffectRuleset = sector
|
||||||
|
.GetComponents<EffectRuleset>()
|
||||||
|
.Where(effectRuleset => effectRuleset._type == EffectRuleset.BubbleType.FogWarp)
|
||||||
|
.Count() > 0;
|
||||||
|
if (!sectorHasFogEffectRuleset)
|
||||||
|
{
|
||||||
|
var fogEffectRuleset = sector.gameObject.AddComponent<EffectRuleset>();
|
||||||
|
fogEffectRuleset._attachedBody = sector.GetAttachedOWRigidbody();
|
||||||
|
fogEffectRuleset._triggerVolume = sector.GetTriggerVolume();
|
||||||
|
fogEffectRuleset._type = EffectRuleset.BubbleType.FogWarp;
|
||||||
|
fogEffectRuleset._underwaterDistortScale = 0.001f;
|
||||||
|
fogEffectRuleset._underwaterMaxDistort = 0.1f;
|
||||||
|
fogEffectRuleset._underwaterMinDistort = 0.005f;
|
||||||
|
fogEffectRuleset._material = GameObject.Find("DB_PioneerDimension_Body/Sector_PioneerDimension").GetComponent<EffectRuleset>()._material;
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: replace InnerFogWarpVolume with NHInnerFogWarpVolume, which overrides GetFogDensity to account for scale
|
||||||
|
|
||||||
// Set the scale
|
// Set the scale
|
||||||
brambleNode.transform.localScale = Vector3.one * config.scale;
|
brambleNode.transform.localScale = Vector3.one * config.scale;
|
||||||
innerFogWarpVolume._warpRadius *= config.scale;
|
innerFogWarpVolume._warpRadius *= config.scale;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user