CustomMaterialPreviewGenerator
public static class CustomMaterialPreviewGeneratorCustom preview generator for materials. Renders materials on primitive meshes (Sphere, Cube, Plane) with configurable lighting.
Methods
Section titled “Methods”
Create(string, int)
Section titled “Create(string, int)”public static Task<Texture2D> Create(string materialPath, int size = 128)Creates a preview texture for the material at the specified path.
Parameters
| Name | Type | Description |
|---|---|---|
materialPath |
System.String | Asset path to the material file. |
size |
System.Int32 | Target preview size in pixels. |
Returns
System.Threading.Tasks.Task{UnityEngine.Texture2D} — Preview texture, or null if generation failed.
Create(Material, int)
Section titled “Create(Material, int)”public static Task<Texture2D> Create(Material material, int size = 128)Creates a preview texture for the specified material object.
Parameters
| Name | Type | Description |
|---|---|---|
material |
UnityEngine.Material | Material to preview. |
size |
System.Int32 | Target preview size in pixels. |
Returns
System.Threading.Tasks.Task{UnityEngine.Texture2D} — Preview texture, or null if generation failed.