TextureExtensions.Sample
Extension Method in TextureExtensions
Declaration
public static Color Sample(this Texture2D texture, float u, float v)
Parameters
texture | |
u | |
v |
Returns
Color |
Overload
Declaration
public static Color Sample(this Texture2D texture, Rect rect, Vector2 point)
Description
Gets the pixel color at the UV coordinates calculated from a point inside a rectangle.
Parameters
texture | The texture to sample from. |
rect | The rectangle to sample from. |
point | The point inside the rectangle. |
Returns
Color | The pixel color. |
Overload
Declaration
public static Color Sample(this Texture2D texture, Bounds bounds, Vector3 position)
Description
Gets the pixel color at the UV coordinates calculated from a position inside a bounds. The position uses the x and z axis.
Parameters
texture | The texture to sample from. |
bounds | The bounds to sample from. |
position | The position inside the bounds. |
Returns
Color | The pixel color. |