mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
cache shader property id
This commit is contained in:
parent
2da430251c
commit
b0810e9bfa
1 changed files with 3 additions and 3 deletions
|
@ -58,9 +58,9 @@ namespace SanAndreasUnity.Importing.Conversion
|
|||
get { return _sCarColorIndexId == -1 ? _sCarColorIndexId = Shader.PropertyToID("_CarColorIndex") : _sCarColorIndexId; }
|
||||
}
|
||||
|
||||
private static int _sNightColorsPropertyId = -1;
|
||||
private static int _sHasNightColorsPropertyId = -1;
|
||||
|
||||
public static int NightColorsPropertyId => _sNightColorsPropertyId == -1 ? _sNightColorsPropertyId = Shader.PropertyToID("_NightColors") : _sNightColorsPropertyId;
|
||||
public static int HasNightColorsPropertyId => _sHasNightColorsPropertyId == -1 ? _sHasNightColorsPropertyId = Shader.PropertyToID("_HasNightColors") : _sHasNightColorsPropertyId;
|
||||
|
||||
private static int[] FromTriangleStrip(IList<int> indices)
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ namespace SanAndreasUnity.Importing.Conversion
|
|||
|
||||
if (geometry.ExtraVertColor != null && geometry.ExtraVertColor.Colors != null)
|
||||
{
|
||||
mat.SetFloat("_HasNightColors", 1);
|
||||
mat.SetFloat(HasNightColorsPropertyId, 1);
|
||||
}
|
||||
|
||||
return mat;
|
||||
|
|
Loading…
Reference in a new issue