2024-05-17 19:27:02 +08:00
|
|
|
using Cysharp.Threading.Tasks;
|
2023-08-22 19:08:45 +08:00
|
|
|
using Framework;
|
|
|
|
|
using Gameplay;
|
2024-05-29 16:36:30 +08:00
|
|
|
using Gameplay.Guide;
|
2023-08-22 19:08:45 +08:00
|
|
|
using Gameplay.SubSystems;
|
2024-06-21 12:46:27 +08:00
|
|
|
using System;
|
2024-07-12 15:21:16 +08:00
|
|
|
using System.Runtime.CompilerServices;
|
2024-05-31 14:26:33 +08:00
|
|
|
#if SDK_TAPTAP
|
|
|
|
|
using PhxhSDK;
|
|
|
|
|
#endif
|
2023-08-22 19:08:45 +08:00
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
public class GameStateMainScene : IState
|
2023-08-22 19:08:45 +08:00
|
|
|
{
|
2024-06-21 12:46:27 +08:00
|
|
|
private Action callbackAction;
|
|
|
|
|
|
2024-07-12 15:21:16 +08:00
|
|
|
public bool IsLogin { get; }
|
|
|
|
|
|
|
|
|
|
public GameStateMainScene(bool isLogin = false, Action callback = null)
|
2024-06-21 12:46:27 +08:00
|
|
|
{
|
|
|
|
|
callbackAction = callback;
|
2024-07-12 15:21:16 +08:00
|
|
|
IsLogin = isLogin;
|
2024-06-21 12:46:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async void OnEnter()
|
2023-08-22 19:08:45 +08:00
|
|
|
{
|
2024-07-12 15:21:16 +08:00
|
|
|
E_LoadingType loadingType = IsLogin ? E_LoadingType.Login : E_LoadingType.CommonLoading;
|
2024-06-21 12:46:27 +08:00
|
|
|
if (null == callbackAction)
|
2024-07-12 15:21:16 +08:00
|
|
|
LoadingExecutorManager.Instance.ExecuteLoading(new MainSceneLoadingExecutor(loadingType)).Forget();
|
2024-06-21 12:46:27 +08:00
|
|
|
else
|
|
|
|
|
{
|
2024-07-12 15:21:16 +08:00
|
|
|
await LoadingExecutorManager.Instance.ExecuteLoading(new MainSceneLoadingExecutor(loadingType));
|
2024-06-21 12:46:27 +08:00
|
|
|
callbackAction.Invoke();
|
|
|
|
|
callbackAction = null;
|
|
|
|
|
}
|
2024-05-31 14:06:02 +08:00
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
#if SDK_TAPTAP
|
|
|
|
|
var antiAddictionService = SDKManager.Instance.GetSdkHelper(SDKManager.SdkName.TapTap) as IAntiAddictionService;
|
|
|
|
|
antiAddictionService?.AntiAddictionEnterGame();
|
|
|
|
|
#endif
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnUpdate(float deltaTime)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-22 12:46:45 +08:00
|
|
|
public void OnExit()
|
2023-08-22 19:08:45 +08:00
|
|
|
{
|
2024-04-10 16:20:58 +08:00
|
|
|
//CommonUtils.CloseUIWithScene(UINameConst.UI_MainPanel);
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
}
|