文档

Unity Engine

Unity Engine

GetTextureScale

Gets the placement scale of texture propertyName.
阅读时间1 分钟最后更新于 1 个月前

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 Unity's builtin shaders:
"_MainTex"
is the main diffuse texture. This can also be accessed via Material.mainTextureScale property.
"_BumpMap"
is the normal map.
"_Cube"
is the reflection cubemap.
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 Unity's builtin shaders:
"_MainTex"
is the main diffuse texture. This can also be accessed via Material.mainTextureScale property.
"_BumpMap"
is the normal map.
"_Cube"
is the reflection cubemap.
Additional Resources: Material.mainTextureScale property, Material.SetTextureScale.