Esempio n. 1
0
 public override void Apply(MaterialProperty prop)
 {
     base.Apply(prop);
     if (MaterialTextureToggleDrawer.IsPropertyTypeSuitable(prop))
     {
         this.SetKeyword(prop, prop.textureValue);
     }
 }
Esempio n. 2
0
 public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor)
 {
     if (!MaterialTextureToggleDrawer.IsPropertyTypeSuitable(prop))
     {
         GUIContent label2 = new GUIContent("Toggle used on a non-texture property: " + prop.name);
         EditorGUI.LabelField(position, label2, EditorStyles.helpBox);
     }
     else
     {
         EditorGUI.BeginChangeCheck();
         prop.textureValue = editor.TextureProperty(position, prop, label.text);
         if (EditorGUI.EndChangeCheck())
         {
             this.SetKeyword(prop, prop.textureValue);
         }
     }
 }