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

26 lines
767 B
C#

using Cysharp.Threading.Tasks;
using Framework;
using PhxhSDK;
namespace Gameplay.SubSystems
{
public class LoadingExecutorManager : Singlenton<LoadingExecutorManager>
{
private LoadingExecutor _currentloadingExecutor;
public async UniTask ExecuteLoading(LoadingExecutor executer)
{
if (executer == null)
return;
if (_currentloadingExecutor != null && _currentloadingExecutor.IsExcuting())
return;
_currentloadingExecutor = executer;
await _currentloadingExecutor.Excute();
EventManager.Instance.Send(EventManager.EventName.GuideLoadingExecutor);
}
public LoadingExecutor CurrentExcutor => _currentloadingExecutor;
}
}