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

ProfileDatabase.CreateFilter

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

Declaration

public ProfileDeviceFilter CreateFilter(string vendor, string device, string brand, string product);

Description

Creates a new ProfileDeviceFilter targeting devices that match the specified criteria and adds it to the database.

All parameters accept regular expressions for flexible pattern matching. Pass an empty string for parameters you don't want to filter on. The parameter values are processed using logical AND to check if the device properties match all the specified values.

using UnityEditor;
using UnityEditor.Android;
using UnityEditor.HardwareProfiles;

public class ProfileSettings : AndroidHardwareProfiles { public override void DefineHardwareProfile(ProfileDatabase database) { // Target Google Pixel 6 devices var pixel6 = database.CreateFilter("", "", "((G|g)oogle)", "(oriole|raven|bluejay)"); pixel6.SetGraphicsAPI(GraphicsAPI.UseOpenGles); } }