public override void GrabMaterialValues()
 {
     if (Material)
     {
         shaderKeywords             = Material.shaderKeywords;
         _Color                     = Material.GetColor("_Color");
         _MainTex                   = Material.GetTexture("_MainTex");
         _MainTexScale              = Material.GetTextureScale("_MainTex");
         _MainTexOffset             = Material.GetTextureOffset("_MainTex");
         _NormalStrength            = Material.GetFloat("_NormalStrength");
         _NormalTex                 = Material.GetTexture("_NormalTex");
         _NormalTexScale            = Material.GetTextureScale("_NormalTex");
         _NormalTexOffset           = Material.GetTextureOffset("_NormalTex");
         _EmColor                   = Material.GetColor("_EmColor");
         _EmTex                     = Material.GetTexture("_EmTex");
         _EmPower                   = Material.GetFloat("_EmPower");
         _Smoothness                = Material.GetFloat("_Smoothness");
         _RampChoice                = (_RampInfoEnum)(int)Material.GetFloat("_RampInfo");
         _DecalLayer                = (_DecalLayerEnum)(int)Material.GetFloat("_DecalLayer");
         _SpecularStrength          = Material.GetFloat("_SpecularStrength");
         _SpecularExponent          = Material.GetFloat("_SpecularExponent");
         _Cull_Mode                 = (_CullEnum)(int)Material.GetFloat("_Cull");
         _FadeBias                  = Material.GetFloat("_FadeBias");
         _FresnelRamp               = Material.GetTexture("_FresnelRamp");
         _FresnelPower              = Material.GetFloat("_FresnelPower");
         _FresnelMask               = Material.GetTexture("_FresnelMask");
         _FresnelBoost              = Material.GetFloat("_FresnelBoost");
         _SliceHeight               = Material.GetFloat("_SliceHeight");
         _PrintBandHeight           = Material.GetFloat("_SliceBandHeight");
         _PrintAlphaDepth           = Material.GetFloat("_SliceAlphaDepth");
         _PrintAlphaTexture         = Material.GetTexture("_SliceAlphaTex");
         _PrintAlphaTextureScale    = Material.GetTextureScale("_SliceAlphaTex");
         _PrintAlphaTextureOffset   = Material.GetTextureOffset("_SliceAlphaTex");
         _PrintColorBoost           = Material.GetFloat("_PrintBoost");
         _PrintAlphaBias            = Material.GetFloat("_PrintBias");
         _PrintEmissionToAlbedoLerp = Material.GetFloat("_PrintEmissionToAlbedoLerp");
         _PrintDirection            = (_PrintDirectionEnum)(int)Material.GetFloat("_PrintDirection");
         _PrintRamp                 = Material.GetTexture("_PrintRamp");
         _EliteBrightnessMin        = Material.GetFloat("_EliteBrightnessMin");
         _EliteBrightnessMax        = Material.GetFloat("_EliteBrightnessMax");
         _BlendDepth                = Material.GetFloat("_Depth");
         _SplatmapTex               = Material.GetTexture("_SplatmapTex");
         _SplatmapTexScale          = Material.GetTextureScale("_SplatmapTex");
         _SplatmapTexOffset         = Material.GetTextureOffset("_SplatmapTex");
         _SplatmapTileScale         = Material.GetFloat("_SplatmapTileScale");
         _GreenChannelTex           = Material.GetTexture("_GreenChannelTex");
         _GreenChannelNormalTex     = Material.GetTexture("_GreenChannelNormalTex");
         _GreenChannelSmoothness    = Material.GetFloat("_GreenChannelSmoothness");
         _GreenChannelBias          = Material.GetFloat("_GreenChannelBias");
         _BlueChannelTex            = Material.GetTexture("_BlueChannelTex");
         _BlueChannelNormalTex      = Material.GetTexture("_BlueChannelNormalTex");
         _BlueChannelSmoothness     = Material.GetFloat("_BlueChannelSmoothness");
         _BlueChannelBias           = Material.GetFloat("_BlueChannelBias");
         _FlowTexture               = Material.GetTexture("_FlowTex");
         _FlowHeightmap             = Material.GetTexture("_FlowHeightmap");
         _FlowHeightmapScale        = Material.GetTextureScale("_FlowHeightmap");
         _FlowHeightmapOffset       = Material.GetTextureOffset("_FlowHeightmap");
         _FlowHeightRamp            = Material.GetTexture("_FlowHeightRamp");
         _FlowHeightRampScale       = Material.GetTextureScale("_FlowHeightRamp");
         _FlowHeightRampOffset      = Material.GetTextureOffset("_FlowHeightRamp");
         _FlowHeightBias            = Material.GetFloat("_FlowHeightBias");
         _FlowHeightPower           = Material.GetFloat("_FlowHeightPower");
         _FlowEmissionStrength      = Material.GetFloat("_FlowEmissionStrength");
         _FlowSpeed                 = Material.GetFloat("_FlowSpeed");
         _MaskFlowStrength          = Material.GetFloat("_FlowMaskStrength");
         _NormalFlowStrength        = Material.GetFloat("_FlowNormalStrength");
         _FlowTextureScaleFactor    = Material.GetFloat("_FlowTextureScaleFactor");
         MaterialName               = Material.name;
     }
 }
