Exemple #1
0
        void UpdateTexture()
        {
            List <bool> lOldValues = LinearizeTextures(textures);

            TextureOperator.UpdateTexture(textures, resultSize, ref resultTexture, ref previewTexture, interpolationMethod, effects);
            OriginalizeTextures(textures, lOldValues);
        }
Exemple #2
0
        void DrawTextureBox(int textureID, float width, float height)
        {
            GUILayout.BeginHorizontal(EditorStyles.miniButtonRight, GUILayout.Width(width), GUILayout.Height(height));
            GUILayout.BeginVertical();
            GUILayout.Space(3f);
            textures[textureID] = (Texture2D)EditorGUILayout.ObjectField(textures[textureID], typeof(Texture2D), false, GUILayout.Width(height - 8f), GUILayout.Height(height - 8f));
            GUILayout.EndVertical();
            GUILayout.BeginVertical(GUILayout.Width(width - height - 16f));
            GUILayout.Space(3f);
            GUILayout.Label(!textures[textureID] ? "" : textures[textureID].name, GUILayout.Width(width - height - 16f));
            GUILayout.Label(!textures[textureID] ? "" : "From: " + textures[textureID].width + "x" + textures[textureID].height, GUILayout.Width(width - height - 16f));
            GUILayout.Label(!textures[textureID] ? "" : "To: " + TextureOperator.RoundToBinary(textures[textureID].width) + "x" + TextureOperator.RoundToBinary(textures[textureID].width), GUILayout.Width(width - height - 16f));
            GUILayout.Space(-1f);
            Color lOld = GUI.backgroundColor;

            GUI.backgroundColor = Color.red;
            if (GUILayout.Button("Remove", GUILayout.Width(width - height - 16f)))
            {
                delTexture = textureID;
            }
            GUI.backgroundColor = lOld;
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
        }