3 Commits
1.7.1 ... 1.7.4

Author SHA1 Message Date
max
696ef848e0 Bugfixes: Texture point scale.
Bugfixes: Texture point scale.
Test Unity2019.3.
2020-04-13 18:03:44 +02:00
max
521cb34541 Bugfixes: Texture width as height & build errors.
Bugfixes: Texture width as height typo and project build errors.
2020-01-14 19:42:30 +01:00
max
d8c59e86ca Corrected Unity version for prefab support.
UNITY_2018_4_OR_NEWER -> UNITY_2018_3_OR_NEWER
2019-11-29 00:12:04 +01:00
6 changed files with 31 additions and 17 deletions

View File

@ -1,4 +1,5 @@
using UnityEngine;
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using MA_Texture;
using System.Collections.Generic;
@ -66,4 +67,5 @@ namespace MA_TextureAtlasserPro
Sprite,
SpriteSliced
}
}
}
#endif

View File

@ -62,7 +62,7 @@ namespace MA_Mesh
assetPath = savePath + prefabName + ".prefab";
#if UNITY_2018_4_OR_NEWER
#if UNITY_2018_3_OR_NEWER
PrefabUtility.SaveAsPrefabAsset(gameObject, assetPath);

View File

@ -41,7 +41,7 @@ namespace MA_Texture
RenderTexture.active = tmp;
// 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
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];
float ratioX = ((float)curWidth) / newWidth;
float ratioY = ((float)curHeight) / newHeight;
float ratioX = 1.0f / ((float)newWidth / (curWidth - 1));
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);
var yw = y * newWidth;
int yFloor = Mathf.FloorToInt(y * ratioY);
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)];
}
}

View File

@ -2,8 +2,7 @@
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.ext.nunit": "1.0.0",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.test-framework": "1.0.13",
"com.unity.test-framework": "1.1.9",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

View File

@ -3,7 +3,7 @@
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 9
m_ExternalVersionControlSupport: Hidden Meta Files
m_SerializationMode: 2
m_LineEndingsForNewScripts: 2
@ -16,10 +16,20 @@ EditorSettings:
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref
m_ProjectGenerationRootNamespace:
m_CollabEditorSettings:
inProgressEnabled: 1
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 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

View File

@ -1,2 +1,2 @@
m_EditorVersion: 2019.2.13f1
m_EditorVersionWithRevision: 2019.2.13f1 (e20f6c7e5017)
m_EditorVersion: 2019.3.0f6
m_EditorVersionWithRevision: 2019.3.0f6 (27ab2135bccf)