Skip to content

Instantly share code, notes, and snippets.

@sugi-cho
sugi-cho / ShowMaterialEditor.cs
Last active July 16, 2021 18:59
show material's property in inspector in Unity use this function in Custom Editor Class.
void ShowMaterialEditor(Material[] ms){
for(int i = 0; i < ms.Length; i++){
Material m = ms[i];
if(m == null)
return;
Shader s = m.shader;
EditorGUILayout.LabelField(m.name);
EditorGUI.indentLevel++;
for(int j = 0; j < ShaderUtil.GetPropertyCount(s); j++){