Struct ARExternalTexture
Represents an external texture on the GPU.
Implements
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: Unity.XR.ARFoundation.dll
Syntax
public readonly struct ARExternalTexture : IEquatable<ARExternalTexture>
Constructors
ARExternalTexture(Texture, int)
Constructor.
Declaration
public ARExternalTexture(Texture texture, int propertyId)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture | texture | The texture. |
| int | propertyId | The texture's property ID. |
Properties
propertyId
ID of the shader property associated with this texture.
Declaration
public int propertyId { get; }
Property Value
| Type | Description |
|---|---|
| int |
See Also
texture
The external texture.
Declaration
public Texture texture { get; }
Property Value
| Type | Description |
|---|---|
| Texture |
Remarks
This texture may only exist on the GPU. Refer to your provider documentation for more information.
If this is a GPU texture, to use the texture on the CPU, you must read it back from the GPU using Texture2D.ReadPixels.
Methods
Equals(object)
Indicates whether the current object is equal to another object of the same type. Textures are compared using reference equality.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to |
Overrides
Equals(ARExternalTexture)
Indicates whether the current object is equal to another object of the same type. Textures are compared using reference equality.
Declaration
public bool Equals(ARExternalTexture other)
Parameters
| Type | Name | Description |
|---|---|---|
| ARExternalTexture | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The string. |
Overrides
Operators
operator ==(ARExternalTexture, ARExternalTexture)
Tests for equality. Equivalent to Equals(ARExternalTexture).
Declaration
public static bool operator ==(ARExternalTexture lhs, ARExternalTexture rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| ARExternalTexture | lhs | The left-hand side of the comparison. |
| ARExternalTexture | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(ARExternalTexture, ARExternalTexture)
Tests for inequality. Equivalent to !Equals(AROcclusionFrameEventArgs).
Declaration
public static bool operator !=(ARExternalTexture lhs, ARExternalTexture rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| ARExternalTexture | lhs | The left-hand side of the comparison. |
| ARExternalTexture | rhs | The right-hand side of the comparison. |
Returns
| Type | Description |
|---|---|
| bool |