Last active
March 28, 2019 07:26
-
-
Save quizcanners/f93dca1829348094212e6e30bd85f1fc to your computer and use it in GitHub Desktop.
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
public override void OnInspectorGUI() { | |
var controller = (MyMaterialController )target; | |
EditorGUILayout.BeginHorizontal(); | |
EditorGUI.BeginChangeCheck(); | |
controller .transparency = EditorGUILayout.FloatField("Object's Transparency:", controller .transparency); | |
if (EditorGUI.EndChangeCheck()) | |
controller .RecalculateShaderParameters(); | |
GUIContent cont = new GUIContent { | |
tooltip = "Will load default value", | |
image = refreshIcon | |
}; | |
if (controller .transparency != 0.5 && GUILayout.Button(cont, GUILayout.MaxWidth(25), GUILayout.MaxHeight(25))) | |
controller .transparency = 0.5; | |
EditorGUILayout.EndHorizontal(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment