using UnityEngine;
using System.Collections;
using UnityEditor;
public class Test : MonoBehaviour {
private int showShaderTexNum(Shader shader)
{
int propertynum = ShaderUtil.GetPropertyCount(shader);//获取shader属性个数
int count = 0;
for (int i = 0; i < propertynum; i++)
{
//遍历shader属性,如果为tex属性则COUNT++
if(ShaderUtil.GetPropertyType(shader,i) == ShaderUtil.ShaderPropertyType.TexEnv)
{
count++;
}
}
return count;
}
}
using System.Collections;
using UnityEditor;
public class Test : MonoBehaviour {
private int showShaderTexNum(Shader shader)
{
int propertynum = ShaderUtil.GetPropertyCount(shader);//获取shader属性个数
int count = 0;
for (int i = 0; i < propertynum; i++)
{
//遍历shader属性,如果为tex属性则COUNT++
if(ShaderUtil.GetPropertyType(shader,i) == ShaderUtil.ShaderPropertyType.TexEnv)
{
count++;
}
}
return count;
}
}