Unity3D技术之监听平台切换完毕的事件实现起来很简单。EditorUserBuildSettings.SwitchActiveBuildTarget可以用脚本来切换平台。。EditorUserBuildSettings.activeBuildTargetChanged 可以监听平台切换的事件。
[MenuItem(\"Tools/ActiveBuildTarget\", false, 1)]
static public void ActiveBuildTarget()
{
EditorUserBuildSettings.activeBuildTargetChanged = delegate() {
if(EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android){
Debug.Log(\"DoSomeThings\");
}
};
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTarget.Android);
}