[fix] 修复调用Data目录为Data~目录后读取资源文件失败的bug

main
walon 2022-09-26 13:30:07 +08:00
parent 3440f79421
commit 07b56fe7e5
3 changed files with 3 additions and 5 deletions

View File

@ -38,7 +38,7 @@ namespace HybridCLR.Editor.Commands
case PlatformABI.Arm64: tplFile = "Arm64"; break;
default: throw new NotSupportedException();
};
return AssetDatabase.LoadAssetAtPath<TextAsset>($"{SettingsUtil.TemplatePathInPackage}/MethodBridge_{tplFile}.cpp.txt").text;
return File.ReadAllText($"{SettingsUtil.TemplatePathInPackage}/MethodBridge_{tplFile}.cpp.txt");
}
private static void GenerateMethodBridgeCppFile(Analyzer analyzer, PlatformABI platform, string templateCode, string outputFile)

View File

@ -20,7 +20,7 @@ namespace HybridCLR.Editor.Commands
public static void GenerateReversePInvokeWrapper()
{
string ReversePInvokeWrapperStubFile = $"{SettingsUtil.LocalIl2CppDir}/libil2cpp/hybridclr/metadata/ReversePInvokeMethodStub.cpp";
string wrapperTemplateStr = AssetDatabase.LoadAssetAtPath<TextAsset>($"{SettingsUtil.TemplatePathInPackage}/ReversePInvokeMethodStub.cpp.txt").text;
string wrapperTemplateStr = File.ReadAllText($"{SettingsUtil.TemplatePathInPackage}/ReversePInvokeMethodStub.cpp.txt");
int wrapperCount = SettingsUtil.GlobalSettings.ReversePInvokeWrapperCount;
var generator = new Generator();
generator.Generate(wrapperTemplateStr, wrapperCount,ReversePInvokeWrapperStubFile);

View File

@ -1,9 +1,7 @@
{
"name": "HybridCLR.Editor",
"rootNamespace": "",
"references": [
"UnityFS"
],
"references": [],
"includePlatforms": [
"Editor"
],