Files
back_cantanBuilding/Assets/Scripts/Scenes/SceneTools.cs
2026-05-26 16:15:54 +08:00

24 lines
819 B
C#

using GameCore;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
public class SceneTools
{
public static AsyncOperationHandle<SceneInstance> asyncOperationHandle;
public static AsyncOperationHandle<SceneInstance> LoadSceneAsyncByAddressables(string key, LoadSceneMode loadMode)
{
return Addressables.LoadSceneAsync(key, loadMode);
}
public static AsyncOperationHandle<SceneInstance> UnloadSceneAsyncByAddressables(AsyncOperationHandle<SceneInstance> handle, bool autoReleaseHandle = true)
{
return Addressables.UnloadSceneAsync(handle, autoReleaseHandle);
}
}