mirror of
https://github.com/maxartz15/MA_TextureAtlasser.git
synced 2025-07-07 00:36:09 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1251736f5b | |||
78e4fb0ad1 | |||
7990f987dc |
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -101,3 +102,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -164,3 +165,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
@ -10,7 +11,7 @@ namespace MA_TextureAtlasserPro
|
||||
public class MA_TextureAtlasserProSettings : ScriptableObject
|
||||
{
|
||||
[Header("Selection")]
|
||||
public bool autoFocus = true;
|
||||
public bool autoFocus = false;
|
||||
|
||||
[Header("Duplication:")]
|
||||
public bool copySelectedQuadData = false;
|
||||
@ -23,3 +24,4 @@ namespace MA_TextureAtlasserPro
|
||||
public KeyCode duplicateHotKey = KeyCode.D;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
@ -17,3 +18,4 @@ namespace MA_TextureAtlasserPro
|
||||
public string name;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
@ -33,3 +34,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -211,7 +212,7 @@ namespace MA_TextureAtlasserPro
|
||||
{
|
||||
if(atlas != null && atlas.selectedTextureQuad != null)
|
||||
{
|
||||
CreateTextureQuad(atlas, namePrefix + atlas.selectedTextureQuad.name, atlas.selectedTextureQuad.rect);
|
||||
CreateTextureQuad(atlas, namePrefix + atlas.selectedTextureQuad.name, atlas.selectedTextureQuad.rect, false);
|
||||
|
||||
if(copyData)
|
||||
{
|
||||
@ -378,3 +379,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -76,3 +77,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -132,3 +133,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -79,3 +80,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
@ -53,3 +54,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using MA_Editor;
|
||||
@ -92,6 +93,8 @@ namespace MA_TextureAtlasserPro
|
||||
|
||||
//Hotkeys.
|
||||
if (curWindow.settings.useHotkeys)
|
||||
{
|
||||
if(curWindow.textureAtlas != null)
|
||||
{
|
||||
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.addQuadHotKey)
|
||||
{
|
||||
@ -109,12 +112,13 @@ namespace MA_TextureAtlasserPro
|
||||
|
||||
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.duplicateHotKey)
|
||||
{
|
||||
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
|
||||
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus, curWindow.settings.copySelectedQuadData, curWindow.settings.duplicatedQuadNamePrefix);
|
||||
e.Use();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Vector2 ConvertScreenCoordsToZoomCoords(Vector2 screenCoords)
|
||||
{
|
||||
@ -145,3 +149,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
@ -168,3 +169,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
@ -133,3 +134,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
@ -119,3 +120,4 @@ namespace MA_TextureAtlasserPro
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
//Maxartz15
|
||||
//Version 1.0
|
||||
//https://github.com/maxartz15/MA_EditorUtils
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@ -59,3 +59,4 @@ namespace MA_Editor.Grid
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,6 +1,9 @@
|
||||
//Maxartz15
|
||||
//Version 1.0
|
||||
//https://github.com/maxartz15/MA_EditorUtils
|
||||
|
||||
//References:
|
||||
//http://martinecker.com/martincodes/unity-editor-window-zooming/
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using MA_Editor;
|
||||
|
||||
@ -68,3 +71,4 @@ namespace MA_Editor.RectUtils
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,6 +1,9 @@
|
||||
//Maxartz15
|
||||
//Version 1.0
|
||||
//https://github.com/maxartz15/MA_EditorUtils
|
||||
|
||||
//References:
|
||||
//http://martinecker.com/martincodes/unity-editor-window-zooming/
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using MA_Editor;
|
||||
using MA_Editor.RectUtils;
|
||||
@ -37,3 +40,4 @@ namespace MA_Editor.GUILayoutZoom
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,6 +1,9 @@
|
||||
//Maxartz15
|
||||
//Version 1.0
|
||||
//https://github.com/maxartz15/MA_MeshUtils
|
||||
|
||||
//References:
|
||||
//http://wiki.unity3d.com/index.php?title=ObjExporter
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@ -89,15 +92,15 @@ namespace MA_Mesh
|
||||
{
|
||||
if(flipY)
|
||||
{
|
||||
Debug.Log("01" + uvs[i].x);
|
||||
//Debug.Log("01" + uvs[i].x);
|
||||
uvs[i] = new Vector2((uvs[i].x / atlasSize.x * textureRect.width) + (1 / atlasSize.x * textureRect.x), (uvs[i].y / atlasSize.y * textureRect.height) + (1 / atlasSize.y * (atlasSize.y - textureRect.height - textureRect.y)));
|
||||
Debug.Log("02" + uvs[i].x);
|
||||
//Debug.Log("02" + uvs[i].x);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("01" + uvs[i].x);
|
||||
//Debug.Log("01" + uvs[i].x);
|
||||
uvs[i] = new Vector2((uvs[i].x / atlasSize.x * textureRect.width) + (1 / atlasSize.x * textureRect.x), (uvs[i].y / atlasSize.y * textureRect.height) + (1 / atlasSize.y * textureRect.y));
|
||||
Debug.Log("02" + uvs[i].x);
|
||||
//Debug.Log("02" + uvs[i].x);
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,3 +188,4 @@ namespace MA_Mesh
|
||||
public string textureName;
|
||||
}
|
||||
}
|
||||
#endif
|
@ -1,27 +1,22 @@
|
||||
//Maxartz15
|
||||
//Version 1.0
|
||||
//Part of MA_TextureUtils
|
||||
//https://github.com/maxartz15/MA_TextureUtils
|
||||
//https://github.com/maxartz15/MA_TextureUtils
|
||||
|
||||
//References:
|
||||
//http://www.gamasutra.com/blogs/JoshSutphin/20131007/201829/Adding_to_Unitys_BuiltIn_Classes_Using_Extension_Methods.php
|
||||
//https://forum.unity3d.com/threads/contribution-texture2d-blur-in-c.185694/
|
||||
//http://orbcreation.com/orbcreation/page.orb?1180
|
||||
//https://support.unity3d.com/hc/en-us/articles/206486626-How-can-I-get-pixels-from-unreadable-textures-
|
||||
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
//http://www.gamasutra.com/blogs/JoshSutphin/20131007/201829/Adding_to_Unitys_BuiltIn_Classes_Using_Extension_Methods.php
|
||||
//https://forum.unity3d.com/threads/contribution-texture2d-blur-in-c.185694/
|
||||
//http://orbcreation.com/orbcreation/page.orb?1180
|
||||
//https://support.unity3d.com/hc/en-us/articles/206486626-How-can-I-get-pixels-from-unreadable-textures-
|
||||
|
||||
namespace MA_Texture
|
||||
{
|
||||
public static class MA_TextureUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Some base converters and texture settings setters.
|
||||
/// </summary>
|
||||
|
||||
public static Texture ConvertToReadableTexture(Texture texture)
|
||||
{
|
||||
if (texture == null)
|
||||
@ -201,3 +196,4 @@ namespace MA_Texture
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user