Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetTexture(Texture2D, int)

Assign a texture to the specified layer.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public void SetTexture(Texture2D texture, int layer = 0)

Parameters

texture

The texture to assign.

layer

Cannot be larger than PlatformIcon.maxLayerCount.

Remarks

Texture file must be stored in the project and instance obtained using AssetDatabase.LoadAssetAtPath.