在Unity3d 自动打包过程中,如果是要提交到AppStore审核的,需要支持64位,就需要在PlayerSetting中选择 Scripting Backend 为IL2CPP。
Unity并没有提供一个明确的接口来设置ScriptingBackend,但是通过查询 PlayerSettings 的所有函数发现有一个属性设置公用接口可以使用。
在代码中可以通过设置属性来选择IL2CPP。
public static void SetPropertyInt(string name, int value);
public static void SetPropertyInt(string name, int value, BuildTarget target);
public static void SetPropertyInt(string name, int value, BuildTargetGroup target);
例如我这里设置为IL2CPP
using UnityEngine;
using System.Collections;
using UnityEditor;
public class NewBehaviourScript:EditorWindow
{
[MenuItem("MyTools/ChangeScript")]
static