美文网首页Unity编辑器开发分享Unity教程合集
Unity之EditorGUILayout-显示控件禁止对控件进

Unity之EditorGUILayout-显示控件禁止对控件进

作者: 循环渐进123456 | 来源:发表于2017-09-11 09:04 被阅读10次

转载:http://blog.csdn.net/liqiangeastsun/article/details/42173513

使用Unity编辑器类控制部分区域不可操作

bool  isTrue;  
  
public static void OnInspectorGUI()  
    {  
  
 EditorGUI.BeginDisabledGroup(nextPath == null);  //如果nextPath == null 为真,在Inspector面板上显示,承灰色(即不可操作)  
        EditorGUILayout.LabelField("Interpolate", GUILayout.Width(70));  
        EditorGUILayout.Toggle(isTrue, GUILayout.Width(30));  
 EditorGUI.EndDisabledGroup();  
  
}  

相关文章

网友评论

    本文标题:Unity之EditorGUILayout-显示控件禁止对控件进

    本文链接:https://www.haomeiwen.com/subject/wwyxsxtx.html