Version: 2023.2

AndroidArchitecture

enumeration

切换到手册

描述

Android CPU 架构。

using UnityEditor.Build;
using UnityEditor;
using UnityEngine;
public class AndroidArchitectureExample : MonoBehaviour
{
    [MenuItem("Build/Android Architectures Example")]
    public static void AndroidArchitectures()
    {
        PlayerSettings.SetScriptingBackend(NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
        //Set the targetArchitecture to ARM64 AndroidAchitecture
        PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
        BuildPlayerOptions options = new BuildPlayerOptions();
        options.scenes = new[] { "Assets/Scenes/SampleScene.unity" };
        options.locationPathName = "Builds/AndroidBuild.apk";
        options.target = BuildTarget.Android;
        options.targetGroup = BuildTargetGroup.Android;
        BuildPipeline.BuildPlayer(options);
    }
}

变量

None无效的架构。
ARMv732 位 ARM 架构。
ARM6464 位 ARM 架构。
X8632 位 Intel 架构。
X86_6464-bit Intel architecture.
All所有架构。