This commit is contained in:
Mikhail 2026-04-15 14:58:21 +08:00
parent 535e88f041
commit edc1190a40

View File

@ -70,12 +70,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
moveSign = -1; moveSign = -1;
} }
} }
_selectedIndex += moveSign; // _selectedIndex += moveSign;
if(moveSign != 0)
{
Repaint();
return;
}
DragonDocs docs = DragonDocsPrefs.instance.Docs; DragonDocs docs = DragonDocsPrefs.instance.Docs;
if (docs == null || docs.Metas.IsEmpty) if (docs == null || docs.Metas.IsEmpty)
@ -106,7 +101,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
MetaGroupInfo selectedGroupInfo; MetaGroupInfo selectedGroupInfo;
using (DragonGUI.Layout.BeginScrollView(ref ButtonsScrolPosition, UnityEditorUtility.GetClearBackgrounStyle(), GUILayout.Width(_buttonsWidth))) using (DragonGUI.Layout.BeginScrollView(ref ButtonsScrolPosition, UnityEditorUtility.GetClearBackgrounStyle(), GUILayout.Width(_buttonsWidth)))
{ {
selectedGroupInfo = DrawGroups(); selectedGroupInfo = DrawGroups(moveSign);
} }
DrawDragger(); DrawDragger();
@ -134,6 +129,12 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
{ {
GUILayout.Label(infos[_selectedIndex].Path); GUILayout.Label(infos[_selectedIndex].Path);
} }
if (moveSign != 0)
{
Repaint();
return;
}
} }
private void DrawToolbar() private void DrawToolbar()
@ -345,13 +346,16 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
} }
} }
private MetaGroupInfo DrawGroups() private MetaGroupInfo DrawGroups(int moveSign)
{ {
Event current = Event.current; Event current = Event.current;
MetaGroupInfo result = new MetaGroupInfo("NO_NAME", "NO_NAME", 0, 0, 0); MetaGroupInfo result = new MetaGroupInfo("NO_NAME", "NO_NAME", 0, 0, 0);
var infos = Prefs.Infos; var infos = Prefs.Infos;
var isExpands = Prefs.IsExpands; var isExpands = Prefs.IsExpands;
int prevIndex = 0;
int nextIndex = 0;
using (DragonGUI.SetIndentLevel(0)) using (DragonGUI.SetIndentLevel(0))
{ {
int clippingDepth = int.MaxValue; int clippingDepth = int.MaxValue;
@ -379,6 +383,15 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
{ {
clippingDepth = int.MaxValue; clippingDepth = int.MaxValue;
} }
if(nextIndex < _selectedIndex)
{
prevIndex = nextIndex;
}
if (nextIndex <= _selectedIndex)
{
nextIndex = i;
}
if (_searchingSample.Length == 0) if (_searchingSample.Length == 0)
{ {
@ -447,6 +460,18 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
} }
} }
} }
if(moveSign != 0)
{
if(moveSign < 0)
{
_selectedIndex = prevIndex;
}
else
{
_selectedIndex = nextIndex;
}
}
return result; return result;
} }