Created
December 24, 2019 15:11
-
-
Save dimmduh/32c5b478c01c1429af91780b3a8aa383 to your computer and use it in GitHub Desktop.
Unity. Change material standard shader blend mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//see https://github.com/Unity-Technologies/UnityCsReference/blob/9034442437e6b5efe28c51d02e978a96a3ce5439/Editor/Mono/Inspector/StandardShaderGUI.cs | |
//blend mode 3 - transparent | |
public static void SetupMaterialWithBlendMode(Material material, int blendMode) | |
{ | |
var assembly = Assembly.GetAssembly(typeof(Editor)); | |
var type = assembly.GetType("UnityEditor.StandardShaderGUI"); | |
var method = type.GetMethod("SetupMaterialWithBlendMode"); | |
method.Invoke(null, new object[] {material, blendMode}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment