【m】框架大更新

This commit is contained in:
2025-10-31 11:18:23 +08:00
parent ae6e7c804b
commit 8e1d52ddbf
1883 changed files with 213934 additions and 640 deletions

View File

@@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using YooAsset;
public class SceneHome : MonoBehaviour
{
public GameObject CanvasDesktop;
private AssetHandle _windowHandle;
private IEnumerator Start()
{
// 加载主页面
_windowHandle = YooAssets.LoadAssetAsync<GameObject>("UIHome");
yield return _windowHandle;
_windowHandle.InstantiateSync(CanvasDesktop.transform);
// 切换场景的时候释放资源
var package = YooAssets.GetPackage("DefaultPackage");
var operation = package.UnloadUnusedAssetsAsync();
yield return operation;
}
private void OnDestroy()
{
// 释放资源句柄
if (_windowHandle != null)
{
_windowHandle.Release();
_windowHandle = null;
}
}
}