update space shooter

This commit is contained in:
何冠峰
2024-12-31 15:13:13 +08:00
parent 4370ed544f
commit d1d6e023c4
234 changed files with 1727 additions and 5047 deletions
@@ -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();