mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Made a method for adding to _generatedTextures list
This commit is contained in:
parent
7eb611f947
commit
809b510508
@ -51,7 +51,7 @@ namespace NewHorizons.Builder.General
|
|||||||
cubemap.SetPixels(newColors, cubemapFace);
|
cubemap.SetPixels(newColors, cubemapFace);
|
||||||
}
|
}
|
||||||
cubemap.Apply();
|
cubemap.Apply();
|
||||||
ImageUtilities._generatedTextures.Add(cubemap);
|
ImageUtilities.TrackGeneratedTexture(cubemap);
|
||||||
|
|
||||||
light.cookie = cubemap;
|
light.cookie = cubemap;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,14 +7,19 @@ using System.Linq;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Events;
|
using UnityEngine.Events;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
namespace NewHorizons.Utility
|
namespace NewHorizons.Utility
|
||||||
{
|
{
|
||||||
public static class ImageUtilities
|
public static class ImageUtilities
|
||||||
{
|
{
|
||||||
private static readonly Dictionary<string, Texture2D> _loadedTextures = new();
|
private static readonly Dictionary<string, Texture2D> _loadedTextures = new();
|
||||||
internal static readonly List<Texture> _generatedTextures = new();
|
private static readonly List<Texture> _generatedTextures = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Track textures generated outside of this file so they can be cleaned up on scene unload
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="texture"></param>
|
||||||
|
public static void TrackGeneratedTexture(Texture texture) => _generatedTextures.Add(texture);
|
||||||
|
|
||||||
public static bool IsTextureLoaded(IModBehaviour mod, string filename)
|
public static bool IsTextureLoaded(IModBehaviour mod, string filename)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user