Unity3D 2018.1f2 在PlayerSetting-Editor 报错IndexOutOfRangeException: Array index is out of range

不知咋的,上个项目中能用的设定,在下一个项目想设置好但是就报错了Unity3D 2018.1f2 在PlayerSetting-Editor 报错IndexOutOfRangeException: Array index is out of range

而且在EditorSetting中明显少了很多。

然后各种搜索资料。就是找不到原因(可能是能力有限找不到)。然后就像是不是playerSetting中的EditorSettings.asset这个文件有问题,找到以前的好的工程。把这个东西退换,然后就可以了。真是神奇。

后来找来找去也找到一篇这样的文档

https://forum.unity.com/threads/reset-in-editor-settings-results-in-indexoutofrangeexception-and-breaks-version-control-on-windows.469858/

解决问题的方法都差不多。

Unity3D 2018.1f2 在PlayerSetting-Editor 报错IndexOutOfRangeException: Array index is out of range他是复制上面图片的

 

  1. %YAML 1.1

  2. %TAG !u! tag:unity3d.com,2011:

  3. --- !u!159 &1

  4. EditorSettings:

  5.   m_ObjectHideFlags: 0

  6.   serializedVersion: 1

  7.   m_ExternalVersionControlSupport: 1

  8.   m_SerializationMode: 2

  9.   m_WebSecurityEmulationEnabled: 0

  10.   m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d

复制替换到你的EditorSettings.asset文件中就可以了!

 

标记下,免得下次遇到同样的问题忘记了!