기술 자료

Unity Engine

Unity Engine

GetTextureOffset

Gets the placement offset of texture propertyName.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

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

GetTextureOffset(string)

Gets the placement offset of texture propertyName.
public Vector2 GetTextureOffset(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.mainTextureOffset property.
"_BumpMap"
is the normal map.
"_Cube"
is the reflection cubemap.
Additional Resources: Material.mainTextureOffset property, Material.SetTextureOffset.

GetTextureOffset(int)

Gets the placement offset of texture propertyName.
public Vector2 GetTextureOffset(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.mainTextureOffset property.
"_BumpMap"
is the normal map.
"_Cube"
is the reflection cubemap.
Additional Resources: Material.mainTextureOffset property, Material.SetTextureOffset.