├── .gitignore
├── Editor.meta
├── Editor
├── Resources.meta
├── Resources
│ ├── UnityTextureRgbPacker.uss
│ ├── UnityTextureRgbPacker.uss.meta
│ ├── UnityTextureRgbPacker.uxml
│ └── UnityTextureRgbPacker.uxml.meta
├── UnityTextureRgbPackerEditorWindow.cs
└── UnityTextureRgbPackerEditorWindow.cs.meta
├── LICENSE
├── LICENSE.meta
├── README.md
├── README.md.meta
├── SampleAssets.meta
├── SampleAssets
├── Env_Athens_Ext_Ground_Tile_AO.tga
├── Env_Athens_Ext_Ground_Tile_AO.tga.meta
├── Env_Athens_Ext_Ground_Tile_Mask.tga
├── Env_Athens_Ext_Ground_Tile_Mask.tga.meta
├── Env_Athens_Ext_Ground_Tile_Metallic.tga
├── Env_Athens_Ext_Ground_Tile_Metallic.tga.meta
├── Env_Athens_Ext_Ground_Tile_Roughness.tga
└── Env_Athens_Ext_Ground_Tile_Roughness.tga.meta
├── Screenshots.meta
├── Screenshots
├── UnityTextureRgbPacker.png
├── UnityTextureRgbPacker.png.meta
├── UnityTextureRgbPackerUsage.gif
└── UnityTextureRgbPackerUsage.gif.meta
├── StringUtilities.cs
├── StringUtilities.cs.meta
├── TexturePacker.cs
├── TexturePacker.cs.meta
├── TextureUtilities.cs
├── TextureUtilities.cs.meta
├── UnityTextureRgbPacker.asmdef
├── UnityTextureRgbPacker.asmdef.meta
├── _config.yml
├── package.json
└── package.json.meta
/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razluta/UnityTextureRgbPacker/14a7e19142637d84aeedb6b907bba25c8ef9dd6b/.gitignore
--------------------------------------------------------------------------------
/Editor.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e16fcec1c08757a4d8ba84f513e22d77
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4938f551348fac4449a4d4342acc0dce
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Editor/Resources/UnityTextureRgbPacker.uss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razluta/UnityTextureRgbPacker/14a7e19142637d84aeedb6b907bba25c8ef9dd6b/Editor/Resources/UnityTextureRgbPacker.uss
--------------------------------------------------------------------------------
/Editor/Resources/UnityTextureRgbPacker.uss.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d862056ff2cf10d4598ff5efd396056f
3 | ScriptedImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 2
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 | script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0}
11 | disableValidation: 0
12 |
--------------------------------------------------------------------------------
/Editor/Resources/UnityTextureRgbPacker.uxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/Editor/Resources/UnityTextureRgbPacker.uxml.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 278944c3046b9f74ea0aa7ffa2afad2a
3 | ScriptedImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 2
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 | script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0}
11 |
--------------------------------------------------------------------------------
/Editor/UnityTextureRgbPackerEditorWindow.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.IO;
3 | using UnityEditor;
4 | using UnityEditor.UIElements;
5 | using UnityEngine;
6 | using UnityEngine.UIElements;
7 | using UnityTextureRgbPacker;
8 |
9 | public class UnityTextureRgbPackerEditorWindow : EditorWindow
10 | {
11 | private VisualElement _root;
12 | private ObjectField _channelRedTextureObjectField;
13 | private ObjectField _channelGreenTextureObjectField;
14 | private ObjectField _channelBlueTextureObjectField;
15 | private ObjectField _channelAlphaTextureObjectField;
16 | private IntegerField _widthIntField;
17 | private IntegerField _heightIntField;
18 | private Toggle _tgaToggle;
19 | private Toggle _pngToggle;
20 | private Label _scaleToSmallestLabel;
21 | private Toggle _scaleToSpecificValueToggle;
22 | private Vector2Field _textureSizeVectorField;
23 | private TextField _nameIdentifierTextField;
24 | private Button _generatePackedTextureButton;
25 | private VisualElement _previewImageRedChannelVisualElement;
26 | private VisualElement _previewImageGreenChannelVisualElement;
27 | private VisualElement _previewImageBlueChannelVisualElement;
28 | private VisualElement _previewImageAlphaChannelVisualElement;
29 | private VisualElement _previewImageResultVisualElement;
30 |
31 | [MenuItem("Texture RGB(A) Packer/Open Texture Packer")]
32 | public static void ShowWindow()
33 | {
34 | // Opens the window, otherwise focuses it if it’s already open.
35 | var window = GetWindow();
36 |
37 | // Adds a title to the window.
38 | window.titleContent = new GUIContent("Texture RGB(A) Packer");
39 |
40 | // Sets a minimum and maximum size to the window.
41 | window.minSize = new Vector2(350, 650);
42 | }
43 |
44 | private void OnEnable()
45 | {
46 | // Reference to the root of the window.
47 | _root = rootVisualElement;
48 | // Associates a stylesheet to our root. Thanks to inheritance, all root’s
49 | // children will have access to it.
50 | _root.styleSheets.Add(Resources.Load("UnityTextureRgbPacker"));
51 |
52 | // Loads and clones our VisualTree (eg. our UXML structure) inside the root.
53 | var mainVisualTree = Resources.Load("UnityTextureRgbPacker");
54 | var textureInputVisualTree = Resources.Load("TextureInput");
55 | mainVisualTree.CloneTree(_root);
56 |
57 | // Query the needed fields to get the Visual Elements references
58 | _channelRedTextureObjectField = _root.Q("OF_RedChannelTexture");
59 | _channelGreenTextureObjectField = _root.Q("OF_GreenChannelTexture");
60 | _channelBlueTextureObjectField = _root.Q("OF_BlueChannelTexture");
61 | _channelAlphaTextureObjectField = _root.Q("OF_AlphaChannelTexture");
62 | _widthIntField = _root.Q("IF_Width");
63 | _heightIntField = _root.Q("IF_Height");
64 | _tgaToggle = _root.Q("TG_Tga");
65 | _pngToggle = _root.Q("TG_Png");
66 | _scaleToSmallestLabel = _root.Q