Documentation

Unity Engine

Download Unity

Unity Engine

GetTextureScale

Gets the placement scale of texture propertyName.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GetTextureScale(string)

Gets the placement scale of texture
propertyName
.
public Vector2 GetTextureScale(string name)

Parameters

name

The name of the property.

Returns

Type

Description

Vector2

Remarks

Common texture names used by the Universal Render Pipeline (URP) Lit shader:
"_BaseMap"
is the main texture. You can also access this with the Material.mainTextureScale property.
"_BumpMap"
is the normal map.
Additional Resources: Material.mainTextureScale property, Material.SetTextureScale.

GetTextureScale(int)

Gets the placement scale of texture
propertyName
.
public Vector2 GetTextureScale(int nameID)

Parameters

nameID

The name ID of the property retrieved by Shader.PropertyToID.

Returns

Type

Description

Vector2

Remarks

Common texture names used by the Universal Render Pipeline (URP) Lit shader:
"_BaseMap"
is the main texture. You can also access this with the Material.mainTextureScale property.
"_BumpMap"
is the normal map.
Additional Resources: Material.mainTextureScale property, Material.SetTextureScale.