修改web平台资源加载问题
This commit is contained in:
parent
909d8d0f5b
commit
3de632f811
@ -7,10 +7,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace QFramework
|
||||
{
|
||||
public class ResSearchKeys : IPoolable,IPoolType
|
||||
public class ResSearchKeys : IPoolable, IPoolType
|
||||
{
|
||||
public string AssetName { get; set; }
|
||||
|
||||
@ -24,7 +25,20 @@ namespace QFramework
|
||||
public static ResSearchKeys Allocate(string assetName, string ownerBundleName = null, Type assetType = null)
|
||||
{
|
||||
var resSearchRule = SafeObjectPool<ResSearchKeys>.Instance.Allocate();
|
||||
|
||||
if (assetName.Contains("netimage:") ||
|
||||
assetName.Contains("localimage:") ||
|
||||
assetName.Contains("localaudio:") ||
|
||||
assetName.Contains("localtext:") ||
|
||||
assetName.Contains("localbytes:"))
|
||||
{
|
||||
// 暂时这样写死处理
|
||||
resSearchRule.AssetName = assetName;
|
||||
}
|
||||
else
|
||||
{
|
||||
resSearchRule.AssetName = assetName.ToLower();
|
||||
}
|
||||
resSearchRule.OwnerBundle = ownerBundleName == null ? null : ownerBundleName.ToLower();
|
||||
resSearchRule.AssetType = assetType;
|
||||
resSearchRule.OriginalAssetName = assetName;
|
||||
|
||||
@ -60,7 +60,6 @@ public class TimeLineAction : IAction
|
||||
|
||||
public void OnExecute(float dt)
|
||||
{
|
||||
Debug.LogError($"time:{play.time * fps} >= curEnd:{curEndFrame} ");
|
||||
if (curEndFrame != -1 && play.time * fps >= curEndFrame)
|
||||
{
|
||||
play.time = curEndFrame / 24;
|
||||
@ -69,7 +68,6 @@ public class TimeLineAction : IAction
|
||||
}
|
||||
if (play.state != PlayState.Playing)
|
||||
{
|
||||
Debug.LogError("Finished");
|
||||
Finished();
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport
|
||||
if (Directory.Exists(dataFolderPath))
|
||||
{
|
||||
// 目标目录强制小写
|
||||
string targetDataPath = Path.Combine(buildOutputPath, "data");
|
||||
string targetDataPath = Path.Combine(buildOutputPath, "Data");
|
||||
CopyDirectoryWithLowerCaseNames(dataFolderPath, targetDataPath);
|
||||
Debug.Log($"数据目录已复制到: {targetDataPath}");
|
||||
}
|
||||
@ -41,23 +41,25 @@ public class VirtualFPostProcess : IPostprocessBuildWithReport
|
||||
private void CopyDirectoryWithLowerCaseNames(string sourceDir, string targetDir)
|
||||
{
|
||||
// 创建小写目标目录
|
||||
var lowerTargetDir = ConvertToLowerPath(targetDir);
|
||||
Directory.CreateDirectory(lowerTargetDir);
|
||||
//var lowerTargetDir = ConvertToLowerPath(targetDir);
|
||||
Directory.CreateDirectory(targetDir);
|
||||
|
||||
// 复制文件(带小写转换)
|
||||
foreach (var file in Directory.GetFiles(sourceDir))
|
||||
{
|
||||
string fileName = Path.GetFileName(file);
|
||||
string lowerName = ConvertToLowerPath(fileName);
|
||||
File.Copy(file, Path.Combine(lowerTargetDir, lowerName), true);
|
||||
// 暂时废弃小写转换
|
||||
//string lowerName = ConvertToLowerPath(fileName);
|
||||
File.Copy(file, Path.Combine(targetDir, fileName), true);
|
||||
}
|
||||
|
||||
// 递归处理子目录(带小写转换)
|
||||
foreach (var dir in Directory.GetDirectories(sourceDir))
|
||||
{
|
||||
string dirName = Path.GetFileName(dir);
|
||||
string lowerDirName = ConvertToLowerPath(dirName);
|
||||
CopyDirectoryWithLowerCaseNames(dir, Path.Combine(lowerTargetDir, lowerDirName));
|
||||
// 暂时废弃小写转换
|
||||
//string lowerDirName = ConvertToLowerPath(dirName);
|
||||
CopyDirectoryWithLowerCaseNames(dir, Path.Combine(targetDir, dirName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user