本文整理汇总了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();
}
}
}