ObjectField() public static method

public static ObjectField ( string label, Object obj, Type objType, bool allowSceneObjects ) : Object
label string
obj Object
objType System.Type
allowSceneObjects bool
return Object
示例#1
0
        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;
            }
        }
示例#2
0
        private void ShowFace(string label, CubemapFace face)
        {
            Cubemap target = this.target as Cubemap;
            int     index  = (int)face;

            GUI.changed = false;
            Texture2D textureRef = (Texture2D)CubemapInspector.ObjectField(label, (UnityEngine.Object) this.m_Images[index], typeof(Texture2D), false);

            if (!GUI.changed)
            {
                return;
            }
            TextureUtil.CopyTextureIntoCubemapFace(textureRef, target, face);
            this.m_Images[index] = textureRef;
        }