3D播放器IL2CPP构建

1. 将U3D工程构建方式改成IL2CPP,需要安装配套的组件,若没有安装一下IL2CPP模块

示例:

<?xml version="1.0" encoding="UTF-8"?>
<linker>
  <assembly fullname="NXLua" preserve="all" />
  <assembly fullname="Assembly-CSharp" preserve="all" />
</linker>

3. 编译过程错误解决

3.1 RichText.dll报错

IL2CPP error for method 'System.Void RichText.RTLInputField::OnValidate()' in assembly 'C:\WorkProject\VLabAllProject\Applications\3d_labplayer\U3DProject\Temp\StagingArea\Data\Managed\RichText.dll'

解决方案:找李洋云要支持IL2CPP的富文本RichText.dll

3.2 VLabGeneralAbility报错

IL2CPP error for method 'System.Void VLabGeneralAbility.ForceDrawer.ForceLabelItem::SetText(System.String)' in assembly 'C:\WorkProject\VLabAllProject\Applications\3d_labplayer\U3DProject\Temp\StagingArea\Data\Managed\VLabGeneralAbility.dll

解决方案:先临时注释掉

3.3 VLabUI2.dll报错

InputField.OnValidate()函数报错

解决方案:先临时注释掉

3.4 Dotween46.dll

DOFade()函数报错

解决方案:删掉Dotween46.dll

3.5 Newtonsoft.Json.dll

运行时报动态反射报错

解决方案:需要找定制版的支持IL2CPP的Newtonsoft.Json.dll