NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/SubSystems/LoadingExecutorManager.cs

25 lines
682 B
C#
Raw Normal View History

2024-04-22 16:52:21 +08:00
using Cysharp.Threading.Tasks;
2023-08-22 19:08:45 +08:00
using Framework;
2023-10-19 15:00:19 +08:00
using PhxhSDK;
2023-08-22 19:08:45 +08:00
namespace Gameplay.SubSystems
{
2023-10-19 15:00:19 +08:00
public class LoadingExecutorManager : Singlenton<LoadingExecutorManager>
2023-08-22 19:08:45 +08:00
{
private LoadingExecutor _currentloadingExecutor;
2024-04-22 16:52:21 +08:00
public async UniTask ExecuteLoading(LoadingExecutor executer)
2023-08-22 19:08:45 +08:00
{
if (executer == null)
return;
2024-04-22 16:52:21 +08:00
2023-08-22 19:08:45 +08:00
if (_currentloadingExecutor != null && _currentloadingExecutor.IsExcuting())
return;
_currentloadingExecutor = executer;
2024-04-22 16:52:21 +08:00
await _currentloadingExecutor.Excute();
2023-08-22 19:08:45 +08:00
}
public LoadingExecutor CurrentExcutor => _currentloadingExecutor;
}
}