Version: Unity 6.5 (6000.5)
LanguageEnglish
  • C#

Resource.BindVariant

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 Resource BindVariant(string path, iOSDeviceRequirement requirement);

Parameters

Parameter Description
path Path to the source file for this variant.
requirement Device requirements that select this variant at download time.

Returns

Resource The resulting Resource instance after the operation.

Description

Adds a file variant selected by device requirements and returns the same instance for method chaining.

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.


Declaration

public Resource BindVariant(string path, string name);

Parameters

Parameter Description
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

Resource The resulting Resource instance after the operation.

Description

Adds a file variant selected by named extension and returns the same instance for method chaining.

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.