mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Initialize fields in static constructor
This commit is contained in:
parent
f3fc243868
commit
e4d70343e7
@ -8,8 +8,8 @@ namespace NewHorizons.Builder.StarSystem
|
|||||||
{
|
{
|
||||||
public class SkyboxBuilder
|
public class SkyboxBuilder
|
||||||
{
|
{
|
||||||
private static int _skyboxLayer = -1;
|
private static readonly int _skyboxLayer = LayerMask.NameToLayer("Skybox");
|
||||||
private static Shader _unlitShader;
|
private static readonly Shader _unlitShader = Shader.Find("Unlit/Texture");
|
||||||
|
|
||||||
[Obsolete]
|
[Obsolete]
|
||||||
public static void Make(StarSystemConfig.SkyboxConfig info, IModBehaviour mod)
|
public static void Make(StarSystemConfig.SkyboxConfig info, IModBehaviour mod)
|
||||||
@ -40,9 +40,6 @@ namespace NewHorizons.Builder.StarSystem
|
|||||||
var frontTex = ImageUtilities.GetTexture(mod, module.frontPath);
|
var frontTex = ImageUtilities.GetTexture(mod, module.frontPath);
|
||||||
var backTex = ImageUtilities.GetTexture(mod, module.backPath);
|
var backTex = ImageUtilities.GetTexture(mod, module.backPath);
|
||||||
|
|
||||||
if (_skyboxLayer == -1) _skyboxLayer = LayerMask.NameToLayer("Skybox");
|
|
||||||
if (!_unlitShader) _unlitShader = Shader.Find("Unlit/Texture");
|
|
||||||
|
|
||||||
var mesh = BuildSkySphereFaceMesh(module.useCube ? 1 : 32);
|
var mesh = BuildSkySphereFaceMesh(module.useCube ? 1 : 32);
|
||||||
|
|
||||||
var skySphere = new GameObject("Sky Sphere");
|
var skySphere = new GameObject("Sky Sphere");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user