public NMaterial CreateMaterial() { NMaterial mat = new NMaterial(ShaderConfig.GetShader(shaderName)); mat.mainTexture = texture.nativeTexture; if (texture.alphaTexture != null) { mat.EnableKeyword("COMBINED"); mat.SetTexture("_AlphaTex", texture.alphaTexture); } if (_keywords != null) { foreach (string v in _keywords) { mat.EnableKeyword(v); } } mat.hideFlags = DisplayOptions.hideFlags; return(mat); }
public NMaterial CreateMaterial() { Shader shader = ShaderConfig.Get(shaderName); if (shader == null) { Debug.LogWarning("FairyGUI: shader not found: " + shaderName); shader = Shader.Find("UI/Default"); } NMaterial mat = new NMaterial(shader); mat.mainTexture = texture.nativeTexture; if (texture.alphaTexture != null) { mat.EnableKeyword("COMBINED"); mat.SetTexture("_AlphaTex", texture.alphaTexture); } shader.hideFlags = DisplayOptions.hideFlags; mat.hideFlags = DisplayOptions.hideFlags; return(mat); }
public NMaterial CreateMaterial() { NMaterial mat = new NMaterial(ShaderConfig.GetShader(shaderName)); mat.mainTexture = texture.nativeTexture; if (texture.alphaTexture != null) { mat.EnableKeyword("COMBINED"); mat.SetTexture("_AlphaTex", texture.alphaTexture); } if (_keywords != null) { foreach (string v in _keywords) mat.EnableKeyword(v); } mat.hideFlags = DisplayOptions.hideFlags; return mat; }