Version: Unity 6.6 Alpha (6000.6)
LanguageEnglish
  • C#

AndroidHardwareProfiles

class in UnityEditor.Android

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

An abstract class for defining Vulkan hardware profiles that Unity includes in Android builds.

Inherit from this class to define device-specific Vulkan hardware profiles for Android. At build time, Unity calls AndroidHardwareProfiles.DefineHardwareProfile to collect your profile configuration, then serializes it into a Profile.json file in the application's assets.

At runtime, Unity uses these profiles to configure graphics API selection, driver workarounds, and graphics jobs settings based on the device hardware.

Note: You can't use Vulkan hardware profiles and Vulkan Device Filtering Assets at the same time. When both exist, hardware profiles take precedence.

For more information, refer to Vulkan hardware profiles.

using UnityEditor.Android;
using UnityEditor.HardwareProfiles;

public class MyHardwareProfiles : AndroidHardwareProfiles { public override void DefineHardwareProfile(ProfileDatabase database) { // Configure the default filter for all devices var defaultFilter = database.GetDefaultFilter(); defaultFilter.SetGraphicsAPI(GraphicsAPI.UseVulkan);

// Target specific devices var pixel6 = database.CreateFilter("", "", "((G|g)oogle)", "(oriole|raven|bluejay)"); pixel6.SetGraphicsAPI(GraphicsAPI.UseOpenGles); } }

Public Methods

Method Description
DefineHardwareProfileImplement this method to configure Vulkan hardware profiles for the Android build.
IsEnabledOverride this method to control whether Unity uses this hardware profile during the Android build.