update space shooter
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UniFramework.Event;
|
||||
using UniFramework.Machine;
|
||||
using YooAsset;
|
||||
|
||||
internal class SceneBattle : MonoBehaviour
|
||||
@@ -37,18 +34,21 @@ internal class SceneBattle : MonoBehaviour
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
// 释放资源句柄
|
||||
if (_windowHandle != null)
|
||||
{
|
||||
_windowHandle.Release();
|
||||
_windowHandle = null;
|
||||
}
|
||||
|
||||
// 释放资源句柄
|
||||
if (_musicHandle != null)
|
||||
{
|
||||
_musicHandle.Release();
|
||||
_musicHandle = null;
|
||||
}
|
||||
|
||||
// 释放资源句柄
|
||||
if (_battleRoom != null)
|
||||
{
|
||||
_battleRoom.DestroyRoom();
|
||||
|
||||
@@ -8,26 +8,17 @@ public class SceneHome : MonoBehaviour
|
||||
public GameObject CanvasDesktop;
|
||||
private AssetHandle _windowHandle;
|
||||
|
||||
#if UNITY_WEBGL
|
||||
private IEnumerator Start()
|
||||
{
|
||||
// 同步加载登录页面
|
||||
{
|
||||
// 加载主页面
|
||||
_windowHandle = YooAssets.LoadAssetAsync<GameObject>("UIHome");
|
||||
yield return _windowHandle;
|
||||
_windowHandle.InstantiateSync(CanvasDesktop.transform);
|
||||
}
|
||||
#else
|
||||
private void Start()
|
||||
{
|
||||
// 异步加载登录页面
|
||||
_windowHandle = YooAssets.LoadAssetSync<GameObject>("UIHome");
|
||||
_windowHandle.InstantiateSync(CanvasDesktop.transform);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
// 释放资源句柄
|
||||
if (_windowHandle != null)
|
||||
{
|
||||
_windowHandle.Release();
|
||||
|
||||
Reference in New Issue
Block a user