Method ScheduleAddImageWithValidationJob
ScheduleAddImageWithValidationJob(MutableRuntimeReferenceImageLibrary, Texture2D, string, float?, JobHandle)
Asynchronously adds texture
to library
.
Declaration
public static AddReferenceImageJobState ScheduleAddImageWithValidationJob(this MutableRuntimeReferenceImageLibrary library, Texture2D texture, string name, float? widthInMeters, JobHandle inputDeps = default)
Parameters
Type | Name | Description |
---|---|---|
MutableRuntimeReferenceImageLibrary | library | The MutableRuntimeReferenceImageLibrary being extended. |
Texture2D | texture | The Texture2D to add to |
string | name | The name of the image. |
float? | widthInMeters | The physical width of the image, in meters. |
JobHandle | inputDeps | Input job dependencies (optional). |
Returns
Type | Description |
---|---|
AddReferenceImageJobState | Returns an AddReferenceImageJobState that you can use to query for job completion and whether the image was successfully added. If image validity can be determined, invalid images will be not be added. |
Remarks
The bytes of the texture
are copied, so the texture may be safely
destroyed after this method returns.
MonoBehaviour
's Start
> method as a coroutine and `yield` until the AR Session state is SessionTracking
.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if |
ArgumentNullException | Thrown if |
InvalidOperationException | Thrown if |