C#脚本中,typeof(x)和.GetType()函数的区别
typeof(x)必须是具体的类名,类型名称不能是变量
.GetType()继承自object,是变量.GetType()
他们作用相同,返回type类型的当前对象类型
eg:
Texture a;
if(a.GetType()==typeof(Texture))
....
Unity GUI练习2
原文:http://www.cnblogs.com/lv-sally/p/4374895.html