CopyTextureIntoCubemapFace() 개인적인 메소드

private CopyTextureIntoCubemapFace ( Texture2D textureRef, Cubemap cubemapRef, CubemapFace face ) : void
textureRef UnityEngine.Texture2D
cubemapRef UnityEngine.Cubemap
face CubemapFace
리턴 void
예제 #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)ObjectField(label, this.m_Images[index], typeof(Texture2D), false, new GUILayoutOption[0]);

            if (GUI.changed)
            {
                TextureUtil.CopyTextureIntoCubemapFace(textureRef, target, face);
                this.m_Images[index] = textureRef;
            }
        }
예제 #3
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;
        }
        private void ShowFace(string label, CubemapFace face)
        {
            var c     = target as Cubemap;
            var iface = (int)face;

            GUI.changed = false;

            var tex = (Texture2D)ObjectField(label, m_Images[iface], typeof(Texture2D), false);

            if (GUI.changed)
            {
                TextureUtil.CopyTextureIntoCubemapFace(tex, c, face);
                // enable this line in order to retain connections from cube faces to their corresponding
                // texture2D assets, this allows auto-update functionality when editing the source texture
                // images
                //TextureUtil.SetSourceTexture(c, face, tex);
                m_Images[iface] = tex;
            }
        }