当前位置: 首页>>代码示例>>C#>>正文


C# Editor.OnPreviewGUI方法代码示例

本文整理汇总了C#中UnityEditor.Editor.OnPreviewGUI方法的典型用法代码示例。如果您正苦于以下问题:C# Editor.OnPreviewGUI方法的具体用法?C# Editor.OnPreviewGUI怎么用?C# Editor.OnPreviewGUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEditor.Editor的用法示例。


在下文中一共展示了Editor.OnPreviewGUI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: sideBarGUI


//.........这里部分代码省略.........
            }
            if(GUILayout.Button("Select Board"))
            {
                n_FileLocation = EditorUtility.OpenFilePanel("Select A Board","Assets/Editor/TaskManager/TaskData/","asset");
                if (n_FileLocation.Length != 0)
                {

                    if(n_FileLocation.Contains("Assets"))
                    {
                        n_FileLocation = n_FileLocation.Replace(CurrentDataPath, "");
                        Debug.Log(n_FileLocation);
                    }

                    //load the board here
                    LoadOldDatabase();
                }
            }
            if(GUILayout.Button("Clear File Path"))
            {
                n_FileLocation = null;
                newBoardName = null;
            }
            ///END Loading Board

            EditorGUILayout.EndVertical();
            GUILayout.EndArea();
        }
        else
        {

            if(n_HideSideBar == false)
            {
                GUILayout.BeginArea(new Rect(Screen.width-250,0, 250, Screen.height));
                EditorGUILayout.BeginVertical("GroupBox");

                EditorGUILayout.Space();

                if(m_Task != null)
                {
                    EditorGUILayout.LabelField("Board Data");
                    EditorGUILayout.LabelField("Number of Tasks: " + m_Task.database.Count);
                }

                EditorGUILayout.Space();
                EditorGUILayout.Space();

                if (GUILayout.Button ("Add Task", GUILayout.Height(30)))
                {

                    m_Task.Add(new Task("", "", ""));
                    EditorUtility.SetDirty(m_Task);
                    Repaint();
                }

                EditorGUILayout.Space();

                if (gameObjectToDisplay != null)
                {

                    //if(gameObjectEditor != null)
                    //{
                        EditorGUILayout.LabelField("Asset From Task");
                        gameObjectEditor = Editor.CreateEditor(gameObjectToDisplay);
                        gameObjectEditor.OnPreviewGUI(GUILayoutUtility.GetRect(250, 150), EditorStyles.miniButton);

                    //}
                }

                EditorGUILayout.Space();
                EditorGUILayout.Space();

                if(GUILayout.Button("Hide SideBar"))
                {
                    n_HideSideBar = true;
                }

                if(GUILayout.Button("Close Board"))
                {
                    DeleteDatabase();
                }

                EditorGUILayout.EndVertical();
                GUILayout.EndArea();
            }
            else
            {
                GUILayout.BeginArea(new Rect(Screen.width-250,0, 250, Screen.height));
                EditorGUILayout.BeginHorizontal("GroupBox");

                if(GUILayout.Button("Show Sidebar"))
                {
                    n_HideSideBar = false;
                }

                EditorGUILayout.EndHorizontal();
                GUILayout.EndArea();
            }

        }
    }
开发者ID:kinifi,项目名称:Node-Task-Manager,代码行数:101,代码来源:TaskManager.cs


注:本文中的UnityEditor.Editor.OnPreviewGUI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。