Merged goto01 and reworked some code.

Implemented the texture scaler provided by goto01 (Kiryl Tkachou) and removed the old ones.
Implmented the mesh export bugfixes.
Changed mesh export names.
Changed texture export names.
Updated the the export window.
Updated export functionality.
Updated hotkeys.
Fixed quad duplication bug.
Minor visual changes.

Co-Authored-By: Kiryl Tkachou <goto01@users.noreply.github.com>
This commit is contained in:
max
2019-08-30 01:11:33 +02:00
parent 26a0f68454
commit e81a4ec119
9 changed files with 435 additions and 505 deletions

View File

@ -33,7 +33,7 @@ namespace MA_TextureAtlasserPro
curWindow.workView.ResetWindow();
}
if(curWindow.textureAtlas != null)
if (curWindow.textureAtlas != null)
{
GUILayout.FlexibleSpace();
//GUILayout.Label(curWindow.textureAtlas.textureAtlasSize.ToString());

View File

@ -19,7 +19,7 @@ namespace MA_TextureAtlasserPro
private const float kZoomMax = 2.0f;
private Rect zoomArea;
private float zoom = 1.0f;
public float Zoom { get { return zoom; } }
public float Zoom { get { return zoom; } set { zoom = Mathf.Clamp(value, kZoomMin, kZoomMax); } }
private Vector2 zoomCoordsOrigin = Vector2.zero;
public override void UpdateView(Event e, Rect editorViewRect)
@ -96,21 +96,32 @@ namespace MA_TextureAtlasserPro
{
if(curWindow.textureAtlas != null)
{
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.addQuadHotKey)
if (curWindow.settings.GetHotKey(e, curWindow.settings.addQuadHotKey))
{
MA_TextureAtlasserProUtils.CreateTextureQuad(curWindow.textureAtlas, "new Quad", new Rect(0, 0, 128, 128), curWindow.settings.autoFocus);
e.Use();
}
if(curWindow.settings.GetHotKey(e, curWindow.settings.zoomInHotKey))
{
Zoom += 0.25f;
e.Use();
}
if(curWindow.settings.GetHotKey(e, curWindow.settings.zoomOutHotKey))
{
Zoom -= 0.25f;
e.Use();
}
if (curWindow.textureAtlas.selectedTextureQuad != null)
{
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.removeQuadHotKey)
if (curWindow.settings.GetHotKey(e, curWindow.settings.removeQuadHotKey))
{
MA_TextureAtlasserProUtils.RemoveTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
e.Use();
}
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.duplicateHotKey)
if (curWindow.settings.GetHotKey(e, curWindow.settings.duplicateHotKey))
{
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus, curWindow.settings.copySelectedQuadData, curWindow.settings.duplicatedQuadNamePrefix);
e.Use();