Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetTexture

Sets the value of a named texture property.
Read time 1 minuteLast updated 6 days ago

Definition

SetTexture(int, Texture)

Sets the value of a named texture property.
public void SetTexture(int nameID, Texture t)

Parameters

nameID

The ID of the property. This is the same ID that Shader.PropertyToID returns.

The new texture value.

Remarks

Automatically changes overridden state for this property to true. If the provided texture dimension doesn't correspond to the expected dimension, this function can log an error. If that happens, this assignment is ignored.

SetTexture(string, Texture)

Sets the value of a named texture property.
public void SetTexture(string name, Texture t)

Parameters

name

The name of the property.

The new texture value.

Remarks

Automatically changes overridden state for this property to true. If the provided texture dimension doesn't correspond to the expected dimension, this function can log an error. If that happens, this assignment is ignored.