Update YooAssetDriver
在游戏对象销毁的时候释放YooAssets
This commit is contained in:
@@ -9,6 +9,11 @@ namespace YooAsset
|
|||||||
YooAssets.InternalUpdate();
|
YooAssets.InternalUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnDestroy()
|
||||||
|
{
|
||||||
|
YooAssets.InternalDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
void OnApplicationQuit()
|
void OnApplicationQuit()
|
||||||
{
|
{
|
||||||
YooAssets.InternalDestroy();
|
YooAssets.InternalDestroy();
|
||||||
|
|||||||
@@ -1071,6 +1071,8 @@ namespace YooAsset
|
|||||||
|
|
||||||
#region 内部方法
|
#region 内部方法
|
||||||
internal static void InternalDestroy()
|
internal static void InternalDestroy()
|
||||||
|
{
|
||||||
|
if (_isInitialize)
|
||||||
{
|
{
|
||||||
_isInitialize = false;
|
_isInitialize = false;
|
||||||
_initializeError = string.Empty;
|
_initializeError = string.Empty;
|
||||||
@@ -1088,6 +1090,7 @@ namespace YooAsset
|
|||||||
AssetSystem.DestroyAll();
|
AssetSystem.DestroyAll();
|
||||||
YooLogger.Log("YooAssets destroy all !");
|
YooLogger.Log("YooAssets destroy all !");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
internal static void InternalUpdate()
|
internal static void InternalUpdate()
|
||||||
{
|
{
|
||||||
OperationSystem.Update();
|
OperationSystem.Update();
|
||||||
@@ -1136,7 +1139,7 @@ namespace YooAsset
|
|||||||
private static void DebugCheckUpdateManifest()
|
private static void DebugCheckUpdateManifest()
|
||||||
{
|
{
|
||||||
var loadedBundleInfos = AssetSystem.GetLoadedBundleInfos();
|
var loadedBundleInfos = AssetSystem.GetLoadedBundleInfos();
|
||||||
if(loadedBundleInfos.Count > 0)
|
if (loadedBundleInfos.Count > 0)
|
||||||
{
|
{
|
||||||
YooLogger.Warning($"Found loaded bundle before update manifest ! Recommended to call the {nameof(ForceUnloadAllAssets)} method to release loaded bundle !");
|
YooLogger.Warning($"Found loaded bundle before update manifest ! Recommended to call the {nameof(ForceUnloadAllAssets)} method to release loaded bundle !");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user