2024-03-06 11:02:34 +08:00
|
|
|
#if UNITY_WEBGL || WEIXINMINIGAME || UNITY_EDITOR
|
2024-02-21 17:48:18 +08:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using WeChatWASM;
|
|
|
|
|
|
|
|
|
|
internal class CheckFrame : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
private int frameCnt = 0;
|
|
|
|
|
|
|
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
frameCnt++;
|
|
|
|
|
if (frameCnt == 2)
|
|
|
|
|
{
|
2024-03-06 11:02:34 +08:00
|
|
|
#if (UNITY_WEBGL || WEIXINMINIGAME) && !UNITY_EDITOR
|
2024-02-21 17:48:18 +08:00
|
|
|
WXSDKManagerHandler.Instance.HideLoadingPage();
|
|
|
|
|
#endif
|
|
|
|
|
Destroy(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal class HideLoadingPage : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
|
|
|
|
private static void OnGameLaunch()
|
|
|
|
|
{
|
|
|
|
|
var gameObject = new GameObject("HideLoadingPage");
|
|
|
|
|
gameObject.AddComponent<CheckFrame>();
|
|
|
|
|
DontDestroyOnLoad(gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|