mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Fix ramp being null for some reason
This commit is contained in:
parent
ad63eacbd8
commit
44141ad5c4
@ -1,10 +1,10 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using NewHorizons.External.Modules.Props;
|
||||
using NewHorizons.Utility;
|
||||
using NewHorizons.Utility.Files;
|
||||
using OWML.Common;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static class FogBuilder
|
||||
@ -26,7 +26,9 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
|
||||
internal static void InitPrefabs()
|
||||
{
|
||||
if (_ramp == null) _ramp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/FogColorRamp.png");
|
||||
// Checking null here it was getting destroyed and wouldnt reload and never worked outside of the first loop
|
||||
// GetTexture caches itself anyway so it doesn't matter that this gets called multiple times
|
||||
_ramp = ImageUtilities.GetTexture(Main.Instance, "Assets/textures/FogColorRamp.png");
|
||||
|
||||
if (_isInit) return;
|
||||
|
||||
@ -73,6 +75,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
atmo.fogRampPath != null ? ImageUtilities.GetTexture(mod, atmo.fogRampPath) :
|
||||
atmo.fogTint != null ? ImageUtilities.TintImage(_ramp, atmo.fogTint.ToColor()) :
|
||||
_ramp;
|
||||
|
||||
PFC.fogColorRampTexture = colorRampTexture;
|
||||
PFC.fogColorRampIntensity = 1f;
|
||||
if (atmo.fogTint != null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user