Closed MonoLogueChi closed 3 months ago
Assets 目录下的 csc.rsp 也会影响到 upm 包安装的插件,可能会导致编译错误。
如使用 C# 11 时会导致 Loxodon Framework TextMeshPro 错误
Library\PackageCache\com.vovgou.loxodon-framework-textformatting@2.6.4\Runtime\Framework\TextFormatting\DateTimeFormat.cs(1177,26): error CS8347: Cannot use a result of 'DateTimeFormat.ExpandPredefinedFormat(ReadOnlySpan<char>, ref DateTime, ref DateTimeFormatInfo, ref TimeSpan)' in this context because it may expose variables referenced by parameter 'dateTime' outside of their declaration scope Library\PackageCache\com.vovgou.loxodon-framework-textformatting@2.6.4\Runtime\Framework\TextFormatting\DateTimeFormat.cs(1177,61): error CS8166: Cannot return a parameter by reference 'dateTime' because it is not a ref parameter
在 C# 9 或 10 语法是允许的,11中不允许。
示例可见
你使用的Unity版本是哪个版本?我测试一下!
你使用的Unity版本是哪个版本?我测试一下!
2022.3.27f1,理论上 2022.3.12 以后的版本都可以
你使用的Unity版本是哪个版本?我测试一下!
2022.3.27f1,理论上 2022.3.12 以后的版本都可以
我测试了下,我在com.vovgou.loxodon-framework-textformatting@2.6.4中配置csc.rsp 的版本为9.0无效啊。 你可以试试,你将 com.vovgou.loxodon-framework-textformatting@2.6.4从Library/PackageCache 目录下拷贝到 /Packages/ 目录下,变成一个本地的upm包,就可以编辑了。你在里面添加csc.rsp看看,如果有效你可以这样解决这个问题。
我测试了下,我在com.vovgou.loxodon-framework-textformatting@2.6.4中配置csc.rsp 的版本为9.0无效啊。 你可以试试,你将 com.vovgou.loxodon-framework-textformatting@2.6.4从Library/PackageCache 目录下拷贝到 /Packages/ 目录下,变成一个本地的upm包,就可以编辑了。你在里面添加csc.rsp看看,如果有效你可以这样解决这个问题。
我已经解决了,解包com.vovgou.loxodon-framework-textformatting@2.6.4,添加csc.rsp后再打包,使用本地包
Assets 目录下的 csc.rsp 也会影响到 upm 包安装的插件,可能会导致编译错误。
如使用 C# 11 时会导致 Loxodon Framework TextMeshPro 错误
在 C# 9 或 10 语法是允许的,11中不允许。
示例可见
https://github.com/MonoLogueChi/LoxodonFrameworkCscBug.git