public static ObjectField ( string label, Object obj, |
||
label | string | |
obj | Object | |
objType | ||
allowSceneObjects | bool | |
Результат | Object |
public static Object ObjectField(string label, Object obj, Type objType, bool allowSceneObjects, params GUILayoutOption[] options)
{
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayoutOption[] optionArray1 = new GUILayoutOption[] { GUILayout.ExpandWidth(false) };
GUI.Label(GUILayoutUtility.GetRect(EditorGUIUtility.labelWidth, 32f, EditorStyles.label, optionArray1), label, EditorStyles.label);
GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(64f) };
Object obj2 = EditorGUI.ObjectField(GUILayoutUtility.GetAspectRect(1f, EditorStyles.objectField, optionArray2), obj, objType, allowSceneObjects);
GUILayout.EndHorizontal();
return obj2;
}
private void ShowFace(string label, CubemapFace face) { Cubemap cubemapRef = base.target as Cubemap; GUI.changed = false; Texture2D texture2D = (Texture2D)CubemapInspector.ObjectField(label, this.m_Images[(int)face], typeof(Texture2D), false, new GUILayoutOption[0]); if (GUI.changed) { TextureUtil.CopyTextureIntoCubemapFace(texture2D, cubemapRef, face); this.m_Images[(int)face] = texture2D; } }