From 8b1a9f3deeae32dcf187576b714afa831dcb5f0d Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 16 Jul 2022 17:23:54 -0700 Subject: [PATCH] use property id more --- .../SizeControllers/StarEvolutionController.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs index 13a6522d..9c877267 100644 --- a/NewHorizons/Components/SizeControllers/StarEvolutionController.cs +++ b/NewHorizons/Components/SizeControllers/StarEvolutionController.cs @@ -56,6 +56,9 @@ namespace NewHorizons.Components.SizeControllers private float minScale; private static readonly int ColorRamp = Shader.PropertyToID("_ColorRamp"); private static readonly int ColorTime = Shader.PropertyToID("_ColorTime"); + private static readonly int InnerRadius = Shader.PropertyToID("_InnerRadius"); + private static readonly int OuterRadius = Shader.PropertyToID("_OuterRadius"); + private static readonly int SkyColor = Shader.PropertyToID("_SkyColor"); private Color _currentColour; @@ -276,9 +279,9 @@ namespace NewHorizons.Components.SizeControllers { foreach (var lod in _atmosphereRenderers) { - lod.material.SetFloat("_InnerRadius", CurrentScale); - lod.material.SetFloat("_OuterRadius", CurrentScale * StarBuilder.OuterRadiusRatio); - lod.material.SetColor("_SkyColor", _currentColour); + lod.material.SetFloat(InnerRadius, CurrentScale); + lod.material.SetFloat(OuterRadius, CurrentScale * StarBuilder.OuterRadiusRatio); + lod.material.SetColor(SkyColor, _currentColour); } } }