Updated & tested with Unity 2019.1.8f1

Minor changes.
This commit is contained in:
max 2019-07-03 00:02:40 +02:00
parent 78e4fb0ad1
commit 1251736f5b
6 changed files with 25 additions and 26 deletions

View File

@ -11,7 +11,7 @@ namespace MA_TextureAtlasserPro
public class MA_TextureAtlasserProSettings : ScriptableObject public class MA_TextureAtlasserProSettings : ScriptableObject
{ {
[Header("Selection")] [Header("Selection")]
public bool autoFocus = true; public bool autoFocus = false;
[Header("Duplication:")] [Header("Duplication:")]
public bool copySelectedQuadData = false; public bool copySelectedQuadData = false;

View File

@ -1,5 +1,4 @@
//Maxartz15 //https://github.com/maxartz15/MA_EditorUtils
//Version 1.0
#if UNITY_EDITOR #if UNITY_EDITOR
using System.Collections; using System.Collections;

View File

@ -1,5 +1,7 @@
//Maxartz15 //https://github.com/maxartz15/MA_EditorUtils
//Version 1.0
//References:
//http://martinecker.com/martincodes/unity-editor-window-zooming/
#if UNITY_EDITOR #if UNITY_EDITOR
using UnityEngine; using UnityEngine;

View File

@ -1,5 +1,7 @@
//Maxartz15 //https://github.com/maxartz15/MA_EditorUtils
//Version 1.0
//References:
//http://martinecker.com/martincodes/unity-editor-window-zooming/
#if UNITY_EDITOR #if UNITY_EDITOR
using UnityEngine; using UnityEngine;

View File

@ -1,5 +1,7 @@
//Maxartz15 //https://github.com/maxartz15/MA_MeshUtils
//Version 1.0
//References:
//http://wiki.unity3d.com/index.php?title=ObjExporter
#if UNITY_EDITOR #if UNITY_EDITOR
using System; using System;
@ -90,15 +92,15 @@ namespace MA_Mesh
{ {
if(flipY) 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))); 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 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)); 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);
} }
} }

View File

@ -1,7 +1,10 @@
//Maxartz15 //https://github.com/maxartz15/MA_TextureUtils
//Version 1.0
//Part of MA_TextureUtils //References:
//https://github.com/maxartz15/MA_TextureUtils //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 #if UNITY_EDITOR
using UnityEngine; using UnityEngine;
@ -10,19 +13,10 @@ using System.IO;
using System.Collections; using System.Collections;
using System.Collections.Generic; 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 namespace MA_Texture
{ {
public static class MA_TextureUtils public static class MA_TextureUtils
{ {
/// <summary>
/// Some base converters and texture settings setters.
/// </summary>
public static Texture ConvertToReadableTexture(Texture texture) public static Texture ConvertToReadableTexture(Texture texture)
{ {
if (texture == null) if (texture == null)