mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2026-04-22 04:35:55 +08:00
fix
This commit is contained in:
parent
535e88f041
commit
edc1190a40
@ -70,12 +70,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
|
||||
moveSign = -1;
|
||||
}
|
||||
}
|
||||
_selectedIndex += moveSign;
|
||||
if(moveSign != 0)
|
||||
{
|
||||
Repaint();
|
||||
return;
|
||||
}
|
||||
// _selectedIndex += moveSign;
|
||||
|
||||
DragonDocs docs = DragonDocsPrefs.instance.Docs;
|
||||
if (docs == null || docs.Metas.IsEmpty)
|
||||
@ -106,7 +101,7 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
|
||||
MetaGroupInfo selectedGroupInfo;
|
||||
using (DragonGUI.Layout.BeginScrollView(ref ButtonsScrolPosition, UnityEditorUtility.GetClearBackgrounStyle(), GUILayout.Width(_buttonsWidth)))
|
||||
{
|
||||
selectedGroupInfo = DrawGroups();
|
||||
selectedGroupInfo = DrawGroups(moveSign);
|
||||
}
|
||||
|
||||
DrawDragger();
|
||||
@ -134,6 +129,12 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
|
||||
{
|
||||
GUILayout.Label(infos[_selectedIndex].Path);
|
||||
}
|
||||
|
||||
if (moveSign != 0)
|
||||
{
|
||||
Repaint();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
MetaGroupInfo result = new MetaGroupInfo("NO_NAME", "NO_NAME", 0, 0, 0);
|
||||
var infos = Prefs.Infos;
|
||||
var isExpands = Prefs.IsExpands;
|
||||
|
||||
int prevIndex = 0;
|
||||
int nextIndex = 0;
|
||||
|
||||
using (DragonGUI.SetIndentLevel(0))
|
||||
{
|
||||
int clippingDepth = int.MaxValue;
|
||||
@ -379,6 +383,15 @@ namespace DCFApixels.DragonECS.Unity.Docs.Editors
|
||||
{
|
||||
clippingDepth = int.MaxValue;
|
||||
}
|
||||
if(nextIndex < _selectedIndex)
|
||||
{
|
||||
prevIndex = nextIndex;
|
||||
}
|
||||
if (nextIndex <= _selectedIndex)
|
||||
{
|
||||
nextIndex = i;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user