标题:
https://github.com/egametang/ET/issues/463
FileRegionReplace.cs 第53行的 ReplaceRegion 方法中做了一下print * public static string ReplaceRegion(string resultText, string region, string replaceContent) { Debug.Log("region: " + region); Debug.Log("resultText: " + resultText); Debug.Log("replaceContent: " + replaceContent); int startIndex = resultText.IndexOf("//!!!{{" + region); if (startIndex == -1) { throw new Exception($"region:{region} start not find"); }
FileRegionReplace.cs
ReplaceRegion
public static string ReplaceRegion(string resultText, string region, string replaceContent)
{
Debug.Log("region: " + region);
Debug.Log("resultText: " + resultText);
Debug.Log("replaceContent: " + replaceContent);
int startIndex = resultText.IndexOf("//!!!{{" + region);
if (startIndex == -1)
throw new Exception($"region:{region} start not find");
}
结果如下:
region: UNITY_VERSION
resultText: #pragma once
#include <string.h>
#include "hybridclr/generated/UnityVersion.h"
/* first setup platform defines*/
#include "os/c-api/il2cpp-config-platforms.h"
#include "os/c-api/il2cpp-config-api-platforms.h"
#include "il2cpp-config-api.h"
#include "il2cpp-sanitizers.h"
#ifdef LIBIL2CPP_EXPORT_CODEGEN_API
# define LIBIL2CPP_CODEGEN_API IL2CPP_EXPORT
#elif LIBIL2CPP_IMPORT_CODEGEN_API
# define LIBIL2CPP_CODEGEN_API IL2CPP_IMPORT
#else
# define LIBIL2CPP_CODEGEN_API 等
也就是ET\Unity\HybridCLRData\LocalIl2CppData-WindowsEditor\il2cpp\libil2cpp\il2cpp-config.h这个文件里的所有内容。
ET\Unity\HybridCLRData\LocalIl2CppData-WindowsEditor\il2cpp\libil2cpp\il2cpp-config.h
replaceContent: #define HYBRIDCLR_UNITY_VERSION 20210316
#define HYBRIDCLR_UNITY_2021 1
#define HYBRIDCLR_UNITY_2019_OR_NEW 1
#define HYBRIDCLR_UNITY_2020_OR_NEW 1
#define HYBRIDCLR_UNITY_2021_OR_NEW 1
我看方法中尝试对 resultText 做 //!!!{{ 模式的匹配,那肯定是匹配不到的。
resultText
//!!!{{
不知该如何解决这个问题。
感谢!
https://hybridclr.doc.code-philosophy.com/#/basic/install?id=%e5%a6%82%e6%9e%9c%e4%bd%a0%e7%9a%84%e7%89%88%e6%9c%ac-gt-v205
官网文档看看
Scorpio 感谢QAQ
设置
hybirdclr = v2.0.1
il2cpp_plus = v2021-2.0.1
后重新install再做generate,神奇的成功了。。
nidhogg Unity版本是2021.3.16f1c1
不行,换成2.0.1以后,出现:Exception: region:UNITY_VERSION start not find
并且使用main 和 2021-main 也是这个问题