main
pengjunwu 2023-10-27 12:07:33 +08:00
parent 72cce8803d
commit 786a48b136
2 changed files with 15 additions and 8 deletions

View File

@ -88,7 +88,7 @@ public class UI_LevelSelectController : UIWindow
private List<GameObject> _showStarReward = new();
private float _totalMoveTime = 1f;
private CancellationTokenSource _cts = new();
private CancellationTokenSource _cts;
public override void OnAwake()
{
@ -299,8 +299,8 @@ public class UI_LevelSelectController : UIWindow
currStarCount = 6;
var ratio = (float)currStarCount / maxTarget;
Text_StarNum.text = currStarCount.ToString();
_cts.Cancel();
_cts.Dispose();
_cts?.Cancel();
_cts?.Dispose();
_cts = new CancellationTokenSource();
PlayProgressAnimation(ratio, progressLength, _cts.Token);
Refresh();
@ -516,12 +516,17 @@ public class UI_LevelSelectController : UIWindow
private void OnClickBack()
{
if (_currPage == PageType.Mode)
UIManager.Instance.CloseWindow(WindowName, true);
else
switch (_currPage)
{
_currPage = (PageType)((int)_currPage - 1);
Refresh();
case PageType.Mode:
UIManager.Instance.CloseWindow(WindowName, true);
break;
case PageType.LevelGroup:
ExitSelectLevelGroup();
break;
case PageType.Level:
ExitSelectLevel();
break;
}
}
@ -575,6 +580,7 @@ public class UI_LevelSelectController : UIWindow
UnRegisterSignal();
_currPage = PageType.Mode;
_cts.Cancel();
_cts.Dispose();
}
#endregion

View File

@ -92,6 +92,7 @@ public class ConfigWindow : EditorWindow
m_Configs.Add(ci);
}
m_Configs.Sort((a,b)=>a.Name.CompareTo(b.Name));
}
else
{