diff --git a/Assets/AssetBookmarker/Editor/Project/Editor/GUI/ProjectBookmarkWindow.cs b/Assets/AssetBookmarker/Editor/Project/Editor/GUI/ProjectBookmarkWindow.cs index 27d13a3..5815471 100644 --- a/Assets/AssetBookmarker/Editor/Project/Editor/GUI/ProjectBookmarkWindow.cs +++ b/Assets/AssetBookmarker/Editor/Project/Editor/GUI/ProjectBookmarkWindow.cs @@ -19,7 +19,12 @@ public class ProjectBookmarkWindow : BookmarkWindowBase /// Label領域の大きさ /// private const float LabelWidth = 68f; - + + /// + /// Directional button size + /// + private const float DirButtonWidth = 16f; + /// /// ボタンの大きさ /// @@ -44,7 +49,7 @@ public class ProjectBookmarkWindow : BookmarkWindowBase /// 現在選択しているブックマークデータ名 /// [SerializeField] private string currentBookmarkName; - + /// /// ブックマーク情報 /// @@ -54,9 +59,12 @@ public class ProjectBookmarkWindow : BookmarkWindowBase private static bool needReloadData = false; private static Object[] willRegisterAssets = null; + private static GUIContent prevIcon; + private static GUIContent nextIcon; + /// /// アセットのロード時に呼ばれる - /// + /// [DidReloadScripts] [InitializeOnLoadMethodAttribute] public static void OnLoadAssets() @@ -89,20 +97,42 @@ private void OnGUI() { this.RebuildBookmarkList(); } - + if (willRegisterAssets != null) { - var data = this.bookmarkDatas[this.currentBookmarkIndex]; + var data = this.bookmarkDatas[this.currentBookmarkIndex]; data.Assets.AddRange(willRegisterAssets); EditorUtility.SetDirty(data); willRegisterAssets = null; } + prevIcon = EditorGUIUtility.IconContent("d_Profiler.PrevFrame"); + nextIcon = EditorGUIUtility.IconContent("d_Profiler.NextFrame"); + EditorGUILayout.LabelField(MenuConfig.GUI_WINDOW_PROJECT_TEXT_OVERVIEW); EditorGUILayout.BeginHorizontal(); EditorGUI.BeginChangeCheck(); EditorGUILayout.LabelField("Bookmark", GUILayout.Width(LabelWidth)); - int index = EditorGUILayout.Popup(this.currentBookmarkIndex, this.popupDisplayedOptions); + + int dirIndex = currentBookmarkIndex; + + EditorGUIUtility.SetIconSize(new Vector2(14, 14)); + if (GUILayout.Button(prevIcon, EditorStyles.miniButton, GUILayout.Width(DirButtonWidth))) + { + if (dirIndex > 0) --dirIndex; + } + + int index = EditorGUILayout.Popup(currentBookmarkIndex, popupDisplayedOptions); + + EditorGUIUtility.SetIconSize(new Vector2(14, 14)); + if (GUILayout.Button(nextIcon, EditorStyles.miniButton, GUILayout.Width(DirButtonWidth))) + { + if (dirIndex < bookmarkDatas.Length - 1) ++dirIndex; + } + + if (index != currentBookmarkIndex) { } + else index = dirIndex; + if (EditorGUI.EndChangeCheck()) { if (index < bookmarkDatas.Length) @@ -255,7 +285,7 @@ static private void DoRemoveButton(ReorderableList list, int index) window.Repaint(); }; } - + /// /// ウィンドウを開く ///