Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BindVariant

Adds a file variant selected by device requirements and returns the same instance for method chaining.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor.iOS
  • Assembly: UnityEditor.Apple.Extensions.Common

BindVariant(string, iOSDeviceRequirement)

Adds a file variant selected by device requirements and returns the same instance for method chaining.
public Resource BindVariant(string path, iOSDeviceRequirement requirement)

Parameters

path

Path to the source file for this variant.

Device requirements that select this variant at download time.

Returns

Type

Description

ResourceThe resulting Resource instance after the operation.

Remarks

Use this overload to select a variant based on hardware capabilities such as memory or graphics tier. Call this method multiple times to register variants for different device profiles. This method throws an exception if called on a resource created with a source file path.

BindVariant(string, string)

Adds a file variant selected by named extension and returns the same instance for method chaining.
public Resource BindVariant(string path, string name)

Parameters

path

Path to the source file for this variant.

name

Variant name matching a file extension configured in Player Settings > iOS > On Demand Resources.

Returns

Type

Description

ResourceThe resulting Resource instance after the operation.

Remarks

Use this overload to select a variant by a named file extension whose device requirements you configure separately in Player Settings > iOS > On Demand Resources. Call this method multiple times to register variants for different configurations. This method throws an exception if called on a resource created with a source file path.