zoukankan      html  css  js  c++  java
  • unityEditor 显示 相关

    使用DelayedTextField进行 F2浮动Text修改名字: 

    DelayedTextField的位置在选定editorRect的附近

       if (IsSelected && Event.current.type != EventType.Layout
                    && Event.current.type != EventType.Used
                    && Event.current.keyCode != KeyCode.Backspace
                    && (Event.current.keyCode == KeyCode.KeypadEnter || Event.current.keyCode == KeyCode.Return))
                {
                    GUI.SetNextControlName(FocusHEADNAME);
                    string name = EditorGUI.DelayedTextField(editorRect, HeaderText, EditorStyles.boldLabel);
                    EditorGUI.FocusTextInControl(FocusHEADNAME);
                    if (name != HeaderText)
                    {
                        HeaderText = name;
                        GUI.Label(labelRect, HeaderText, EditorStyles.boldLabel);
                    }
    
                    isEnterClick = true;
                    isHeadCanEditor = false;
                    EditorGUI.FocusTextInControl(null);
                    Event.current.Use();
                    // return;
                }
    
                if (IsSelected && isHeadCanEditor)
                {
                    GUI.SetNextControlName(FocusHEADNAME);
                    string name = EditorGUI.DelayedTextField(editorRect, HeaderText, EditorStyles.boldLabel);
                    EditorGUI.FocusTextInControl(FocusHEADNAME);
                    if (name != HeaderText)
                    {
                        HeaderText = name;
                      //  GUI.Label(labelRect, HeaderText, EditorStyles.boldLabel);
                    }
                }
    改变自己
  • 相关阅读:
    Channel使用技巧
    Flask开发技巧之异常处理
    后端开发使用pycharm的技巧
    python单元测试
    Docker入门介绍
    python高阶函数的使用
    python内置模块collections介绍
    python中@property装饰器的使用
    三次握手四次挥手
    python类方法@classmethod与@staticmethod
  • 原文地址:https://www.cnblogs.com/sun-shadow/p/14498996.html
Copyright © 2011-2022 走看看