private static void HasMatPropertyShaderUniform(GenericMaterial genericMaterial, Nud.Material mat, string propertyName, string uniformName) { bool hasValue = mat.HasProperty(propertyName) || mat.HasPropertyAnim(propertyName); if (hasValue) { genericMaterial.AddInt(uniformName, 1); } else { genericMaterial.AddInt(uniformName, 0); } }
private static void HasMatPropertyShaderUniform(GenericMaterial genericMaterial, NUD.Material mat, string propertyName, string uniformName) { bool hasValue = mat.entries.ContainsKey(propertyName) || mat.anims.ContainsKey(propertyName); if (hasValue) { genericMaterial.AddInt(uniformName, 1); } else { genericMaterial.AddInt(uniformName, 0); } }
private static void HasMatPropertyShaderUniform(GenericMaterial genericMaterial, NUD.Material mat, string propertyName, string uniformName) { float[] values; mat.entries.TryGetValue(propertyName, out values); if (mat.anims.ContainsKey(propertyName)) { values = mat.anims[propertyName]; } int hasParam = 1; if (values == null) { hasParam = 0; } genericMaterial.AddInt(uniformName, hasParam); }