当迩使用一个int[]或者string[]类似的数组时,以数组来初始化List对象,有可能在IOS平台上会出现初始化对象为空,比如

int[] test = {1, 2};
List<int> listTest = new List<int>(test);

千万不要在UNITY这样做,在IOS平台会有可能无法将int[]数组的内容完整的复制到List<int>对象中,我们可以使用add方法自己一个一个手动加进去,这样最保险

相关文章:

  • 2021-11-03
  • 2021-08-30
  • 2021-08-04
  • 2022-01-10
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案