static private MiniThumbnailObjectField ( |
||
label | ||
obj | Object | |
objType | ||
validator | UnityEditor.EditorGUI | |
return | Object |
internal static Object MiniThumbnailObjectField(GUIContent label, Object obj, Type objType, EditorGUI.ObjectFieldValidator validator, params GUILayoutOption[] options)
{
Rect position = s_LastRect = GetControlRect(true, 16f, options);
return EditorGUI.MiniThumbnailObjectField(position, label, obj, objType, validator);
}
private void ShowDefaultTextures() { if (this.propertyNames.Count == 0) { return; } EditorGUILayout.LabelField("Default Maps", EditorStyles.boldLabel, new GUILayoutOption[0]); for (int i = 0; i < this.propertyNames.Count; i++) { Texture obj = this.textures[i]; Texture value = null; EditorGUI.BeginChangeCheck(); Type type; switch (this.dimensions[i]) { case ShaderUtil.ShaderPropertyTexDim.TexDim2D: type = typeof(Texture); break; case ShaderUtil.ShaderPropertyTexDim.TexDim3D: type = typeof(Texture3D); break; case ShaderUtil.ShaderPropertyTexDim.TexDimCUBE: type = typeof(Cubemap); break; case ShaderUtil.ShaderPropertyTexDim.TexDimAny: type = typeof(Texture); break; default: type = null; break; } if (type != null) { string t = (!string.IsNullOrEmpty(this.displayNames[i])) ? this.displayNames[i] : ObjectNames.NicifyVariableName(this.propertyNames[i]); value = (EditorGUILayout.MiniThumbnailObjectField(GUIContent.Temp(t), obj, type, null, new GUILayoutOption[0]) as Texture); } if (EditorGUI.EndChangeCheck()) { this.textures[i] = value; } } }