mirror of
https://github.com/maxartz15/MA_TextureAtlasser.git
synced 2025-07-07 08:46:07 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
3532465e69 | |||
6c2daebb56 | |||
696ef848e0 | |||
521cb34541 | |||
d8c59e86ca |
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 34f8bb860cb13ac49ab6602f84a27dfd
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,30 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace MA_TextureAtlasserPro
|
||||||
|
{
|
||||||
|
[CustomEditor(typeof(MA_TextureAtlasserProSettings))]
|
||||||
|
[CanEditMultipleObjects]
|
||||||
|
public class MA_TextureAtlasserProSettingsEditor : Editor
|
||||||
|
{
|
||||||
|
GUIContent reloadButton = new GUIContent("Reload", "Update the editor with the changes made.");
|
||||||
|
|
||||||
|
public override void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
GUILayout.BeginVertical();
|
||||||
|
DrawDefaultInspector();
|
||||||
|
|
||||||
|
GUILayout.Space(15);
|
||||||
|
|
||||||
|
if(GUILayout.Button(reloadButton, GUILayout.Height(40), GUILayout.ExpandWidth(true)))
|
||||||
|
{
|
||||||
|
//Update necessary systems.
|
||||||
|
MA_TextureAtlasserProGuiLoader.LoadEditorGui((MA_TextureAtlasserProSettings)this.target);
|
||||||
|
}
|
||||||
|
|
||||||
|
GUILayout.EndVertical();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
@ -1,8 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 64b4bb2ec0d18b142b6a5aa0c8dfb5c1
|
guid: 9850f2b069cfb36498e9601e4884071a
|
||||||
timeCreated: 1521838249
|
|
||||||
licenseType: Free
|
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
@ -1,4 +1,5 @@
|
|||||||
using UnityEngine;
|
#if UNITY_EDITOR
|
||||||
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using MA_Texture;
|
using MA_Texture;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -66,4 +67,5 @@ namespace MA_TextureAtlasserPro
|
|||||||
Sprite,
|
Sprite,
|
||||||
SpriteSliced
|
SpriteSliced
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
@ -10,7 +10,10 @@ namespace MA_TextureAtlasserPro
|
|||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class MA_TextureAtlasserProSettings : ScriptableObject
|
public class MA_TextureAtlasserProSettings : ScriptableObject
|
||||||
{
|
{
|
||||||
[Header("Hotkeys:")]
|
[Header("GUI (requires reload):")]
|
||||||
|
public MA_TextureAtlasserProGuiSettings editorGuiSettings = new MA_TextureAtlasserProGuiSettings();
|
||||||
|
|
||||||
|
[Header("HotKeys:")]
|
||||||
public bool useHotkeys = false;
|
public bool useHotkeys = false;
|
||||||
public EventModifiers modifierKey = EventModifiers.Alt;
|
public EventModifiers modifierKey = EventModifiers.Alt;
|
||||||
public KeyCode addQuadHotKey = KeyCode.Q;
|
public KeyCode addQuadHotKey = KeyCode.Q;
|
||||||
@ -36,5 +39,19 @@ namespace MA_TextureAtlasserPro
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class MA_TextureAtlasserProGuiSettings
|
||||||
|
{
|
||||||
|
public MA_EditorGuiMode editorGuiMode = MA_EditorGuiMode.IconAndText;
|
||||||
|
public bool enableToolTips = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum MA_EditorGuiMode
|
||||||
|
{
|
||||||
|
IconAndText = 0,
|
||||||
|
Icon = 1,
|
||||||
|
Text = 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
@ -0,0 +1,115 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace MA_TextureAtlasserPro
|
||||||
|
{
|
||||||
|
public static class MA_TextureAtlasserProGuiLoader
|
||||||
|
{
|
||||||
|
private const string LOADICONPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Icons/";
|
||||||
|
|
||||||
|
public static GUIContent createAtlasGC;
|
||||||
|
public static GUIContent loadAtlasGC;
|
||||||
|
public static GUIContent exportAtlasGC;
|
||||||
|
public static GUIContent createQuadGC;
|
||||||
|
public static GUIContent removeQuadGC;
|
||||||
|
public static GUIContent duplicateQuadGC;
|
||||||
|
public static GUIContent showTexturesOnGC;
|
||||||
|
public static GUIContent showTexturesOffGC;
|
||||||
|
public static GUIContent dragHandleGC;
|
||||||
|
public static GUIContent editGC;
|
||||||
|
public static GUIContent createExportSettingsGC;
|
||||||
|
|
||||||
|
public static void LoadEditorGui(MA_TextureAtlasserProSettings settings)
|
||||||
|
{
|
||||||
|
createAtlasGC = new GUIContent();
|
||||||
|
loadAtlasGC = new GUIContent();
|
||||||
|
exportAtlasGC = new GUIContent();
|
||||||
|
createQuadGC = new GUIContent();
|
||||||
|
removeQuadGC = new GUIContent();
|
||||||
|
duplicateQuadGC = new GUIContent();
|
||||||
|
showTexturesOnGC = new GUIContent();
|
||||||
|
showTexturesOffGC = new GUIContent();
|
||||||
|
dragHandleGC = new GUIContent();
|
||||||
|
editGC = new GUIContent();
|
||||||
|
createExportSettingsGC = new GUIContent();
|
||||||
|
|
||||||
|
switch (settings.editorGuiSettings.editorGuiMode)
|
||||||
|
{
|
||||||
|
case MA_EditorGuiMode.IconAndText:
|
||||||
|
LoadIcons();
|
||||||
|
LoadText();
|
||||||
|
break;
|
||||||
|
case MA_EditorGuiMode.Icon:
|
||||||
|
LoadIcons();
|
||||||
|
break;
|
||||||
|
case MA_EditorGuiMode.Text:
|
||||||
|
LoadText();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LoadIcons();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(settings.editorGuiSettings.enableToolTips)
|
||||||
|
{
|
||||||
|
LoadToolTips(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Exceptions.
|
||||||
|
dragHandleGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "dragHandleIcon" + ".png");
|
||||||
|
dragHandleGC.text = "";
|
||||||
|
editGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "editIcon" + ".png");
|
||||||
|
editGC.text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void LoadIcons()
|
||||||
|
{
|
||||||
|
createAtlasGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "createAtlasIcon" + ".png");
|
||||||
|
loadAtlasGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "loadAtlasIcon" + ".png");
|
||||||
|
exportAtlasGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "exportAtlasIcon" + ".png");
|
||||||
|
createQuadGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "createQuadIcon" + ".png");
|
||||||
|
removeQuadGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "removeQuadIcon" + ".png");
|
||||||
|
duplicateQuadGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "duplicateQuadIcon" + ".png");
|
||||||
|
showTexturesOnGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "showTexturesOnIcon" + ".png");
|
||||||
|
showTexturesOffGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "showTexturesOffIcon" + ".png");
|
||||||
|
createExportSettingsGC.image = (Texture)EditorGUIUtility.Load(LOADICONPATH + "createAtlasIcon" + ".png");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void LoadText()
|
||||||
|
{
|
||||||
|
createAtlasGC.text = "Create Atlas";
|
||||||
|
loadAtlasGC.text = "Load Atlas";
|
||||||
|
exportAtlasGC.text = "Export Atlas";
|
||||||
|
createQuadGC.text = "Create Quad";
|
||||||
|
removeQuadGC.text = "Remove Quad";
|
||||||
|
duplicateQuadGC.text = "Duplicate Quad";
|
||||||
|
showTexturesOnGC.text = "Hide Textures";
|
||||||
|
showTexturesOffGC.text = "Show Textures";
|
||||||
|
createExportSettingsGC.text = "Create Export Settings";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void LoadToolTips(MA_TextureAtlasserProSettings settings)
|
||||||
|
{
|
||||||
|
createAtlasGC.tooltip = "Opens the create atlas window.";
|
||||||
|
loadAtlasGC.tooltip = "Load an existing atlas.";
|
||||||
|
exportAtlasGC.tooltip = "Opens the export window.";
|
||||||
|
if (settings.useHotkeys)
|
||||||
|
{
|
||||||
|
createQuadGC.tooltip = string.Format("({0} + {1}), Creates a new quad.", settings.modifierKey, settings.addQuadHotKey);
|
||||||
|
removeQuadGC.tooltip = string.Format("({0} + {1}), Removes the selected quad.", settings.modifierKey, settings.removeQuadHotKey);
|
||||||
|
duplicateQuadGC.tooltip = string.Format("({0} + {1}), Duplicates the selected quad.", settings.modifierKey, settings.duplicateHotKey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
createQuadGC.tooltip = "Creates a new quad.";
|
||||||
|
removeQuadGC.tooltip = "Removes the selected quad.";
|
||||||
|
duplicateQuadGC.tooltip = "Duplicates the selected quad.";
|
||||||
|
}
|
||||||
|
showTexturesOnGC.tooltip = "Hides the preview of the first texture on the quads.";
|
||||||
|
showTexturesOffGC.tooltip = "Shows a preview of the first texture on the quads.";
|
||||||
|
createExportSettingsGC.tooltip = "Opens the create export settings window.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1547329de58c58d4eb6b272309da0c85
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -1,37 +0,0 @@
|
|||||||
#if UNITY_EDITOR
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor;
|
|
||||||
|
|
||||||
namespace MA_TextureAtlasserPro
|
|
||||||
{
|
|
||||||
public static class MA_TextureAtlasserProIcons
|
|
||||||
{
|
|
||||||
private const string LOADICONPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Icons/";
|
|
||||||
|
|
||||||
public static GUIContent createAtlasIcon;
|
|
||||||
public static GUIContent loadAtlasIcon;
|
|
||||||
public static GUIContent exportAtlasIcon;
|
|
||||||
public static GUIContent createQuadIcon;
|
|
||||||
public static GUIContent removeQuadIcon;
|
|
||||||
public static GUIContent duplicateQuadIcon;
|
|
||||||
public static GUIContent showTexturesOnIcon;
|
|
||||||
public static GUIContent showTexturesOffIcon;
|
|
||||||
public static GUIContent dragHandleIcon;
|
|
||||||
public static GUIContent editIcon;
|
|
||||||
|
|
||||||
public static void LoadIcons()
|
|
||||||
{
|
|
||||||
createAtlasIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "createAtlasIcon" + ".png"));
|
|
||||||
loadAtlasIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "loadAtlasIcon" + ".png"));
|
|
||||||
exportAtlasIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "exportAtlasIcon" + ".png"));
|
|
||||||
createQuadIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "createQuadIcon" + ".png"));
|
|
||||||
removeQuadIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "removeQuadIcon" + ".png"));
|
|
||||||
duplicateQuadIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "duplicateQuadIcon" + ".png"));
|
|
||||||
showTexturesOnIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "showTexturesOnIcon" + ".png"));
|
|
||||||
showTexturesOffIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "showTexturesOffIcon" + ".png"));
|
|
||||||
dragHandleIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "dragHandleIcon" + ".png"));
|
|
||||||
editIcon = new GUIContent("", (Texture)EditorGUIUtility.Load(LOADICONPATH + "editIcon" + ".png"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -63,7 +63,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
//Textures
|
//Textures
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
GUILayout.Label("Textures", GUILayout.ExpandWidth(true));
|
GUILayout.Label("Textures", GUILayout.ExpandWidth(true));
|
||||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.editIcon, EditorStyles.miniButton, GUILayout.Width(36), GUILayout.Height(15)))
|
if(GUILayout.Button(MA_TextureAtlasserProGuiLoader.editGC, EditorStyles.miniButton, GUILayout.Width(36), GUILayout.Height(15)))
|
||||||
{
|
{
|
||||||
isEditing = !isEditing;
|
isEditing = !isEditing;
|
||||||
}
|
}
|
||||||
@ -140,7 +140,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
labelStyle.normal.textColor = Color.black;
|
labelStyle.normal.textColor = GUI.skin.label.normal.textColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label("x " + curWindow.textureAtlas.selectedTextureQuad.guiRect.x.ToString() + ", y " + curWindow.textureAtlas.selectedTextureQuad.guiRect.y.ToString());
|
GUILayout.Label("x " + curWindow.textureAtlas.selectedTextureQuad.guiRect.x.ToString() + ", y " + curWindow.textureAtlas.selectedTextureQuad.guiRect.y.ToString());
|
||||||
|
@ -25,42 +25,42 @@ namespace MA_TextureAtlasserPro
|
|||||||
GUILayout.BeginArea(editorViewRect, EditorStyles.helpBox);
|
GUILayout.BeginArea(editorViewRect, EditorStyles.helpBox);
|
||||||
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
|
||||||
|
|
||||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.createAtlasIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(GUILayout.Button(MA_TextureAtlasserProGuiLoader.createAtlasGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
MA_TextureAtlasserProCreateWindow.InitEditorWindow(curWindow);
|
MA_TextureAtlasserProCreateWindow.InitEditorWindow(curWindow);
|
||||||
}
|
}
|
||||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.loadAtlasIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(GUILayout.Button(MA_TextureAtlasserProGuiLoader.loadAtlasGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
curWindow.textureAtlas = MA_TextureAtlasserProUtils.LoadTextureAtlas();
|
curWindow.textureAtlas = MA_TextureAtlasserProUtils.LoadTextureAtlas();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(curWindow.textureAtlas != null)
|
if(curWindow.textureAtlas != null)
|
||||||
{
|
{
|
||||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.exportAtlasIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(GUILayout.Button(MA_TextureAtlasserProGuiLoader.exportAtlasGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
MA_TextureAtlasserProExportWindow.InitEditorWindow(curWindow);
|
MA_TextureAtlasserProExportWindow.InitEditorWindow(curWindow);
|
||||||
//MA_TextureAtlasserProUtils.ExportAtlas(curWindow.textureAtlas);
|
//MA_TextureAtlasserProUtils.ExportAtlas(curWindow.textureAtlas);
|
||||||
}
|
}
|
||||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET);
|
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET);
|
||||||
if(curWindow.textureAtlas.showTextures && GUILayout.Button(MA_TextureAtlasserProIcons.showTexturesOnIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(curWindow.textureAtlas.showTextures && GUILayout.Button(MA_TextureAtlasserProGuiLoader.showTexturesOnGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
curWindow.textureAtlas.showTextures = false;
|
curWindow.textureAtlas.showTextures = false;
|
||||||
}
|
}
|
||||||
else if(!curWindow.textureAtlas.showTextures && GUILayout.Button(MA_TextureAtlasserProIcons.showTexturesOffIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
else if(!curWindow.textureAtlas.showTextures && GUILayout.Button(MA_TextureAtlasserProGuiLoader.showTexturesOffGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
curWindow.textureAtlas.showTextures = true;
|
curWindow.textureAtlas.showTextures = true;
|
||||||
}
|
}
|
||||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET);
|
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET);
|
||||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.createQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(GUILayout.Button(MA_TextureAtlasserProGuiLoader.createQuadGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
MA_TextureAtlasserProUtils.CreateTextureQuad(curWindow.textureAtlas, "new Quad", new Rect(0, 0, 128, 128), curWindow.settings.autoFocus);
|
MA_TextureAtlasserProUtils.CreateTextureQuad(curWindow.textureAtlas, "new Quad", new Rect(0, 0, 128, 128), curWindow.settings.autoFocus);
|
||||||
}
|
}
|
||||||
if(curWindow.textureAtlas.selectedTextureQuad != null && GUILayout.Button(MA_TextureAtlasserProIcons.removeQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(curWindow.textureAtlas.selectedTextureQuad != null && GUILayout.Button(MA_TextureAtlasserProGuiLoader.removeQuadGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
if(curWindow.textureAtlas.selectedTextureQuad != null)
|
if(curWindow.textureAtlas.selectedTextureQuad != null)
|
||||||
MA_TextureAtlasserProUtils.RemoveTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
|
MA_TextureAtlasserProUtils.RemoveTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
|
||||||
}
|
}
|
||||||
if (curWindow.textureAtlas.selectedTextureQuad != null && GUILayout.Button(MA_TextureAtlasserProIcons.duplicateQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if (curWindow.textureAtlas.selectedTextureQuad != null && GUILayout.Button(MA_TextureAtlasserProGuiLoader.duplicateQuadGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
if (curWindow.textureAtlas.selectedTextureQuad != null)
|
if (curWindow.textureAtlas.selectedTextureQuad != null)
|
||||||
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus, curWindow.settings.copySelectedQuadData, curWindow.settings.duplicatedQuadNamePrefix);
|
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus, curWindow.settings.copySelectedQuadData, curWindow.settings.duplicatedQuadNamePrefix);
|
||||||
|
@ -145,9 +145,9 @@ namespace MA_TextureAtlasserPro
|
|||||||
{
|
{
|
||||||
if(q.isSelected)
|
if(q.isSelected)
|
||||||
{
|
{
|
||||||
GUI.Button(new Rect(q.dragRectPos.x, q.dragRectPos.y, q.dragRectPos.width, q.dragRectPos.height), MA_TextureAtlasserProIcons.dragHandleIcon);
|
GUI.Button(new Rect(q.dragRectPos.x, q.dragRectPos.y, q.dragRectPos.width, q.dragRectPos.height), MA_TextureAtlasserProGuiLoader.dragHandleGC);
|
||||||
GUI.Button(new Rect(q.dragRectWidth.x, q.dragRectWidth.y, q.dragRectWidth.width, q.dragRectWidth.height), MA_TextureAtlasserProIcons.dragHandleIcon);
|
GUI.Button(new Rect(q.dragRectWidth.x, q.dragRectWidth.y, q.dragRectWidth.width, q.dragRectWidth.height), MA_TextureAtlasserProGuiLoader.dragHandleGC);
|
||||||
GUI.Button(new Rect(q.dragRectHeight.x, q.dragRectHeight.y, q.dragRectHeight.width, q.dragRectHeight.height), MA_TextureAtlasserProIcons.dragHandleIcon);
|
GUI.Button(new Rect(q.dragRectHeight.x, q.dragRectHeight.y, q.dragRectHeight.width, q.dragRectHeight.height), MA_TextureAtlasserProGuiLoader.dragHandleGC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
{
|
{
|
||||||
GUILayout.BeginHorizontal(EditorStyles.helpBox, GUILayout.Height(44));
|
GUILayout.BeginHorizontal(EditorStyles.helpBox, GUILayout.Height(44));
|
||||||
|
|
||||||
if (GUILayout.Button(MA_TextureAtlasserProIcons.createAtlasIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if (GUILayout.Button(MA_TextureAtlasserProGuiLoader.createExportSettingsGC, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
MA_TextureAtlasserProCreateExportWindow.InitWindow(curWindow);
|
MA_TextureAtlasserProCreateExportWindow.InitWindow(curWindow);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
//Load the icons
|
//Load the icons
|
||||||
MA_TextureAtlasserProIcons.LoadIcons();
|
//MA_TextureAtlasserProGuiLoader.LoadEditorGui(thisWindow.settings.editorGuiSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void GetCurrentWindow()
|
private static void GetCurrentWindow()
|
||||||
@ -59,6 +59,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
}
|
}
|
||||||
|
|
||||||
thisWindow.settings = MA_TextureAtlasserProUtils.LoadSettings();
|
thisWindow.settings = MA_TextureAtlasserProUtils.LoadSettings();
|
||||||
|
MA_TextureAtlasserProGuiLoader.LoadEditorGui(thisWindow.settings);
|
||||||
thisWindow.workView = new MA_TextureAtlasserProWorkView(thisWindow, "workView");
|
thisWindow.workView = new MA_TextureAtlasserProWorkView(thisWindow, "workView");
|
||||||
thisWindow.menuView = new MA_TextureAtlasserProMenuView(thisWindow, "menuView");
|
thisWindow.menuView = new MA_TextureAtlasserProMenuView(thisWindow, "menuView");
|
||||||
thisWindow.inspectorView = new MA_TextureAtlasserProInspectorView(thisWindow, "inspectorView");
|
thisWindow.inspectorView = new MA_TextureAtlasserProInspectorView(thisWindow, "inspectorView");
|
||||||
|
@ -62,7 +62,7 @@ namespace MA_Mesh
|
|||||||
|
|
||||||
assetPath = savePath + prefabName + ".prefab";
|
assetPath = savePath + prefabName + ".prefab";
|
||||||
|
|
||||||
#if UNITY_2018_4_OR_NEWER
|
#if UNITY_2018_3_OR_NEWER
|
||||||
|
|
||||||
PrefabUtility.SaveAsPrefabAsset(gameObject, assetPath);
|
PrefabUtility.SaveAsPrefabAsset(gameObject, assetPath);
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ namespace MA_Texture
|
|||||||
RenderTexture.active = tmp;
|
RenderTexture.active = tmp;
|
||||||
|
|
||||||
// Create a new readable Texture2D to copy the pixels to it
|
// Create a new readable Texture2D to copy the pixels to it
|
||||||
Texture2D myTexture2D = new Texture2D(texture.width, texture.width);
|
Texture2D myTexture2D = new Texture2D(texture.width, texture.height);
|
||||||
|
|
||||||
// Copy the pixels from the RenderTexture to the new Texture
|
// Copy the pixels from the RenderTexture to the new Texture
|
||||||
myTexture2D.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);
|
myTexture2D.ReadPixels(new Rect(0, 0, tmp.width, tmp.height), 0, 0);
|
||||||
@ -161,17 +161,20 @@ namespace MA_Texture
|
|||||||
{
|
{
|
||||||
Color[] newColors = new Color[newWidth * newHeight];
|
Color[] newColors = new Color[newWidth * newHeight];
|
||||||
|
|
||||||
float ratioX = ((float)curWidth) / newWidth;
|
float ratioX = 1.0f / ((float)newWidth / (curWidth - 1));
|
||||||
float ratioY = ((float)curHeight) / newHeight;
|
float ratioY = 1.0f / ((float)newHeight / (curHeight - 1));
|
||||||
|
|
||||||
for (int y = 0; y < newHeight; y++)
|
for (int y = 0; y < newHeight; y++)
|
||||||
{
|
{
|
||||||
var thisY = Mathf.RoundToInt((ratioY * y) * curWidth);
|
int yFloor = Mathf.FloorToInt(y * ratioY);
|
||||||
var yw = y * newWidth;
|
var y1 = (yFloor + 1) * curWidth;
|
||||||
|
var yw = y * newWidth;
|
||||||
|
|
||||||
for (int x = 0; x < newWidth; x++)
|
for (int x = 0; x < newWidth; x++)
|
||||||
{
|
{
|
||||||
newColors[yw + x] = curColors[Mathf.RoundToInt(thisY + ratioX * x)];
|
int xFloor = Mathf.FloorToInt(x * ratioX);
|
||||||
|
|
||||||
|
newColors[yw + x] = curColors[Mathf.RoundToInt(y1 + xFloor)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.2d.sprite": "1.0.0",
|
"com.unity.2d.sprite": "1.0.0",
|
||||||
"com.unity.ext.nunit": "1.0.0",
|
"com.unity.ext.nunit": "1.0.0",
|
||||||
"com.unity.package-manager-ui": "2.2.0",
|
"com.unity.test-framework": "1.1.9",
|
||||||
"com.unity.test-framework": "1.0.13",
|
|
||||||
"com.unity.ugui": "1.0.0",
|
"com.unity.ugui": "1.0.0",
|
||||||
"com.unity.modules.ai": "1.0.0",
|
"com.unity.modules.ai": "1.0.0",
|
||||||
"com.unity.modules.androidjni": "1.0.0",
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
--- !u!159 &1
|
--- !u!159 &1
|
||||||
EditorSettings:
|
EditorSettings:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 7
|
serializedVersion: 9
|
||||||
m_ExternalVersionControlSupport: Hidden Meta Files
|
m_ExternalVersionControlSupport: Hidden Meta Files
|
||||||
m_SerializationMode: 2
|
m_SerializationMode: 2
|
||||||
m_LineEndingsForNewScripts: 2
|
m_LineEndingsForNewScripts: 2
|
||||||
@ -16,10 +16,20 @@ EditorSettings:
|
|||||||
m_EtcTextureFastCompressor: 1
|
m_EtcTextureFastCompressor: 1
|
||||||
m_EtcTextureNormalCompressor: 2
|
m_EtcTextureNormalCompressor: 2
|
||||||
m_EtcTextureBestCompressor: 4
|
m_EtcTextureBestCompressor: 4
|
||||||
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp
|
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
|
||||||
m_ProjectGenerationRootNamespace:
|
m_ProjectGenerationRootNamespace:
|
||||||
m_CollabEditorSettings:
|
m_CollabEditorSettings:
|
||||||
inProgressEnabled: 1
|
inProgressEnabled: 1
|
||||||
m_EnableTextureStreamingInEditMode: 1
|
m_EnableTextureStreamingInEditMode: 1
|
||||||
m_EnableTextureStreamingInPlayMode: 1
|
m_EnableTextureStreamingInPlayMode: 1
|
||||||
m_AsyncShaderCompilation: 1
|
m_AsyncShaderCompilation: 1
|
||||||
|
m_EnterPlayModeOptionsEnabled: 0
|
||||||
|
m_EnterPlayModeOptions: 3
|
||||||
|
m_ShowLightmapResolutionOverlay: 1
|
||||||
|
m_UseLegacyProbeSampleCount: 1
|
||||||
|
m_AssetPipelineMode: 1
|
||||||
|
m_CacheServerMode: 0
|
||||||
|
m_CacheServerEndpoint:
|
||||||
|
m_CacheServerNamespacePrefix: default
|
||||||
|
m_CacheServerEnableDownload: 1
|
||||||
|
m_CacheServerEnableUpload: 1
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
m_EditorVersion: 2019.2.13f1
|
m_EditorVersion: 2019.3.0f6
|
||||||
m_EditorVersionWithRevision: 2019.2.13f1 (e20f6c7e5017)
|
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf)
|
||||||
|
@ -10,7 +10,7 @@ https://github.com/maxartz15/MA_TextureAtlasser/releases <br>
|
|||||||
[]()
|
[]()
|
||||||
|
|
||||||
### Tested Unity versions
|
### Tested Unity versions
|
||||||
[]() []() []()
|
[]() []() []()
|
||||||
|
|
||||||
## Export options
|
## Export options
|
||||||
### Meshes
|
### Meshes
|
||||||
|
Reference in New Issue
Block a user