浏览代码

Improved UI and less OnGUI() calls

/main
HarshNarayanJha 4 年前
当前提交
64a8df52
共有 1 个文件被更改,包括 9 次插入8 次删除
  1. 17
      UOP1_Project/Assets/Scripts/Editor/SOsQuickAccessToolWindow.cs

17
UOP1_Project/Assets/Scripts/Editor/SOsQuickAccessToolWindow.cs


assetSearchFolders[0] = "Assets/ScriptableObjects";
FindAllSOs();
FindDisplaySOs();
FindDisplaySOs();
}
[MenuItem("Tools/SOs Quick Access Tool")]

void OnGUI()
{
GUILayout.Space(EditorGUIUtility.singleLineHeight);
GUILayout.Space(EditorGUIUtility.singleLineHeight * 0.5f);
GUILayout.BeginHorizontal();
DrawSOsPicker();
if (GUILayout.Button("Refresh All"))
{
FindAllSOs();

GUILayout.Space(EditorGUIUtility.singleLineHeight);
GUILayout.Label("Please select a Scriptable Object Type To Search For");
GUILayout.Space(EditorGUIUtility.singleLineHeight);
DrawSOsPicker();
GUILayout.Space(EditorGUIUtility.singleLineHeight * 3f);
GUILayout.EndHorizontal();
DrawSOsList();
}

selected = EditorGUILayout.Popup("Scriptable Object Types", selected, SOTypes.ToArray());
selected = EditorGUILayout.Popup(GUIContent.none, selected, SOTypes.ToArray());
if (EditorGUI.EndChangeCheck())
{
FindDisplaySOs();

正在加载...
取消
保存