24 lines
819 B
C#
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);
|
|
}
|
|
}
|