Exemplo n.º 2
0
 public void GrabMaterialValues()
 {
     if (Material)
     {
         _EnableCutout    = Material.IsKeywordEnabled("CUTOUT");
         _Color           = Material.GetColor("_Color");
         _MainTex         = Material.GetTexture("_MainTex");
         _MainTexScale    = Material.GetTextureScale("_MainTex");
         _MainTexOffset   = Material.GetTextureOffset("_MainTex");
         _NormalStrength  = Material.GetFloat("_NormalStrength");
         _NormalTex       = Material.GetTexture("_NormalTex");
         _NormalTexScale  = Material.GetTextureScale("_NormalTex");
         _NormalTexOffset = Material.GetTextureOffset("_NormalTex");
         _EmColor         = Material.GetColor("_EmColor");
         _EmTex           = Material.GetTexture("_EmTex");
         _EmPower         = Material.GetFloat("_EmPower");
         _Smoothness      = Material.GetFloat("_Smoothness");
         _IgnoreDiffuseAlphaForSpeculars = Material.IsKeywordEnabled("FORCE_SPEC");
         _RampChoice                = (_RampInfoEnum)(int)Material.GetFloat("_RampInfo");
         _DecalLayer                = (_DecalLayerEnum)(int)Material.GetFloat("_DecalLayer");
         _SpecularStrength          = Material.GetFloat("_SpecularStrength");
         _SpecularExponent          = Material.GetFloat("_SpecularExponent");
         _Cull_Mode                 = (_CullEnum)(int)Material.GetFloat("_Cull");
         _EnableDither              = Material.IsKeywordEnabled("DITHER");
         _FadeBias                  = Material.GetFloat("_FadeBias");
         _EnableFresnelEmission     = Material.IsKeywordEnabled("FRESNEL_EMISSION");
         _FresnelRamp               = Material.GetTexture("_FresnelRamp");
         _FresnelPower              = Material.GetFloat("_FresnelPower");
         _FresnelMask               = Material.GetTexture("_FresnelMask");
         _FresnelBoost              = Material.GetFloat("_FresnelBoost");
         _EnablePrinting            = Material.IsKeywordEnabled("PRINT_CUTOFF");
         _SliceHeight               = Material.GetFloat("_SliceHeight");
         _PrintBandHeight           = Material.GetFloat("_SliceBandHeight");
         _PrintAlphaDepth           = Material.GetFloat("_SliceAlphaDepth");
         _PrintAlphaTexture         = Material.GetTexture("_SliceAlphaTex");
         _PrintAlphaTextureScale    = Material.GetTextureScale("_SliceAlphaTex");
         _PrintAlphaTextureOffset   = Material.GetTextureOffset("_SliceAlphaTex");
         _PrintColorBoost           = Material.GetFloat("_PrintBoost");
         _PrintAlphaBias            = Material.GetFloat("_PrintBias");
         _PrintEmissionToAlbedoLerp = Material.GetFloat("_PrintEmissionToAlbedoLerp");
         _PrintDirection            = (_PrintDirectionEnum)(int)Material.GetFloat("_PrintDirection");
         _PrintRamp                 = Material.GetTexture("_PrintRamp");
         _EliteBrightnessMin        = Material.GetFloat("_EliteBrightnessMin");
         _EliteBrightnessMax        = Material.GetFloat("_EliteBrightnessMax");
         _EnableSplatmap            = Material.IsKeywordEnabled("SPLATMAP");
         _UseVertexColorsInstead    = Material.IsKeywordEnabled("USE_VERTEX_COLORS");
         _BlendDepth                = Material.GetFloat("_Depth");
         _SplatmapTex               = Material.GetTexture("_SplatmapTex");
         _SplatmapTexScale          = Material.GetTextureScale("_SplatmapTex");
         _SplatmapTexOffset         = Material.GetTextureOffset("_SplatmapTex");
         _SplatmapTileScale         = Material.GetFloat("_SplatmapTileScale");
         _GreenChannelTex           = Material.GetTexture("_GreenChannelTex");
         _GreenChannelNormalTex     = Material.GetTexture("_GreenChannelNormalTex");
         _GreenChannelSmoothness    = Material.GetFloat("_GreenChannelSmoothness");
         _GreenChannelBias          = Material.GetFloat("_GreenChannelBias");
         _BlueChannelTex            = Material.GetTexture("_BlueChannelTex");
         _BlueChannelNormalTex      = Material.GetTexture("_BlueChannelNormalTex");
         _BlueChannelSmoothness     = Material.GetFloat("_BlueChannelSmoothness");
         _BlueChannelBias           = Material.GetFloat("_BlueChannelBias");
         _EnableFlowmap             = Material.IsKeywordEnabled("FLOWMAP");
         _FlowTexture               = Material.GetTexture("_FlowTex");
         _FlowHeightmap             = Material.GetTexture("_FlowHeightmap");
         _FlowHeightmapScale        = Material.GetTextureScale("_FlowHeightmap");
         _FlowHeightmapOffset       = Material.GetTextureOffset("_FlowHeightmap");
         _FlowHeightRamp            = Material.GetTexture("_FlowHeightRamp");
         _FlowHeightRampScale       = Material.GetTextureScale("_FlowHeightRamp");
         _FlowHeightRampOffset      = Material.GetTextureOffset("_FlowHeightRamp");
         _FlowHeightBias            = Material.GetFloat("_FlowHeightBias");
         _FlowHeightPower           = Material.GetFloat("_FlowHeightPower");
         _FlowEmissionStrength      = Material.GetFloat("_FlowEmissionStrength");
         _FlowSpeed                 = Material.GetFloat("_FlowSpeed");
         _MaskFlowStrength          = Material.GetFloat("_FlowMaskStrength");
         _NormalFlowStrength        = Material.GetFloat("_FlowNormalStrength");
         _FlowTextureScaleFactor    = Material.GetFloat("_FlowTextureScaleFactor");
         _EnableLimbRemoval         = Material.IsKeywordEnabled("LIMBREMOVAL");
         MaterialName               = Material.name;
     }
 }