原生资源热更加载测试

main
yurui 2024-08-02 18:18:15 +08:00
parent df31944038
commit 0b76781979
3 changed files with 21 additions and 5 deletions

View File

@ -583,6 +583,19 @@ MonoBehaviour:
FilterRuleName: CollectAll
AssetTags:
UserData:
- GroupName: Criware
GroupDesc:
AssetTags:
ActiveRuleName: EnableGroup
Collectors:
- CollectPath: Assets/Audio/Music
CollectorGUID: ae16d689a4bed45699e4a0e9adbeaa6c
CollectorType: 0
AddressRuleName: AddressByFileName
PackRuleName: PackRawFile
FilterRuleName: CollectAll
AssetTags:
UserData:
- PackageName: TestPackage
PackageDesc:
EnableAddressable: 0

View File

@ -1,8 +1,6 @@
using Cysharp.Threading.Tasks;
using Gameplay.SubSystems;
using Gameplay;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
@ -11,7 +9,6 @@ using System;
using System.Text;
using PhxhSDK;
using YooAsset;
using Gameplay.Performance;
using System.IO;
public class UI_LoadingProgressInterfaceController : UIWindow
@ -139,11 +136,13 @@ public class UI_LoadingProgressInterfaceController : UIWindow
OnLoadingUIEnd = null;
}
string mp4Path;
#if UNITY_EDITOR
RawFileHandle rawFileHandle = AssetManager.Instance.LoadRawFileAsync(LOADING_VIDEO);
await rawFileHandle;
string realPath = rawFileHandle.GetRawFilePath();
DebugUtil.Log($"获取到真实路径: {realPath}");
string mp4Path = realPath;
mp4Path = realPath;
if (!mp4Path.EndsWith(".mp4"))
mp4Path += ".mp4";
@ -152,6 +151,10 @@ public class UI_LoadingProgressInterfaceController : UIWindow
DebugUtil.Log("文件不存在复制一份到mp4Path");
File.Copy(realPath, mp4Path);
}
#else
mp4Path = Path.Combine(Application.streamingAssetsPath, $"Yoo/RawPackage/{LOADING_VIDEO}");
DebugUtil.Log($"streamingAssetsPath地址加载视频路径:{mp4Path}"); // 测试新的原生资源热更和加载
#endif
audioSource.volume = AudioManager.Instance.GlobalMusicVolume;
videoPlayer.url = mp4Path;

@ -1 +1 @@
Subproject commit 998cbfaa4860ed8613b83e50f1970f591ae79eee
Subproject commit d241b54db551a9ea679a4b27b83935cb465992ae