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); } }
Additional resources: ProfileDeviceFilter, Device filter hardware profile settings.