Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
e894fcf797 | |||
0dfa466d78 | |||
78f3daa145 | |||
406720d718 | |||
947eb6f18e | |||
279edb1e0e | |||
e7ce849108 | |||
13de8b8e2a |
58
.gitignore
vendored
@ -1,13 +1,33 @@
|
|||||||
[Ll]ibrary/
|
# ignore p4
|
||||||
[Tt]emp/
|
.p4ignore
|
||||||
[Oo]bj/
|
|
||||||
[Bb]uild/
|
# This .gitignore file should be placed at the root of your Unity project directory
|
||||||
[Bb]uilds/
|
#
|
||||||
Assets/AssetStoreTools*
|
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
|
||||||
|
#
|
||||||
|
/[Ll]ibrary/
|
||||||
|
/[Tt]emp/
|
||||||
|
/[Oo]bj/
|
||||||
|
/[Bb]uild/
|
||||||
|
/[Bb]uilds/
|
||||||
|
/[Ll]ogs/
|
||||||
|
/[Mm]emoryCaptures/
|
||||||
|
|
||||||
|
# Never ignore Asset meta data
|
||||||
|
!/[Aa]ssets/**/*.meta
|
||||||
|
|
||||||
|
# Uncomment this line if you wish to ignore the asset store tools plugin
|
||||||
|
/[Aa]ssets/AssetStoreTools*
|
||||||
|
|
||||||
|
# Autogenerated Jetbrains Rider plugin
|
||||||
|
[Aa]ssets/Plugins/Editor/JetBrains*
|
||||||
|
|
||||||
# Visual Studio cache directory
|
# Visual Studio cache directory
|
||||||
.vs/
|
.vs/
|
||||||
|
|
||||||
|
# Gradle cache directory
|
||||||
|
.gradle/
|
||||||
|
|
||||||
# Autogenerated VS/MD/Consulo solution and project files
|
# Autogenerated VS/MD/Consulo solution and project files
|
||||||
ExportedObj/
|
ExportedObj/
|
||||||
.consulo/
|
.consulo/
|
||||||
@ -22,22 +42,34 @@ ExportedObj/
|
|||||||
*.booproj
|
*.booproj
|
||||||
*.svd
|
*.svd
|
||||||
*.pdb
|
*.pdb
|
||||||
|
*.mdb
|
||||||
*.opendb
|
*.opendb
|
||||||
|
*.VC.db
|
||||||
|
|
||||||
# Unity3D generated meta files
|
# Unity3D generated meta files
|
||||||
*.pidb.meta
|
*.pidb.meta
|
||||||
*.pdb.meta
|
*.pdb.meta
|
||||||
|
*.mdb.meta
|
||||||
|
|
||||||
# Unity3D meta files (not needed for the git)
|
# Unity3D generated file on crash reports
|
||||||
*.meta
|
|
||||||
|
|
||||||
# Unity3D Generated File On Crash Reports
|
|
||||||
sysinfo.txt
|
sysinfo.txt
|
||||||
|
|
||||||
# Builds
|
# Builds
|
||||||
*.apk
|
*.apk
|
||||||
*.unitypackage
|
*.unitypackage
|
||||||
|
|
||||||
# WorkFiles
|
# Crashlytics generated file
|
||||||
*.psd
|
crashlytics-build.properties
|
||||||
*.fbx
|
|
||||||
|
# workfiles
|
||||||
|
MA_ToolBox/MA_TextureAtlasserPro/Atlasses/*
|
||||||
|
!Atlasses.txt
|
||||||
|
MA_ToolBox/MA_TextureAtlasserPro/Exports/*
|
||||||
|
!Exports.txt
|
||||||
|
MA_ToolBox/MA_TextureAtlasserPro/Settings/*
|
||||||
|
!Settings.txt
|
||||||
|
!MA_TextureAtlasserProSettings.asset
|
||||||
|
MA_ToolBox/MA_TextureAtlasserPro/Settings/ExportSettings/*
|
||||||
|
!ExportSettings.txt
|
||||||
|
!MA_DefaultExportSettings.asset
|
||||||
|
!MA_DefaultSpriteExportSettings.asset
|
8
Assets/MA_ToolBox.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b328187c4d5fec24c8a228ada84605a6
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_TextureAtlasserPro.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f40356e4c9590fc46a493c26a5fbf937
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519389465
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_TextureAtlasserPro/Icons.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9c7a2224cc47fce489a08fb2b34f797c
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519492248
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 1006 B After Width: | Height: | Size: 1006 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 60e555e14fc6a6345a5ee996a49886cb
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 08efa850d9174c947b67855c7813bc63
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 27381d6123e7e5b4eb9d79829b15c2ef
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e7a93919b4509be4aa9f6bd0bb61c1e7
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 05827eed0f3107e4c840c206ceccd7ee
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 1006 B After Width: | Height: | Size: 1006 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 25f247791349617498d1ab94bc82ed23
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 878 B After Width: | Height: | Size: 878 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9f3720ab6077d734780437442e00cd64
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d4c871fedd726904ca8aee58ef52f7a3
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 846 B After Width: | Height: | Size: 846 B |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 750fec6ea06f5504ba56751ecdf9de11
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,86 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6ed3341c780c2894488f04a7203770b9
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 4
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 0
|
||||||
|
sRGBTexture: 0
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapU: 1
|
||||||
|
wrapV: 1
|
||||||
|
wrapW: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 2
|
||||||
|
textureShape: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
platformSettings:
|
||||||
|
- buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
- buildTarget: Standalone
|
||||||
|
maxTextureSize: 32
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 2
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
21
Assets/MA_ToolBox/MA_TextureAtlasserPro/LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2019 Max Kruf
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
7
Assets/MA_ToolBox/MA_TextureAtlasserPro/LICENSE.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: daea7b193e8882449a5b12b2b7ac1e2a
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
1
Assets/MA_ToolBox/MA_TextureAtlasserPro/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
README: https://github.com/maxartz15/MA_TextureAtlasser/blob/master/README.md
|
7
Assets/MA_ToolBox/MA_TextureAtlasserPro/README.md.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b27eb5167882915458c9b7ce07b6e712
|
||||||
|
TextScriptImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_TextureAtlasserPro/Scripts.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 92654d379bc273e4a96514e5306df9e8
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519389476
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e50a55aa9cc7b30439e7923a3078b9f7
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519391732
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 892d1a7aeb4cc284dbf62e69e125db52
|
||||||
|
timeCreated: 1519392859
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -1,6 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using MA_Texture;
|
using MA_Texture;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MA_TextureAtlasserPro
|
namespace MA_TextureAtlasserPro
|
||||||
{
|
{
|
||||||
@ -10,16 +11,19 @@ namespace MA_TextureAtlasserPro
|
|||||||
[HideInInspector]
|
[HideInInspector]
|
||||||
public bool canModify = true;
|
public bool canModify = true;
|
||||||
|
|
||||||
|
public bool exportModels = true;
|
||||||
public ModelExportSettings modelExportSettings = new ModelExportSettings();
|
public ModelExportSettings modelExportSettings = new ModelExportSettings();
|
||||||
|
public bool exportTextures = true;
|
||||||
public TextureExportSettings textureExportSettings = new TextureExportSettings();
|
public TextureExportSettings textureExportSettings = new TextureExportSettings();
|
||||||
|
public bool exportMaterials = true;
|
||||||
|
public MaterialExportSettings materialExportSettings = new MaterialExportSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class ModelExportSettings
|
public class ModelExportSettings
|
||||||
{
|
{
|
||||||
[Header("Model settings:")]
|
[Header("Model settings:")]
|
||||||
public ModelFormat modelFormat = ModelFormat.Obj;
|
public ModelFormat modelFormat = ModelFormat.UnityMeshPrefab;
|
||||||
public bool replaceModel = false;
|
|
||||||
public bool uvFlipY = true;
|
public bool uvFlipY = true;
|
||||||
public int uvChannel = 0;
|
public int uvChannel = 0;
|
||||||
public bool uvWrap = true;
|
public bool uvWrap = true;
|
||||||
@ -34,17 +38,19 @@ namespace MA_TextureAtlasserPro
|
|||||||
public MA_TextureUtils.TextureScaleMode textureScaleMode = MA_TextureUtils.TextureScaleMode.Bilinear;
|
public MA_TextureUtils.TextureScaleMode textureScaleMode = MA_TextureUtils.TextureScaleMode.Bilinear;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ExportPreset
|
[System.Serializable]
|
||||||
|
public class MaterialExportSettings
|
||||||
{
|
{
|
||||||
Custom,
|
[Header("Material settings:")]
|
||||||
Default,
|
public Shader shader = null;
|
||||||
Sprites,
|
public List<string> shaderPropertyNames = new List<string>() { "_MainTex", "_MetallicGlossMap", "_BumpMap" };
|
||||||
ReplaceObjMeshes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ModelFormat
|
public enum ModelFormat
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
|
UnityMeshPrefab,
|
||||||
|
ReplaceMesh,
|
||||||
Obj
|
Obj
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f8eb652100ecb804dae35d0cca727164
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 16ad07a78750c7644b710e19e1a23d4a
|
||||||
|
timeCreated: 1519392859
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 73f5e66553c13034e9b894ef2cc31b66
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ad995f47c542a7f4d9148cd7d5c9cfda
|
||||||
|
timeCreated: 1520097393
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1a34d83791d6c9241a9051b316c58169
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519389484
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4dc196a605811ff4593b2c3d6eab83df
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519393169
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 64b4bb2ec0d18b142b6a5aa0c8dfb5c1
|
||||||
|
timeCreated: 1521838249
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,702 @@
|
|||||||
|
#if UNITY_EDITOR
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
using MA_Mesh;
|
||||||
|
using MA_Texture;
|
||||||
|
|
||||||
|
namespace MA_TextureAtlasserPro
|
||||||
|
{
|
||||||
|
public static class MA_TextureAtlasserProUtils
|
||||||
|
{
|
||||||
|
public const string TEXTURE_ATLASSER_PATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/";
|
||||||
|
public const string SETTINGS_ASSET_PATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Settings/";
|
||||||
|
public const string SAVE_ASSET_PATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Atlasses/";
|
||||||
|
public const string LOAD_ASSET_PATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Atlasses/";
|
||||||
|
public const string EXPORT_ASSET_PATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Exports/";
|
||||||
|
public const string TEMP_ASSET_PATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Temp/";
|
||||||
|
|
||||||
|
public const string DEFAULT_TEXTURE_GROUP_NAME = "Albedo";
|
||||||
|
public const float VIEW_OFFSET = 20;
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProSettings CreateSettings()
|
||||||
|
{
|
||||||
|
MA_TextureAtlasserProSettings _settings = ScriptableObject.CreateInstance<MA_TextureAtlasserProSettings>();
|
||||||
|
|
||||||
|
if (_settings != null)
|
||||||
|
{
|
||||||
|
CreateFolder(SETTINGS_ASSET_PATH);
|
||||||
|
AssetDatabase.CreateAsset(_settings, SETTINGS_ASSET_PATH + "MA_TextureAtlasserProSettings.asset");
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
return _settings;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProSettings LoadSettings()
|
||||||
|
{
|
||||||
|
MA_TextureAtlasserProSettings _settings = AssetDatabase.LoadAssetAtPath(SETTINGS_ASSET_PATH + "MA_TextureAtlasserProSettings.asset", typeof(MA_TextureAtlasserProSettings)) as MA_TextureAtlasserProSettings;
|
||||||
|
|
||||||
|
if (_settings == null)
|
||||||
|
{
|
||||||
|
_settings = CreateSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProExportSettings CreateExportSettings(string name, bool canModify = true)
|
||||||
|
{
|
||||||
|
MA_TextureAtlasserProExportSettings _settings = ScriptableObject.CreateInstance<MA_TextureAtlasserProExportSettings>();
|
||||||
|
_settings.canModify = canModify;
|
||||||
|
|
||||||
|
if (_settings != null)
|
||||||
|
{
|
||||||
|
_settings.materialExportSettings.shader = Shader.Find("Standard");
|
||||||
|
|
||||||
|
CreateFolder(EXPORT_ASSET_PATH);
|
||||||
|
AssetDatabase.CreateAsset(_settings, SETTINGS_ASSET_PATH + name + ".asset");
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
return _settings;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProExportSettings LoadExportSettings()
|
||||||
|
{
|
||||||
|
string name = "MA_DefaultExportSettings";
|
||||||
|
MA_TextureAtlasserProExportSettings _settings = AssetDatabase.LoadAssetAtPath(SETTINGS_ASSET_PATH + name + ".asset", typeof(MA_TextureAtlasserProExportSettings)) as MA_TextureAtlasserProExportSettings;
|
||||||
|
|
||||||
|
if (_settings == null)
|
||||||
|
{
|
||||||
|
_settings = CreateExportSettings(name, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProAtlas CreateTextureAtlas(string name, Vector2 size)
|
||||||
|
{
|
||||||
|
MA_TextureAtlasserProAtlas _atlas = ScriptableObject.CreateInstance<MA_TextureAtlasserProAtlas>();
|
||||||
|
|
||||||
|
if (_atlas != null)
|
||||||
|
{
|
||||||
|
_atlas.CreateAtlas(name, size);
|
||||||
|
MA_CheckTextureAtlas(_atlas);
|
||||||
|
|
||||||
|
CreateFolder(SAVE_ASSET_PATH);
|
||||||
|
AssetDatabase.CreateAsset(_atlas, SAVE_ASSET_PATH + name + ".asset");
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
return _atlas;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProAtlas LoadTextureAtlas()
|
||||||
|
{
|
||||||
|
MA_TextureAtlasserProAtlas _atlas = null;
|
||||||
|
string absPath = EditorUtility.OpenFilePanel("Select Texture Atlas", LOAD_ASSET_PATH, "");
|
||||||
|
|
||||||
|
if (absPath.StartsWith(Application.dataPath))
|
||||||
|
{
|
||||||
|
string relPath = absPath.Substring(Application.dataPath.Length - "Assets".Length);
|
||||||
|
_atlas = AssetDatabase.LoadAssetAtPath(relPath, typeof(MA_TextureAtlasserProAtlas)) as MA_TextureAtlasserProAtlas;
|
||||||
|
|
||||||
|
MA_CheckTextureAtlas(_atlas);
|
||||||
|
|
||||||
|
if (_atlas)
|
||||||
|
{
|
||||||
|
EditorPrefs.SetString("AtlasPath", null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_atlas != null)
|
||||||
|
{
|
||||||
|
if (_atlas.selectedTextureQuad != null)
|
||||||
|
{
|
||||||
|
_atlas.selectedTextureQuad.isSelected = false;
|
||||||
|
}
|
||||||
|
_atlas.selectedTextureQuad = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _atlas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void MA_CheckTextureAtlas(MA_TextureAtlasserProAtlas atlas)
|
||||||
|
{
|
||||||
|
if (atlas.textureGroupRegistration == null)
|
||||||
|
{
|
||||||
|
atlas.textureGroupRegistration = new List<MA_TextureGroupRegistration>();
|
||||||
|
|
||||||
|
MA_TextureGroupRegistration groupRegistration = new MA_TextureGroupRegistration
|
||||||
|
{
|
||||||
|
name = DEFAULT_TEXTURE_GROUP_NAME
|
||||||
|
};
|
||||||
|
|
||||||
|
atlas.textureGroupRegistration.Add(groupRegistration);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (atlas.textureQuads == null)
|
||||||
|
{
|
||||||
|
atlas.textureQuads = new List<MA_TextureAtlasserProQuad>();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool _sameCount = true;
|
||||||
|
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
if (q.textureGroups.Count != atlas.textureGroupRegistration.Count)
|
||||||
|
{
|
||||||
|
_sameCount = false;
|
||||||
|
Debug.LogWarning("TextureAtlasser: " + q.name + " doesn't have the right amount of texture groups!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_sameCount)
|
||||||
|
{
|
||||||
|
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < atlas.textureQuads.Count; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < atlas.textureGroupRegistration.Count; j++)
|
||||||
|
{
|
||||||
|
if (atlas.textureQuads[i].textureGroups[j].name != atlas.textureGroupRegistration[j].name)
|
||||||
|
{
|
||||||
|
Debug.LogWarning("TextureAtlasser: " + q.name + " doesn't have the right texture group name!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (atlas.exportSettings == null)
|
||||||
|
{
|
||||||
|
atlas.exportSettings = LoadExportSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MA_TextureAtlasserProQuad CreateTextureQuad(MA_TextureAtlasserProAtlas atlas, string name, Rect rect, bool focus = true)
|
||||||
|
{
|
||||||
|
if (atlas != null)
|
||||||
|
{
|
||||||
|
//Create new list if we haven't one already
|
||||||
|
if (atlas.textureQuads == null)
|
||||||
|
{
|
||||||
|
atlas.textureQuads = new List<MA_TextureAtlasserProQuad>();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create new quad
|
||||||
|
MA_TextureAtlasserProQuad _quad = ScriptableObject.CreateInstance<MA_TextureAtlasserProQuad>();
|
||||||
|
|
||||||
|
//Add quad to asset
|
||||||
|
if (_quad != null)
|
||||||
|
{
|
||||||
|
//Set quad settings
|
||||||
|
_quad.name = name;
|
||||||
|
_quad.rect = rect;
|
||||||
|
|
||||||
|
SetTextureGroups(atlas, _quad);
|
||||||
|
|
||||||
|
atlas.textureQuads.Add(_quad);
|
||||||
|
|
||||||
|
AssetDatabase.AddObjectToAsset(_quad, atlas);
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
if (focus)
|
||||||
|
{
|
||||||
|
atlas.selectedTextureQuad = atlas.textureQuads[atlas.textureQuads.Count - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
return _quad;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("CreateTextureQuad Failed: _TextureQuad");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError("CreateTextureQuad Failed: textureAtlas");
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RemoveTextureQuad(MA_TextureAtlasserProAtlas atlas, bool focus = true)
|
||||||
|
{
|
||||||
|
if (atlas != null && atlas.selectedTextureQuad != null)
|
||||||
|
{
|
||||||
|
int _index = atlas.textureQuads.IndexOf(atlas.selectedTextureQuad);
|
||||||
|
|
||||||
|
atlas.textureQuads.RemoveAt(_index);
|
||||||
|
Object.DestroyImmediate(atlas.selectedTextureQuad, true);
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
if (focus && atlas.textureQuads.Count > 0)
|
||||||
|
{
|
||||||
|
_index = Mathf.Clamp(_index, 0, atlas.textureQuads.Count - 1);
|
||||||
|
atlas.selectedTextureQuad = atlas.textureQuads[_index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DuplicateTextureQuad(MA_TextureAtlasserProAtlas atlas, bool focus = true, bool copyData = false, string namePrefix = "new ")
|
||||||
|
{
|
||||||
|
if (atlas != null && atlas.selectedTextureQuad != null)
|
||||||
|
{
|
||||||
|
MA_TextureAtlasserProQuad q = CreateTextureQuad(atlas, namePrefix + atlas.selectedTextureQuad.name, atlas.selectedTextureQuad.rect, false);
|
||||||
|
|
||||||
|
if (copyData)
|
||||||
|
{
|
||||||
|
q.meshes = new List<Mesh>();
|
||||||
|
for (int i = 0; i < atlas.selectedTextureQuad.meshes.Count; i++)
|
||||||
|
{
|
||||||
|
q.meshes.Add(atlas.selectedTextureQuad.meshes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < atlas.selectedTextureQuad.textureGroups.Count; i++)
|
||||||
|
{
|
||||||
|
q.textureGroups[i].texture = atlas.selectedTextureQuad.textureGroups[i].texture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (focus)
|
||||||
|
{
|
||||||
|
atlas.selectedTextureQuad = q;
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetTextureGroups(MA_TextureAtlasserProAtlas atlas, MA_TextureAtlasserProQuad quad)
|
||||||
|
{
|
||||||
|
if (quad.textureGroups == null)
|
||||||
|
{
|
||||||
|
quad.textureGroups = new List<MA_TextureGroup>();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Add texture groups
|
||||||
|
foreach (MA_TextureGroupRegistration tgr in atlas.textureGroupRegistration)
|
||||||
|
{
|
||||||
|
MA_TextureGroup textureGroup = new MA_TextureGroup
|
||||||
|
{
|
||||||
|
name = tgr.name
|
||||||
|
};
|
||||||
|
quad.textureGroups.Add(textureGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreateTextureGroup(MA_TextureAtlasserProAtlas atlas, string name)
|
||||||
|
{
|
||||||
|
MA_TextureGroupRegistration _textureGroupRegistration = new MA_TextureGroupRegistration
|
||||||
|
{
|
||||||
|
name = name
|
||||||
|
};
|
||||||
|
atlas.textureGroupRegistration.Add(_textureGroupRegistration);
|
||||||
|
|
||||||
|
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
MA_TextureGroup _textureGroup = new MA_TextureGroup
|
||||||
|
{
|
||||||
|
name = name
|
||||||
|
};
|
||||||
|
q.textureGroups.Add(_textureGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RemoveTextureGroup(MA_TextureAtlasserProAtlas atlas, int index)
|
||||||
|
{
|
||||||
|
atlas.textureGroupRegistration.RemoveAt(index);
|
||||||
|
|
||||||
|
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
q.textureGroups.RemoveAt(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CloseWindow(MA_TextureAtlasserProWindow curWindow)
|
||||||
|
{
|
||||||
|
if (curWindow == null)
|
||||||
|
{
|
||||||
|
Debug.LogError("Closing window Failed: curWindow == null");
|
||||||
|
}
|
||||||
|
curWindow.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsPowerOfTwo(int value)
|
||||||
|
{
|
||||||
|
//While x is even and > 1
|
||||||
|
while (((value % 2) == 0) && value > 1)
|
||||||
|
{
|
||||||
|
value /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (value == 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void CreateFolder(string folderPath)
|
||||||
|
{
|
||||||
|
if (folderPath.LastIndexOf('/') == folderPath.Length - 1)
|
||||||
|
{
|
||||||
|
folderPath = folderPath.Remove(folderPath.LastIndexOf('/'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!AssetDatabase.IsValidFolder(folderPath))
|
||||||
|
{
|
||||||
|
string parentPath = folderPath.Substring(0, folderPath.LastIndexOf('/'));
|
||||||
|
string folderName = folderPath.Substring(folderPath.LastIndexOf('/') + 1);
|
||||||
|
|
||||||
|
AssetDatabase.CreateFolder(parentPath, folderName);
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DeleteFolder(string folderPath)
|
||||||
|
{
|
||||||
|
if (folderPath.LastIndexOf('/') == folderPath.Length - 1)
|
||||||
|
{
|
||||||
|
folderPath = folderPath.Remove(folderPath.LastIndexOf('/'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AssetDatabase.IsValidFolder(folderPath))
|
||||||
|
{
|
||||||
|
AssetDatabase.DeleteAsset(folderPath);
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Export
|
||||||
|
public static string[] ExportAtlasModels(MA_TextureAtlasserProAtlas atlas, ModelExportSettings modelExportSettings, string material = null, string savePath = EXPORT_ASSET_PATH)
|
||||||
|
{
|
||||||
|
switch (modelExportSettings.modelFormat)
|
||||||
|
{
|
||||||
|
case ModelFormat.None:
|
||||||
|
break;
|
||||||
|
case ModelFormat.ReplaceMesh:
|
||||||
|
ReplaceAtlasMesh(atlas, modelExportSettings, savePath: savePath);
|
||||||
|
break;
|
||||||
|
case ModelFormat.UnityMeshPrefab:
|
||||||
|
return ExportAtlasUnityMeshPrefab(atlas, modelExportSettings, material: material, savePath: savePath);
|
||||||
|
case ModelFormat.Obj:
|
||||||
|
return ExportAtlasObj(atlas, modelExportSettings, savePath: savePath);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ReplaceAtlasMesh(MA_TextureAtlasserProAtlas atlas, ModelExportSettings modelExportSettings, string savePath = EXPORT_ASSET_PATH)
|
||||||
|
{
|
||||||
|
if (atlas == null || atlas.textureQuads == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var quads = atlas.textureQuads;
|
||||||
|
for (var index = 0; index < quads.Count; index++)
|
||||||
|
{
|
||||||
|
var quad = quads[index];
|
||||||
|
if (quad.meshes == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var meshes = quad.meshes;
|
||||||
|
for (var meshIndex = 0; meshIndex < quad.meshes.Count; meshIndex++)
|
||||||
|
{
|
||||||
|
if (meshes[meshIndex] == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
MA_MeshUtils.MA_UVReMap(meshes[meshIndex], atlas.textureAtlasSize, quad.guiRect, modelExportSettings.uvChannel, modelExportSettings.uvFlipY, modelExportSettings.uvWrap);
|
||||||
|
EditorUtility.SetDirty(meshes[meshIndex]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string[] ExportAtlasUnityMeshPrefab(MA_TextureAtlasserProAtlas atlas, ModelExportSettings modelExportSettings, string material = null, string savePath = EXPORT_ASSET_PATH)
|
||||||
|
{
|
||||||
|
if (atlas == null || atlas.textureQuads == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
List<string> assetPaths = new List<string>();
|
||||||
|
|
||||||
|
foreach (MA_TextureAtlasserProQuad quad in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
//Export Mesh
|
||||||
|
if (quad.meshes != null)
|
||||||
|
{
|
||||||
|
for (int m = 0; m < quad.meshes.Count; m++)
|
||||||
|
{
|
||||||
|
if (quad.meshes[m] != null)
|
||||||
|
{
|
||||||
|
//Create new mesh
|
||||||
|
Mesh newMesh = new Mesh();
|
||||||
|
//Duplicate it from the current one
|
||||||
|
newMesh = MA_MeshUtils.MA_DuplicateMesh(quad.meshes[m]);
|
||||||
|
//Remap UV's
|
||||||
|
newMesh = MA_MeshUtils.MA_UVReMap(newMesh, atlas.textureAtlasSize, quad.guiRect, modelExportSettings.uvChannel, modelExportSettings.uvFlipY, modelExportSettings.uvWrap);
|
||||||
|
//Set name
|
||||||
|
string meshName = string.IsNullOrEmpty(quad.name) ? "" : quad.name + "-";
|
||||||
|
meshName += quad.meshes[m].name;
|
||||||
|
int n = m + 1;
|
||||||
|
meshName += "_" + n.ToString("#000");
|
||||||
|
newMesh.name = meshName;
|
||||||
|
//Save it
|
||||||
|
string asset = MA_MeshUtils.MA_SaveMeshPrefab(newMesh, meshName, savePath, materialPath: material);
|
||||||
|
assetPaths.Add(asset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return assetPaths.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string[] ExportAtlasObj(MA_TextureAtlasserProAtlas atlas, ModelExportSettings modelExportSettings, string savePath = EXPORT_ASSET_PATH)
|
||||||
|
{
|
||||||
|
if (atlas == null || atlas.textureQuads == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
List<string> assetPaths = new List<string>();
|
||||||
|
|
||||||
|
foreach (MA_TextureAtlasserProQuad quad in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
//Export Mesh
|
||||||
|
if (quad.meshes != null)
|
||||||
|
{
|
||||||
|
for (int m = 0; m < quad.meshes.Count; m++)
|
||||||
|
{
|
||||||
|
if (quad.meshes[m] != null)
|
||||||
|
{
|
||||||
|
//Create new mesh
|
||||||
|
Mesh newMesh = new Mesh();
|
||||||
|
//Duplicate it from the current one
|
||||||
|
newMesh = MA_MeshUtils.MA_DuplicateMesh(quad.meshes[m]);
|
||||||
|
//Remap UV's
|
||||||
|
newMesh = MA_MeshUtils.MA_UVReMap(newMesh, atlas.textureAtlasSize, quad.guiRect, modelExportSettings.uvChannel, modelExportSettings.uvFlipY, modelExportSettings.uvWrap);
|
||||||
|
//Save it
|
||||||
|
string meshName = string.IsNullOrEmpty(quad.name) ? "" : quad.name + "-";
|
||||||
|
meshName += quad.meshes[m].name;
|
||||||
|
int n = m + 1;
|
||||||
|
meshName += "_" + n.ToString("#000");
|
||||||
|
|
||||||
|
string asset = MA_MeshUtils.MeshToFile(newMesh, meshName, savePath);
|
||||||
|
assetPaths.Add(asset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return assetPaths.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string[] ExportAtlasTextures(MA_TextureAtlasserProAtlas atlas, TextureExportSettings textureExportSettings, string savePath = EXPORT_ASSET_PATH, string tempPath = TEXTURE_ATLASSER_PATH)
|
||||||
|
{
|
||||||
|
switch (textureExportSettings.textureFormat)
|
||||||
|
{
|
||||||
|
case TextureFormat.None:
|
||||||
|
break;
|
||||||
|
case TextureFormat.Png:
|
||||||
|
return ExportAtlasPNG(atlas, textureExportSettings, savePath);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string[] ExportAtlasPNG(MA_TextureAtlasserProAtlas atlas, TextureExportSettings textureExportSettings, string savePath = EXPORT_ASSET_PATH, string tempPath = TEMP_ASSET_PATH)
|
||||||
|
{
|
||||||
|
if (atlas == null || atlas.textureQuads == null || atlas.textureGroupRegistration == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
string[] assetPaths = new string[atlas.textureGroupRegistration.Count];
|
||||||
|
|
||||||
|
//Create temp folder
|
||||||
|
CreateFolder(tempPath);
|
||||||
|
|
||||||
|
//Foreach texture group
|
||||||
|
for (int i = 0; i < atlas.textureGroupRegistration.Count; i++)
|
||||||
|
{
|
||||||
|
//Create new Texture Atlas
|
||||||
|
Texture2D newTexture = new Texture2D((int)atlas.textureAtlasSize.x, (int)atlas.textureAtlasSize.y)
|
||||||
|
{
|
||||||
|
name = atlas.name + "_" + atlas.textureGroupRegistration[i].name
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
if (q.textureGroups != null && q.textureGroups[i].texture != null)
|
||||||
|
{
|
||||||
|
//Make temp copy
|
||||||
|
string orginalTexturePath = AssetDatabase.GetAssetPath(q.textureGroups[i].texture);
|
||||||
|
string orginalTextureExtension = System.IO.Path.GetExtension(orginalTexturePath);
|
||||||
|
|
||||||
|
string tempTexturePath = tempPath + q.textureGroups[i].texture.name + orginalTextureExtension;
|
||||||
|
AssetDatabase.CopyAsset(orginalTexturePath, tempTexturePath);
|
||||||
|
|
||||||
|
//Set temp copy to default settings
|
||||||
|
TextureImporter tempTextureImporter = (TextureImporter)AssetImporter.GetAtPath(tempTexturePath);
|
||||||
|
tempTextureImporter.textureType = TextureImporterType.Default;
|
||||||
|
tempTextureImporter.sRGBTexture = false;
|
||||||
|
tempTextureImporter.alphaIsTransparency = false;
|
||||||
|
tempTextureImporter.maxTextureSize = (int)Mathf.Max(atlas.textureAtlasSize.x, atlas.textureAtlasSize.y);
|
||||||
|
tempTextureImporter.textureCompression = TextureImporterCompression.Uncompressed;
|
||||||
|
tempTextureImporter.SaveAndReimport();
|
||||||
|
|
||||||
|
//Load temp copy
|
||||||
|
Texture tempCopy = AssetDatabase.LoadAssetAtPath<Texture>(tempTextureImporter.assetPath);
|
||||||
|
|
||||||
|
//Create new texture part
|
||||||
|
Texture2D newTexturePart = (Texture2D)MA_TextureUtils.ConvertToReadableTexture(tempCopy);
|
||||||
|
|
||||||
|
//Scale it
|
||||||
|
newTexturePart = newTexturePart.MA_Scale2D((int)q.guiRect.width, (int)q.guiRect.height, textureExportSettings.textureScaleMode);
|
||||||
|
|
||||||
|
//Add it
|
||||||
|
newTexture = newTexture.MA_Combine2D(newTexturePart, (int)q.guiRect.x, (int)q.guiRect.y);
|
||||||
|
|
||||||
|
//Delete temp copy
|
||||||
|
AssetDatabase.DeleteAsset(tempTextureImporter.assetPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Save it
|
||||||
|
newTexture.MA_Save2D(newTexture.name, savePath);
|
||||||
|
|
||||||
|
assetPaths[i] = (savePath + newTexture.name + '.' + textureExportSettings.textureFormat.ToString());
|
||||||
|
|
||||||
|
//Set settings.
|
||||||
|
switch (textureExportSettings.textureType)
|
||||||
|
{
|
||||||
|
case TextureType.Default:
|
||||||
|
{
|
||||||
|
TextureImporter textureImporter = (TextureImporter)AssetImporter.GetAtPath(savePath + newTexture.name + '.' + textureExportSettings.textureFormat.ToString());
|
||||||
|
textureImporter.textureType = TextureImporterType.Default;
|
||||||
|
textureImporter.SaveAndReimport();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TextureType.Sprite:
|
||||||
|
SetAtlasSpriteSettings(atlas, textureExportSettings, savePath);
|
||||||
|
break;
|
||||||
|
case TextureType.SpriteSliced:
|
||||||
|
SetAtlasSpriteSettings(atlas, textureExportSettings, savePath);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Delete temp folder
|
||||||
|
DeleteFolder(tempPath);
|
||||||
|
|
||||||
|
//Refresh
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
return assetPaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void SetAtlasSpriteSettings(MA_TextureAtlasserProAtlas atlas, TextureExportSettings textureExportSettings, string savePath = EXPORT_ASSET_PATH)
|
||||||
|
{
|
||||||
|
//Foreach texture group
|
||||||
|
for (int i = 0; i < atlas.textureGroupRegistration.Count; i++)
|
||||||
|
{
|
||||||
|
//Convert
|
||||||
|
string textureName = atlas.name + "_" + atlas.textureGroupRegistration[i].name + '.' + textureExportSettings.textureFormat.ToString();
|
||||||
|
TextureImporter textureImporter = (TextureImporter)AssetImporter.GetAtPath(savePath + textureName);
|
||||||
|
textureImporter.textureType = TextureImporterType.Sprite;
|
||||||
|
textureImporter.alphaIsTransparency = true;
|
||||||
|
|
||||||
|
//Slice sprites.
|
||||||
|
if (textureExportSettings.textureType == TextureType.SpriteSliced)
|
||||||
|
{
|
||||||
|
textureImporter.spriteImportMode = SpriteImportMode.None; //Reset it to update?
|
||||||
|
textureImporter.spriteImportMode = SpriteImportMode.Multiple;
|
||||||
|
List<SpriteMetaData> spriteMetaData = new List<SpriteMetaData>();
|
||||||
|
|
||||||
|
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
||||||
|
{
|
||||||
|
if (q.textureGroups != null && q.textureGroups[i].texture != null)
|
||||||
|
{
|
||||||
|
//Create new SpriteMetaData.
|
||||||
|
SpriteMetaData smd = new SpriteMetaData
|
||||||
|
{
|
||||||
|
name = q.name,
|
||||||
|
rect = new Rect(q.guiRect.x, atlas.textureAtlasSize.y - q.guiRect.y - q.guiRect.height, q.guiRect.width, q.guiRect.height)
|
||||||
|
};
|
||||||
|
|
||||||
|
spriteMetaData.Add(smd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
textureImporter.spritesheet = spriteMetaData.ToArray();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textureImporter.spriteImportMode = SpriteImportMode.Single;
|
||||||
|
}
|
||||||
|
|
||||||
|
textureImporter.SaveAndReimport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string ExportAtlasMaterial(MA_TextureAtlasserProAtlas atlas, MaterialExportSettings materialExportSettings, string[] textures = null, string savePath = EXPORT_ASSET_PATH)
|
||||||
|
{
|
||||||
|
if (atlas == null || atlas.textureQuads == null || atlas.textureGroupRegistration == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
string assetPath = "";
|
||||||
|
|
||||||
|
Shader shader = materialExportSettings.shader;
|
||||||
|
if (shader)
|
||||||
|
{
|
||||||
|
Material material = new Material(shader)
|
||||||
|
{
|
||||||
|
name = atlas.name
|
||||||
|
};
|
||||||
|
|
||||||
|
if (textures != null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < (int)Mathf.Min(materialExportSettings.shaderPropertyNames.Count, textures.Length); i++)
|
||||||
|
{
|
||||||
|
Texture t = AssetDatabase.LoadAssetAtPath<Texture>(textures[i]);
|
||||||
|
if (t != null)
|
||||||
|
{
|
||||||
|
material.SetTexture(materialExportSettings.shaderPropertyNames[i], t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assetPath = savePath + material.name + ".mat";
|
||||||
|
|
||||||
|
//Save material
|
||||||
|
AssetDatabase.CreateAsset(material, assetPath);
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
return assetPath;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 69c76c8a2967c4745a76f5bf5b494f7a
|
||||||
|
timeCreated: 1519393169
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 39bd4da4fed5aaf41858e1e23240cfca
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519389501
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b40a2786b518d6e41bfca3c464c9630e
|
||||||
|
timeCreated: 1519763882
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -11,11 +11,13 @@ namespace MA_TextureAtlasserPro
|
|||||||
{
|
{
|
||||||
private MA_TextureAtlasserProQuad lastSelectedQuad;
|
private MA_TextureAtlasserProQuad lastSelectedQuad;
|
||||||
|
|
||||||
private bool isEditing = false;
|
private bool isEditing = false;
|
||||||
|
|
||||||
private GUIStyle labelStyle = new GUIStyle(GUI.skin.label);
|
private GUIStyle labelStyle = new GUIStyle(GUI.skin.label);
|
||||||
|
|
||||||
public MA_TextureAtlasserProInspectorView(MA_TextureAtlasserProWindow currentEditorWindow, string title) : base(currentEditorWindow, title)
|
bool useAddMeshButton = false;
|
||||||
|
|
||||||
|
public MA_TextureAtlasserProInspectorView(MA_TextureAtlasserProWindow currentEditorWindow, string title) : base(currentEditorWindow, title)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -30,8 +32,21 @@ namespace MA_TextureAtlasserPro
|
|||||||
//Draw inspector
|
//Draw inspector
|
||||||
if(curWindow.textureAtlas != null && curWindow.textureAtlas.selectedTextureQuad != null)
|
if(curWindow.textureAtlas != null && curWindow.textureAtlas.selectedTextureQuad != null)
|
||||||
{
|
{
|
||||||
//Deselect GUI elements when we are focusing on a new quad
|
//Change layout during layout event to prevent gui errors
|
||||||
if(lastSelectedQuad != curWindow.textureAtlas.selectedTextureQuad)
|
if (e.type == EventType.Layout)
|
||||||
|
{
|
||||||
|
if (curWindow.textureAtlas.selectedTextureQuad.meshes != null && curWindow.textureAtlas.selectedTextureQuad.meshes.Count == 0)
|
||||||
|
{
|
||||||
|
useAddMeshButton = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
useAddMeshButton = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Deselect GUI elements when we are focusing on a new quad
|
||||||
|
if (lastSelectedQuad != curWindow.textureAtlas.selectedTextureQuad)
|
||||||
{
|
{
|
||||||
lastSelectedQuad = curWindow.textureAtlas.selectedTextureQuad;
|
lastSelectedQuad = curWindow.textureAtlas.selectedTextureQuad;
|
||||||
GUI.FocusControl(null);
|
GUI.FocusControl(null);
|
||||||
@ -43,7 +58,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
GUILayout.Label("Quad Name");
|
GUILayout.Label("Quad Name");
|
||||||
curWindow.textureAtlas.selectedTextureQuad.name = EditorGUILayout.TextField(curWindow.textureAtlas.selectedTextureQuad.name);
|
curWindow.textureAtlas.selectedTextureQuad.name = EditorGUILayout.TextField(curWindow.textureAtlas.selectedTextureQuad.name);
|
||||||
|
|
||||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEWOFFSET / 2);
|
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET / 2);
|
||||||
|
|
||||||
//Textures
|
//Textures
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
@ -83,19 +98,20 @@ namespace MA_TextureAtlasserPro
|
|||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEWOFFSET / 2);
|
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET / 2);
|
||||||
|
|
||||||
//Meshes
|
//Meshes
|
||||||
GUILayout.Label("Meshes");
|
GUILayout.Label("Meshes");
|
||||||
if(curWindow.textureAtlas.selectedTextureQuad.meshes != null)
|
if (useAddMeshButton)
|
||||||
|
{
|
||||||
|
if (GUILayout.Button("+", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
|
||||||
|
{
|
||||||
|
curWindow.textureAtlas.selectedTextureQuad.meshes.Add(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (curWindow.textureAtlas.selectedTextureQuad.meshes != null)
|
||||||
{
|
{
|
||||||
if(curWindow.textureAtlas.selectedTextureQuad.meshes.Count == 0)
|
|
||||||
{
|
|
||||||
if(GUILayout.Button("+", EditorStyles.miniButton, GUILayout.ExpandWidth(true)))
|
|
||||||
{
|
|
||||||
curWindow.textureAtlas.selectedTextureQuad.meshes.Add(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (int i = 0; i < curWindow.textureAtlas.selectedTextureQuad.meshes.Count; i++)
|
for (int i = 0; i < curWindow.textureAtlas.selectedTextureQuad.meshes.Count; i++)
|
||||||
{
|
{
|
||||||
GUILayout.BeginHorizontal();
|
GUILayout.BeginHorizontal();
|
||||||
@ -106,7 +122,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
}
|
}
|
||||||
if(GUILayout.Button("+", EditorStyles.miniButtonRight, GUILayout.ExpandWidth(false)))
|
if(GUILayout.Button("+", EditorStyles.miniButtonRight, GUILayout.ExpandWidth(false)))
|
||||||
{
|
{
|
||||||
curWindow.textureAtlas.selectedTextureQuad.meshes.Insert(i, null);
|
curWindow.textureAtlas.selectedTextureQuad.meshes.Insert(i + 1, null);
|
||||||
}
|
}
|
||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
@ -116,20 +132,21 @@ namespace MA_TextureAtlasserPro
|
|||||||
curWindow.textureAtlas.selectedTextureQuad.meshes = new List<Mesh>();
|
curWindow.textureAtlas.selectedTextureQuad.meshes = new List<Mesh>();
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.FlexibleSpace();
|
|
||||||
if(!MA_TextureAtlasserProUtils.IsPowerOfTwo((int)curWindow.textureAtlas.selectedTextureQuad.guiRect.width) || !MA_TextureAtlasserProUtils.IsPowerOfTwo((int)curWindow.textureAtlas.selectedTextureQuad.guiRect.height))
|
|
||||||
{
|
|
||||||
labelStyle.normal.textColor = Color.red;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
labelStyle.normal.textColor = Color.black;
|
|
||||||
}
|
|
||||||
|
|
||||||
GUILayout.Label("x " + curWindow.textureAtlas.selectedTextureQuad.guiRect.x.ToString() + ", y " + curWindow.textureAtlas.selectedTextureQuad.guiRect.y.ToString());
|
GUILayout.FlexibleSpace();
|
||||||
GUILayout.Label("w " + curWindow.textureAtlas.selectedTextureQuad.guiRect.width.ToString() + ", h " + curWindow.textureAtlas.selectedTextureQuad.guiRect.height.ToString(), labelStyle);
|
if (!MA_TextureAtlasserProUtils.IsPowerOfTwo((int)curWindow.textureAtlas.selectedTextureQuad.guiRect.width) || !MA_TextureAtlasserProUtils.IsPowerOfTwo((int)curWindow.textureAtlas.selectedTextureQuad.guiRect.height))
|
||||||
|
{
|
||||||
|
labelStyle.normal.textColor = Color.red;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
labelStyle.normal.textColor = Color.black;
|
||||||
|
}
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
GUILayout.Label("x " + curWindow.textureAtlas.selectedTextureQuad.guiRect.x.ToString() + ", y " + curWindow.textureAtlas.selectedTextureQuad.guiRect.y.ToString());
|
||||||
|
GUILayout.Label("w " + curWindow.textureAtlas.selectedTextureQuad.guiRect.width.ToString() + ", h " + curWindow.textureAtlas.selectedTextureQuad.guiRect.height.ToString(), labelStyle);
|
||||||
|
|
||||||
|
GUILayout.EndVertical();
|
||||||
GUILayout.EndArea();
|
GUILayout.EndArea();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f17051e9a63503f4da7866616d67a6a2
|
||||||
|
timeCreated: 1519505909
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -41,7 +41,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
MA_TextureAtlasserProExportWindow.InitEditorWindow(curWindow);
|
MA_TextureAtlasserProExportWindow.InitEditorWindow(curWindow);
|
||||||
//MA_TextureAtlasserProUtils.ExportAtlas(curWindow.textureAtlas);
|
//MA_TextureAtlasserProUtils.ExportAtlas(curWindow.textureAtlas);
|
||||||
}
|
}
|
||||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEWOFFSET);
|
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_TextureAtlasserProIcons.showTexturesOnIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||||
{
|
{
|
||||||
curWindow.textureAtlas.showTextures = false;
|
curWindow.textureAtlas.showTextures = false;
|
||||||
@ -50,7 +50,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
{
|
{
|
||||||
curWindow.textureAtlas.showTextures = true;
|
curWindow.textureAtlas.showTextures = true;
|
||||||
}
|
}
|
||||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEWOFFSET);
|
GUILayout.Space(MA_TextureAtlasserProUtils.VIEW_OFFSET);
|
||||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.createQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
if(GUILayout.Button(MA_TextureAtlasserProIcons.createQuadIcon, 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);
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bed32b77d058ea141ac98ceac0159297
|
||||||
|
timeCreated: 1519392331
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0ad6305c01639b64f8defe0ce7d26067
|
||||||
|
timeCreated: 1518210556
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6385799201fcbf246a8076f7fb2f4664
|
||||||
|
timeCreated: 1519389695
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0bf15f61e8c967348960f91d78ef05ac
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1519389493
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -47,7 +47,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
void OnGUI()
|
void OnGUI()
|
||||||
{
|
{
|
||||||
GUILayout.BeginArea(new Rect(MA_TextureAtlasserProUtils.VIEWOFFSET, MA_TextureAtlasserProUtils.VIEWOFFSET, position.width - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2), position.height - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2)));
|
GUILayout.BeginArea(new Rect(MA_TextureAtlasserProUtils.VIEW_OFFSET, MA_TextureAtlasserProUtils.VIEW_OFFSET, position.width - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2), position.height - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2)));
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
|
|
||||||
//Input options
|
//Input options
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 00058117c24864541a3f85fc4f18f89e
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -95,7 +95,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
if(isLoaded)
|
if(isLoaded)
|
||||||
{
|
{
|
||||||
GUILayout.BeginArea(new Rect(MA_TextureAtlasserProUtils.VIEWOFFSET, MA_TextureAtlasserProUtils.VIEWOFFSET, position.width - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2), position.height - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2)));
|
GUILayout.BeginArea(new Rect(MA_TextureAtlasserProUtils.VIEW_OFFSET, MA_TextureAtlasserProUtils.VIEW_OFFSET, position.width - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2), position.height - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2)));
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
|
|
||||||
//Input options
|
//Input options
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: fadd3a216ba8658458040ed46c0d032e
|
||||||
|
timeCreated: 1519504375
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -10,7 +10,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
{
|
{
|
||||||
public class MA_TextureAtlasserProExportWindow : EditorWindow
|
public class MA_TextureAtlasserProExportWindow : EditorWindow
|
||||||
{
|
{
|
||||||
private const int windowHeight = 300;
|
private const int windowHeight = 385;
|
||||||
private const int windowWidth = 320;
|
private const int windowWidth = 320;
|
||||||
|
|
||||||
//Editor
|
//Editor
|
||||||
@ -19,6 +19,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
//Data
|
//Data
|
||||||
private static bool isLoaded = false; //Make sure we wait a frame at the start to setup and don't draw.
|
private static bool isLoaded = false; //Make sure we wait a frame at the start to setup and don't draw.
|
||||||
|
private Vector2 scrollPos;
|
||||||
|
|
||||||
[MenuItem("MA_ToolKit/MA_TextureAtlasserPro/Export Atlas")]
|
[MenuItem("MA_ToolKit/MA_TextureAtlasserPro/Export Atlas")]
|
||||||
private static void Init()
|
private static void Init()
|
||||||
@ -88,11 +89,10 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
if(isLoaded)
|
if(isLoaded)
|
||||||
{
|
{
|
||||||
GUILayout.BeginArea(new Rect(MA_TextureAtlasserProUtils.VIEWOFFSET, MA_TextureAtlasserProUtils.VIEWOFFSET, position.width - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2), position.height - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2)));
|
GUILayout.BeginArea(new Rect(MA_TextureAtlasserProUtils.VIEW_OFFSET, MA_TextureAtlasserProUtils.VIEW_OFFSET, position.width - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2), position.height - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2)));
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
|
|
||||||
|
if (curWindow != null && curWindow.textureAtlas != null)
|
||||||
if(curWindow != null && curWindow.textureAtlas != null)
|
|
||||||
{
|
{
|
||||||
//Export
|
//Export
|
||||||
GUILayout.BeginVertical();
|
GUILayout.BeginVertical();
|
||||||
@ -102,7 +102,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
if(curWindow.textureAtlas.exportSettings != null)
|
if(curWindow.textureAtlas.exportSettings != null)
|
||||||
{
|
{
|
||||||
DrawExportAdvancedOptions();
|
DrawExportOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.EndVertical();
|
GUILayout.EndVertical();
|
||||||
@ -154,8 +154,41 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
if (GUILayout.Button("Export", GUILayout.ExpandWidth(true), GUILayout.Height(37)))
|
if (GUILayout.Button("Export", GUILayout.ExpandWidth(true), GUILayout.Height(37)))
|
||||||
{
|
{
|
||||||
MA_TextureAtlasserProUtils.ExportAtlasModels(curWindow.textureAtlas, curWindow.textureAtlas.exportSettings.modelExportSettings);
|
bool export = false;
|
||||||
MA_TextureAtlasserProUtils.ExportAtlasTextures(curWindow.textureAtlas, curWindow.textureAtlas.exportSettings.textureExportSettings);
|
|
||||||
|
if(curWindow.textureAtlas.exportSettings.modelExportSettings.modelFormat == ModelFormat.ReplaceMesh)
|
||||||
|
{
|
||||||
|
if(EditorUtility.DisplayDialog("Replace original models?", "Are you sure you want to replace the original models, this can't be undone!", "Replace", "Cancel"))
|
||||||
|
{
|
||||||
|
export = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
export = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(export)
|
||||||
|
{
|
||||||
|
string[] textures = null;
|
||||||
|
string material = null;
|
||||||
|
string[] models = null;
|
||||||
|
|
||||||
|
if (curWindow.textureAtlas.exportSettings.exportTextures)
|
||||||
|
{
|
||||||
|
textures = MA_TextureAtlasserProUtils.ExportAtlasTextures(curWindow.textureAtlas, curWindow.textureAtlas.exportSettings.textureExportSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(curWindow.textureAtlas.exportSettings.exportMaterials)
|
||||||
|
{
|
||||||
|
material = MA_TextureAtlasserProUtils.ExportAtlasMaterial(curWindow.textureAtlas, curWindow.textureAtlas.exportSettings.materialExportSettings, textures: textures);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(curWindow.textureAtlas.exportSettings.exportModels)
|
||||||
|
{
|
||||||
|
models = MA_TextureAtlasserProUtils.ExportAtlasModels(curWindow.textureAtlas, curWindow.textureAtlas.exportSettings.modelExportSettings, material: material);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUI.enabled = wasEnabled;
|
GUI.enabled = wasEnabled;
|
||||||
@ -163,7 +196,7 @@ namespace MA_TextureAtlasserPro
|
|||||||
GUILayout.EndHorizontal();
|
GUILayout.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawExportAdvancedOptions()
|
private void DrawExportOptions()
|
||||||
{
|
{
|
||||||
bool wasEnabled = GUI.enabled;
|
bool wasEnabled = GUI.enabled;
|
||||||
|
|
||||||
@ -178,18 +211,37 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
|
||||||
|
|
||||||
GUILayout.Label("Models:", EditorStyles.miniBoldLabel);
|
curWindow.textureAtlas.exportSettings.exportModels = GUILayout.Toggle(curWindow.textureAtlas.exportSettings.exportModels, "Models:", EditorStyles.toggle);
|
||||||
curWindow.textureAtlas.exportSettings.modelExportSettings.modelFormat = (ModelFormat)EditorGUILayout.EnumPopup("ModelFormat:", curWindow.textureAtlas.exportSettings.modelExportSettings.modelFormat);
|
curWindow.textureAtlas.exportSettings.modelExportSettings.modelFormat = (ModelFormat)EditorGUILayout.EnumPopup("ModelFormat:", curWindow.textureAtlas.exportSettings.modelExportSettings.modelFormat);
|
||||||
curWindow.textureAtlas.exportSettings.modelExportSettings.replaceModel = EditorGUILayout.Toggle("ReplaceModels:", curWindow.textureAtlas.exportSettings.modelExportSettings.replaceModel);
|
|
||||||
curWindow.textureAtlas.exportSettings.modelExportSettings.uvFlipY = EditorGUILayout.Toggle("UV FlipY:", curWindow.textureAtlas.exportSettings.modelExportSettings.uvFlipY);
|
curWindow.textureAtlas.exportSettings.modelExportSettings.uvFlipY = EditorGUILayout.Toggle("UV FlipY:", curWindow.textureAtlas.exportSettings.modelExportSettings.uvFlipY);
|
||||||
curWindow.textureAtlas.exportSettings.modelExportSettings.uvChannel = EditorGUILayout.IntField("UV Channel:", curWindow.textureAtlas.exportSettings.modelExportSettings.uvChannel);
|
curWindow.textureAtlas.exportSettings.modelExportSettings.uvChannel = EditorGUILayout.IntField("UV Channel:", curWindow.textureAtlas.exportSettings.modelExportSettings.uvChannel);
|
||||||
curWindow.textureAtlas.exportSettings.modelExportSettings.uvWrap = EditorGUILayout.Toggle("UV Wrap:", curWindow.textureAtlas.exportSettings.modelExportSettings.uvWrap);
|
curWindow.textureAtlas.exportSettings.modelExportSettings.uvWrap = EditorGUILayout.Toggle("UV Wrap:", curWindow.textureAtlas.exportSettings.modelExportSettings.uvWrap);
|
||||||
|
|
||||||
GUILayout.Label("Textures:", EditorStyles.miniBoldLabel);
|
curWindow.textureAtlas.exportSettings.exportTextures = GUILayout.Toggle(curWindow.textureAtlas.exportSettings.exportTextures, "Textures:", EditorStyles.toggle);
|
||||||
curWindow.textureAtlas.exportSettings.textureExportSettings.textureFormat = (TextureFormat)EditorGUILayout.EnumPopup("TextureFormat:", curWindow.textureAtlas.exportSettings.textureExportSettings.textureFormat);
|
curWindow.textureAtlas.exportSettings.textureExportSettings.textureFormat = (TextureFormat)EditorGUILayout.EnumPopup("TextureFormat:", curWindow.textureAtlas.exportSettings.textureExportSettings.textureFormat);
|
||||||
curWindow.textureAtlas.exportSettings.textureExportSettings.textureType = (TextureType)EditorGUILayout.EnumPopup("TextureType:", curWindow.textureAtlas.exportSettings.textureExportSettings.textureType);
|
curWindow.textureAtlas.exportSettings.textureExportSettings.textureType = (TextureType)EditorGUILayout.EnumPopup("TextureType:", curWindow.textureAtlas.exportSettings.textureExportSettings.textureType);
|
||||||
curWindow.textureAtlas.exportSettings.textureExportSettings.textureScaleMode = (MA_TextureUtils.TextureScaleMode)EditorGUILayout.EnumPopup("TextureScaleMode:", curWindow.textureAtlas.exportSettings.textureExportSettings.textureScaleMode);
|
curWindow.textureAtlas.exportSettings.textureExportSettings.textureScaleMode = (MA_TextureUtils.TextureScaleMode)EditorGUILayout.EnumPopup("TextureScaleMode:", curWindow.textureAtlas.exportSettings.textureExportSettings.textureScaleMode);
|
||||||
|
|
||||||
|
curWindow.textureAtlas.exportSettings.exportMaterials = GUILayout.Toggle(curWindow.textureAtlas.exportSettings.exportMaterials, "Materials:", EditorStyles.toggle);
|
||||||
|
curWindow.textureAtlas.exportSettings.materialExportSettings.shader = (Shader)EditorGUILayout.ObjectField("Shader:", curWindow.textureAtlas.exportSettings.materialExportSettings.shader, typeof(UnityEngine.Shader), false);
|
||||||
|
|
||||||
|
scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
|
||||||
|
for (int i = 0; i < curWindow.textureAtlas.exportSettings.materialExportSettings.shaderPropertyNames.Count; i++)
|
||||||
|
{
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
curWindow.textureAtlas.exportSettings.materialExportSettings.shaderPropertyNames[i] = EditorGUILayout.TextField("", curWindow.textureAtlas.exportSettings.materialExportSettings.shaderPropertyNames[i]);
|
||||||
|
if (GUILayout.Button("-", EditorStyles.miniButtonLeft, GUILayout.ExpandWidth(false)))
|
||||||
|
{
|
||||||
|
curWindow.textureAtlas.exportSettings.materialExportSettings.shaderPropertyNames.RemoveAt(i);
|
||||||
|
}
|
||||||
|
if (GUILayout.Button("+", EditorStyles.miniButtonRight, GUILayout.ExpandWidth(false)))
|
||||||
|
{
|
||||||
|
curWindow.textureAtlas.exportSettings.materialExportSettings.shaderPropertyNames.Insert(i + 1, "");
|
||||||
|
}
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndScrollView();
|
||||||
|
|
||||||
EditorGUILayout.EndVertical();
|
EditorGUILayout.EndVertical();
|
||||||
|
|
||||||
GUI.enabled = wasEnabled;
|
GUI.enabled = wasEnabled;
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 142cd2d260a4ef948a2f16b16cd9e00e
|
||||||
|
timeCreated: 1521826727
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -100,9 +100,9 @@ namespace MA_TextureAtlasserPro
|
|||||||
|
|
||||||
//Calculate view rects
|
//Calculate view rects
|
||||||
Rect workViewRect = new Rect(position.width - position.width, position.height - position.height, position.width, position.height);
|
Rect workViewRect = new Rect(position.width - position.width, position.height - position.height, position.width, position.height);
|
||||||
Rect debugViewRect = new Rect(position.width - MA_TextureAtlasserProUtils.VIEWOFFSET - 164, position.height - MA_TextureAtlasserProUtils.VIEWOFFSET - 22, 164, 22);
|
Rect debugViewRect = new Rect(position.width - MA_TextureAtlasserProUtils.VIEW_OFFSET - 164, position.height - MA_TextureAtlasserProUtils.VIEW_OFFSET - 22, 164, 22);
|
||||||
Rect menuViewRect = new Rect(MA_TextureAtlasserProUtils.VIEWOFFSET, MA_TextureAtlasserProUtils.VIEWOFFSET, position.width - (MA_TextureAtlasserProUtils.VIEWOFFSET * 2), 44);
|
Rect menuViewRect = new Rect(MA_TextureAtlasserProUtils.VIEW_OFFSET, MA_TextureAtlasserProUtils.VIEW_OFFSET, position.width - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 2), 44);
|
||||||
Rect inspectorViewRect = new Rect(MA_TextureAtlasserProUtils.VIEWOFFSET, menuViewRect.y + menuViewRect.height + MA_TextureAtlasserProUtils.VIEWOFFSET, 164, position.height - menuViewRect.height - (MA_TextureAtlasserProUtils.VIEWOFFSET * 3));
|
Rect inspectorViewRect = new Rect(MA_TextureAtlasserProUtils.VIEW_OFFSET, menuViewRect.y + menuViewRect.height + MA_TextureAtlasserProUtils.VIEW_OFFSET, 164, position.height - menuViewRect.height - (MA_TextureAtlasserProUtils.VIEW_OFFSET * 3));
|
||||||
|
|
||||||
//Draw views and windows in the right oder from back to front
|
//Draw views and windows in the right oder from back to front
|
||||||
if(isLoaded)
|
if(isLoaded)
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 21fee5883ec8a9c4c911f3c40ab47ecf
|
||||||
|
timeCreated: 1519392331
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_Utilities.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3b68846f992a7304189ffd3ff39072ff
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1518369341
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_Utilities/EditorUtils.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6aa9d38bd8e54d0448095604d7d62fd1
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1522672244
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 64df885d83caddf48acfa78533a3e76f
|
||||||
|
timeCreated: 1522672827
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1ec1c2403bd92a84798e0ad68ebf4bad
|
||||||
|
timeCreated: 1522671138
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ea365137c05cbd64489983567390af51
|
||||||
|
timeCreated: 1522669939
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_Utilities/MeshUtils.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ac03fa4896f5ed74c80155bbbfccd958
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1522672266
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
273
Assets/MA_ToolBox/MA_Utilities/MeshUtils/MA_MeshUtils.cs
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
//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;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace MA_Mesh
|
||||||
|
{
|
||||||
|
public static class MA_MeshUtils
|
||||||
|
{
|
||||||
|
public static string MA_SaveMeshAsset(Mesh mesh, string savePath)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(mesh.name))
|
||||||
|
{
|
||||||
|
mesh.name = UnityEngine.Random.Range(11111, 99999).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
string assetPath = savePath + mesh.name + ".asset";
|
||||||
|
|
||||||
|
AssetDatabase.CreateAsset(mesh, assetPath);
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
|
||||||
|
return assetPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string MA_SaveMeshPrefab(Mesh mesh, string prefabName, string savePath, string materialPath)
|
||||||
|
{
|
||||||
|
string assetPath = null;
|
||||||
|
|
||||||
|
string meshAssetPath = MA_SaveMeshAsset(mesh, savePath);
|
||||||
|
Mesh meshAsset = AssetDatabase.LoadAssetAtPath<Mesh>(meshAssetPath);
|
||||||
|
|
||||||
|
if (meshAsset != null)
|
||||||
|
{
|
||||||
|
GameObject gameObject = new GameObject
|
||||||
|
{
|
||||||
|
name = prefabName
|
||||||
|
};
|
||||||
|
|
||||||
|
gameObject.AddComponent<MeshFilter>().mesh = meshAsset;
|
||||||
|
gameObject.AddComponent<MeshRenderer>();
|
||||||
|
|
||||||
|
Material curMaterial = AssetDatabase.LoadAssetAtPath<Material>(materialPath);
|
||||||
|
if (curMaterial != null)
|
||||||
|
{
|
||||||
|
gameObject.GetComponent<MeshRenderer>().material = curMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(prefabName))
|
||||||
|
{
|
||||||
|
prefabName = UnityEngine.Random.Range(11111, 99999).ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
assetPath = savePath + prefabName + ".prefab";
|
||||||
|
|
||||||
|
#if UNITY_2018_4_OR_NEWER
|
||||||
|
|
||||||
|
PrefabUtility.SaveAsPrefabAsset(gameObject, assetPath);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
GameObject go = AssetDatabase.LoadAssetAtPath<GameObject>(assetPath);
|
||||||
|
if (go != null)
|
||||||
|
{
|
||||||
|
PrefabUtility.ReplacePrefab(gameObject, go, ReplacePrefabOptions.ReplaceNameBased);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PrefabUtility.CreatePrefab(assetPath, gameObject, ReplacePrefabOptions.ReplaceNameBased);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
UnityEngine.GameObject.DestroyImmediate(gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
return assetPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Mesh MA_DuplicateMesh(Mesh mesh)
|
||||||
|
{
|
||||||
|
Mesh newMesh = new Mesh
|
||||||
|
{
|
||||||
|
name = mesh.name,
|
||||||
|
bounds = mesh.bounds,
|
||||||
|
subMeshCount = mesh.subMeshCount
|
||||||
|
};
|
||||||
|
|
||||||
|
newMesh.SetVertices(new List<Vector3>(mesh.vertices));
|
||||||
|
for (int i = 0; i < mesh.subMeshCount; i++)
|
||||||
|
{
|
||||||
|
newMesh.SetTriangles(mesh.GetTriangles(i), i);
|
||||||
|
}
|
||||||
|
newMesh.SetNormals(new List<Vector3>(mesh.normals));
|
||||||
|
newMesh.SetUVs(0, new List<Vector2>(mesh.uv));
|
||||||
|
newMesh.SetTangents(new List<Vector4>(mesh.tangents));
|
||||||
|
newMesh.SetColors(new List<Color>(mesh.colors));
|
||||||
|
|
||||||
|
return newMesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Mesh MA_ReMapUV(this Mesh mesh, Vector2 atlasSize, Vector2 textureSize, Vector2 texturePosition, int uvChannel = 0)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
0 1
|
||||||
|
512 x 512
|
||||||
|
|
||||||
|
0 .5 = 1 / 512 * 256
|
||||||
|
256 x 256
|
||||||
|
|
||||||
|
+ pos
|
||||||
|
*/
|
||||||
|
|
||||||
|
List<Vector2> uvs = new List<Vector2>();
|
||||||
|
|
||||||
|
//Get UV's
|
||||||
|
mesh.GetUVs(uvChannel, uvs);
|
||||||
|
|
||||||
|
foreach (Vector2 uvCordinate in uvs)
|
||||||
|
{
|
||||||
|
float x = (uvCordinate.x / atlasSize.x * textureSize.x) + texturePosition.x;
|
||||||
|
float y = (uvCordinate.y / atlasSize.y * textureSize.y) + texturePosition.y;
|
||||||
|
uvCordinate.Set(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.SetUVs(uvChannel, uvs);
|
||||||
|
|
||||||
|
return mesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Mesh MA_UVReMap(this Mesh mesh, Vector2 atlasSize, Rect textureRect, int uvChannel = 0, bool flipY = true, bool wrap = true)
|
||||||
|
{
|
||||||
|
//Get UV's
|
||||||
|
List<Vector2> uvs = new List<Vector2>();
|
||||||
|
mesh.GetUVs(uvChannel, uvs);
|
||||||
|
|
||||||
|
//Min and max bounds in 0-1 space.
|
||||||
|
float xMin, xMax, yMin, yMax;
|
||||||
|
xMin = (1f / atlasSize.x * textureRect.width);
|
||||||
|
xMax = (1f / atlasSize.x * textureRect.x);
|
||||||
|
yMin = (1f / atlasSize.y * textureRect.height);
|
||||||
|
|
||||||
|
//Flip uv's if needed.
|
||||||
|
if (flipY)
|
||||||
|
{
|
||||||
|
yMax = (1f / atlasSize.y * (atlasSize.y - textureRect.height - textureRect.y));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
yMax = (1f / atlasSize.y * textureRect.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < uvs.Count; i++)
|
||||||
|
{
|
||||||
|
float newX = uvs[i].x * xMin + xMax;
|
||||||
|
float newY = uvs[i].y * yMin + yMax;
|
||||||
|
|
||||||
|
//Wrap the verts outside of the uv space around back into the uv space.
|
||||||
|
if (wrap)
|
||||||
|
{
|
||||||
|
newX = Wrap(newX, xMax, xMin + xMax);
|
||||||
|
newY = Wrap(newY, yMax, yMin + yMax);
|
||||||
|
}
|
||||||
|
|
||||||
|
uvs[i] = new Vector2(newX, newY);
|
||||||
|
}
|
||||||
|
|
||||||
|
mesh.SetUVs(uvChannel, uvs);
|
||||||
|
|
||||||
|
return mesh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float Wrap(float val, float min, float max)
|
||||||
|
{
|
||||||
|
val -= (float)Math.Round((val - min) / (max - min)) * (max - min);
|
||||||
|
if (val < min)
|
||||||
|
val = val + max - min;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Start http://wiki.unity3d.com/index.php?title=ObjExporter
|
||||||
|
public static string MeshToString(Mesh mesh)
|
||||||
|
{
|
||||||
|
int vertexOffset = 0;
|
||||||
|
int normalOffset = 0;
|
||||||
|
int uvOffset = 0;
|
||||||
|
|
||||||
|
Material material = new Material(Shader.Find("Standard"));
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.Append("g ").Append(mesh.name).Append("\n");
|
||||||
|
|
||||||
|
foreach (Vector3 v in mesh.vertices)
|
||||||
|
{
|
||||||
|
//This is sort of ugly - inverting x-component since we're in
|
||||||
|
//a different coordinate system than "everyone" is "used to".
|
||||||
|
sb.Append(string.Format("v {0} {1} {2}\n", -v.x, v.y, v.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append("\n");
|
||||||
|
|
||||||
|
foreach (Vector3 v in mesh.normals)
|
||||||
|
{
|
||||||
|
sb.Append(string.Format("vn {0} {1} {2}\n", -v.x, v.y, v.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append("\n");
|
||||||
|
|
||||||
|
foreach (Vector3 v in mesh.uv)
|
||||||
|
{
|
||||||
|
sb.Append(string.Format("vt {0} {1}\n", v.x, v.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int m = 0; m < mesh.subMeshCount; m++)
|
||||||
|
{
|
||||||
|
sb.Append("\n");
|
||||||
|
sb.Append("usemtl ").Append(material.name + m).Append("\n");
|
||||||
|
sb.Append("usemap ").Append(material.name + m).Append("\n");
|
||||||
|
|
||||||
|
// int[] triangles = mesh.GetTriangles(m);
|
||||||
|
// for (int i = 0; i < triangles.Length; i += 3)
|
||||||
|
// {
|
||||||
|
// sb.Append(string.Format("f {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\n", triangles[i]+1, triangles[i+1]+1, triangles[i+2]+1));
|
||||||
|
// }
|
||||||
|
|
||||||
|
int[] triangles = mesh.GetTriangles(m);
|
||||||
|
for (int i = 0; i < triangles.Length; i += 3)
|
||||||
|
{
|
||||||
|
//Because we inverted the x-component, we also needed to alter the triangle winding.
|
||||||
|
sb.Append(string.Format("f {1}/{1}/{1} {0}/{0}/{0} {2}/{2}/{2}\n", triangles[i] + 1 + vertexOffset, triangles[i + 1] + 1 + normalOffset, triangles[i + 2] + 1 + uvOffset));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//vertexOffset += mesh.vertices.Length;
|
||||||
|
//normalOffset += mesh.normals.Length;
|
||||||
|
//uvOffset += mesh.uv.Length;
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string MeshToFile(Mesh mesh, string filename, string savePath)
|
||||||
|
{
|
||||||
|
string assetPath = savePath + filename + ".obj";
|
||||||
|
|
||||||
|
using (StreamWriter sw = new StreamWriter(assetPath))
|
||||||
|
{
|
||||||
|
sw.Write(MeshToString(mesh));
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetDatabase.Refresh();
|
||||||
|
|
||||||
|
return assetPath;
|
||||||
|
}
|
||||||
|
//End
|
||||||
|
}
|
||||||
|
|
||||||
|
//struct ObjMaterial
|
||||||
|
//{
|
||||||
|
// public string name;
|
||||||
|
// public string textureName;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
#endif
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b8292e68eba0ff5488f218a303e60a5b
|
||||||
|
timeCreated: 1518370877
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/MA_ToolBox/MA_Utilities/TextureUtils.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9727f759199d13e4e814f5fb3b8a41de
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1522672279
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a156d40c509995b4bbc8c259cdac9519
|
||||||
|
timeCreated: 1518369341
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
2
LICENSE
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2018 Max Kruf
|
Copyright (c) 2019 Max Kruf
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -1 +0,0 @@
|
|||||||
The created atlasses wil go here.
|
|
@ -1 +0,0 @@
|
|||||||
The exported assets will be saved in this folder.
|
|
@ -1,528 +0,0 @@
|
|||||||
#if UNITY_EDITOR
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor;
|
|
||||||
using MA_Mesh;
|
|
||||||
using MA_Texture;
|
|
||||||
|
|
||||||
namespace MA_TextureAtlasserPro
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public static class MA_TextureAtlasserProUtils
|
|
||||||
{
|
|
||||||
public const string SETTINGSASSETPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Settings/";
|
|
||||||
public const string EXPORTSETTINGSASSETPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Settings/ExportSettings/";
|
|
||||||
public const string SAVEASSETPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Atlasses/";
|
|
||||||
public const string LOADASSETPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Atlasses/";
|
|
||||||
public const string EXPORTASSETPATH = "Assets/MA_ToolBox/MA_TextureAtlasserPro/Exports/";
|
|
||||||
public const float VIEWOFFSET = 20;
|
|
||||||
public const string DEFAULTTEXTUREGROUPNAME = "Albedo";
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProSettings CreateSettings()
|
|
||||||
{
|
|
||||||
MA_TextureAtlasserProSettings _settings = ScriptableObject.CreateInstance<MA_TextureAtlasserProSettings>();
|
|
||||||
|
|
||||||
if(_settings != null)
|
|
||||||
{
|
|
||||||
AssetDatabase.CreateAsset(_settings, SETTINGSASSETPATH + "MA_TextureAtlasserProSettings.asset");
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
|
|
||||||
return _settings;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProSettings LoadSettings()
|
|
||||||
{
|
|
||||||
MA_TextureAtlasserProSettings _settings = AssetDatabase.LoadAssetAtPath(SETTINGSASSETPATH + "MA_TextureAtlasserProSettings.asset", typeof(MA_TextureAtlasserProSettings)) as MA_TextureAtlasserProSettings;
|
|
||||||
|
|
||||||
if (_settings == null)
|
|
||||||
{
|
|
||||||
_settings = CreateSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProExportSettings CreateExportSettings(string name, bool canModify = true)
|
|
||||||
{
|
|
||||||
MA_TextureAtlasserProExportSettings _settings = ScriptableObject.CreateInstance<MA_TextureAtlasserProExportSettings>();
|
|
||||||
_settings.canModify = canModify;
|
|
||||||
|
|
||||||
if (_settings != null)
|
|
||||||
{
|
|
||||||
AssetDatabase.CreateAsset(_settings, EXPORTSETTINGSASSETPATH + name + ".asset");
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
|
|
||||||
return _settings;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProExportSettings LoadExportSettings()
|
|
||||||
{
|
|
||||||
string name = "MA_DefaultExportSettings";
|
|
||||||
MA_TextureAtlasserProExportSettings _settings = AssetDatabase.LoadAssetAtPath(EXPORTSETTINGSASSETPATH + name + ".asset", typeof(MA_TextureAtlasserProExportSettings)) as MA_TextureAtlasserProExportSettings;
|
|
||||||
|
|
||||||
if (_settings == null)
|
|
||||||
{
|
|
||||||
_settings = CreateExportSettings(name, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProAtlas CreateTextureAtlas(string name, Vector2 size)
|
|
||||||
{
|
|
||||||
MA_TextureAtlasserProAtlas _atlas = ScriptableObject.CreateInstance<MA_TextureAtlasserProAtlas>();
|
|
||||||
|
|
||||||
if(_atlas != null)
|
|
||||||
{
|
|
||||||
_atlas.CreateAtlas(name, size);
|
|
||||||
MA_CheckTextureAtlas(_atlas);
|
|
||||||
|
|
||||||
AssetDatabase.CreateAsset(_atlas, SAVEASSETPATH + name + ".asset");
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
|
|
||||||
return _atlas;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProAtlas LoadTextureAtlas()
|
|
||||||
{
|
|
||||||
MA_TextureAtlasserProAtlas _atlas = null;
|
|
||||||
string absPath = EditorUtility.OpenFilePanel("Select Texture Atlas", LOADASSETPATH, "");
|
|
||||||
|
|
||||||
if(absPath.StartsWith(Application.dataPath))
|
|
||||||
{
|
|
||||||
string relPath = absPath.Substring(Application.dataPath.Length - "Assets".Length);
|
|
||||||
_atlas = AssetDatabase.LoadAssetAtPath(relPath, typeof(MA_TextureAtlasserProAtlas)) as MA_TextureAtlasserProAtlas;
|
|
||||||
|
|
||||||
MA_CheckTextureAtlas(_atlas);
|
|
||||||
|
|
||||||
if(_atlas)
|
|
||||||
{
|
|
||||||
EditorPrefs.SetString("AtlasPath", null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_atlas != null)
|
|
||||||
{
|
|
||||||
if(_atlas.selectedTextureQuad != null)
|
|
||||||
{
|
|
||||||
_atlas.selectedTextureQuad.isSelected = false;
|
|
||||||
}
|
|
||||||
_atlas.selectedTextureQuad = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _atlas;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void MA_CheckTextureAtlas(MA_TextureAtlasserProAtlas atlas)
|
|
||||||
{
|
|
||||||
if(atlas.textureGroupRegistration == null)
|
|
||||||
{
|
|
||||||
atlas.textureGroupRegistration = new List<MA_TextureGroupRegistration>();
|
|
||||||
|
|
||||||
MA_TextureGroupRegistration groupRegistration = new MA_TextureGroupRegistration
|
|
||||||
{
|
|
||||||
name = DEFAULTTEXTUREGROUPNAME
|
|
||||||
};
|
|
||||||
|
|
||||||
atlas.textureGroupRegistration.Add(groupRegistration);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(atlas.textureQuads == null)
|
|
||||||
{
|
|
||||||
atlas.textureQuads = new List<MA_TextureAtlasserProQuad>();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bool _sameCount = true;
|
|
||||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
if(q.textureGroups.Count != atlas.textureGroupRegistration.Count)
|
|
||||||
{
|
|
||||||
_sameCount = false;
|
|
||||||
Debug.LogWarning("TextureAtlasser: " + q.name + " doesn't have the right amount of texture groups!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_sameCount)
|
|
||||||
{
|
|
||||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < atlas.textureQuads.Count; i++)
|
|
||||||
{
|
|
||||||
for (int j = 0; j < atlas.textureGroupRegistration.Count; j++)
|
|
||||||
{
|
|
||||||
if(atlas.textureQuads[i].textureGroups[j].name != atlas.textureGroupRegistration[j].name)
|
|
||||||
{
|
|
||||||
Debug.LogWarning("TextureAtlasser: " + q.name + " doesn't have the right texture group name!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(atlas.exportSettings == null)
|
|
||||||
{
|
|
||||||
atlas.exportSettings = LoadExportSettings();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MA_TextureAtlasserProQuad CreateTextureQuad(MA_TextureAtlasserProAtlas atlas, string name, Rect rect, bool focus = true)
|
|
||||||
{
|
|
||||||
if(atlas != null)
|
|
||||||
{
|
|
||||||
//Create new list if we haven't one already
|
|
||||||
if(atlas.textureQuads == null)
|
|
||||||
{
|
|
||||||
atlas.textureQuads = new List<MA_TextureAtlasserProQuad>();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Create new quad
|
|
||||||
MA_TextureAtlasserProQuad _quad = ScriptableObject.CreateInstance<MA_TextureAtlasserProQuad>();
|
|
||||||
|
|
||||||
//Add quad to asset
|
|
||||||
if(_quad != null)
|
|
||||||
{
|
|
||||||
//Set quad settings
|
|
||||||
_quad.name = name;
|
|
||||||
_quad.rect = rect;
|
|
||||||
|
|
||||||
SetTextureGroups(atlas, _quad);
|
|
||||||
|
|
||||||
atlas.textureQuads.Add(_quad);
|
|
||||||
|
|
||||||
AssetDatabase.AddObjectToAsset(_quad, atlas);
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
|
|
||||||
if(focus)
|
|
||||||
{
|
|
||||||
atlas.selectedTextureQuad = atlas.textureQuads[atlas.textureQuads.Count - 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
return _quad;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogError("CreateTextureQuad Failed: _TextureQuad");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogError("CreateTextureQuad Failed: textureAtlas");
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemoveTextureQuad(MA_TextureAtlasserProAtlas atlas, bool focus = true)
|
|
||||||
{
|
|
||||||
if(atlas != null && atlas.selectedTextureQuad != null)
|
|
||||||
{
|
|
||||||
int _index = atlas.textureQuads.IndexOf(atlas.selectedTextureQuad);
|
|
||||||
|
|
||||||
atlas.textureQuads.RemoveAt(_index);
|
|
||||||
Object.DestroyImmediate(atlas.selectedTextureQuad, true);
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
|
|
||||||
if (focus && atlas.textureQuads.Count > 0)
|
|
||||||
{
|
|
||||||
_index = Mathf.Clamp(_index, 0, atlas.textureQuads.Count - 1);
|
|
||||||
atlas.selectedTextureQuad = atlas.textureQuads[_index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void DuplicateTextureQuad(MA_TextureAtlasserProAtlas atlas, bool focus = true, bool copyData = false, string namePrefix = "new ")
|
|
||||||
{
|
|
||||||
if(atlas != null && atlas.selectedTextureQuad != null)
|
|
||||||
{
|
|
||||||
MA_TextureAtlasserProQuad q = CreateTextureQuad(atlas, namePrefix + atlas.selectedTextureQuad.name, atlas.selectedTextureQuad.rect, false);
|
|
||||||
|
|
||||||
if (copyData)
|
|
||||||
{
|
|
||||||
q.meshes = new List<Mesh>();
|
|
||||||
for (int i = 0; i < atlas.selectedTextureQuad.meshes.Count; i++)
|
|
||||||
{
|
|
||||||
q.meshes.Add(atlas.selectedTextureQuad.meshes[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < atlas.selectedTextureQuad.textureGroups.Count; i++)
|
|
||||||
{
|
|
||||||
q.textureGroups[i].texture = atlas.selectedTextureQuad.textureGroups[i].texture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(focus)
|
|
||||||
{
|
|
||||||
atlas.selectedTextureQuad = q;
|
|
||||||
}
|
|
||||||
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void SetTextureGroups(MA_TextureAtlasserProAtlas atlas, MA_TextureAtlasserProQuad quad)
|
|
||||||
{
|
|
||||||
if(quad.textureGroups == null)
|
|
||||||
{
|
|
||||||
quad.textureGroups = new List<MA_TextureGroup>();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Add texture groups
|
|
||||||
foreach (MA_TextureGroupRegistration tgr in atlas.textureGroupRegistration)
|
|
||||||
{
|
|
||||||
MA_TextureGroup textureGroup = new MA_TextureGroup
|
|
||||||
{
|
|
||||||
name = tgr.name
|
|
||||||
};
|
|
||||||
quad.textureGroups.Add(textureGroup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CreateTextureGroup(MA_TextureAtlasserProAtlas atlas, string name)
|
|
||||||
{
|
|
||||||
MA_TextureGroupRegistration _textureGroupRegistration = new MA_TextureGroupRegistration
|
|
||||||
{
|
|
||||||
name = name
|
|
||||||
};
|
|
||||||
atlas.textureGroupRegistration.Add(_textureGroupRegistration);
|
|
||||||
|
|
||||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
MA_TextureGroup _textureGroup = new MA_TextureGroup
|
|
||||||
{
|
|
||||||
name = name
|
|
||||||
};
|
|
||||||
q.textureGroups.Add(_textureGroup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void RemoveTextureGroup(MA_TextureAtlasserProAtlas atlas, int index)
|
|
||||||
{
|
|
||||||
atlas.textureGroupRegistration.RemoveAt(index);
|
|
||||||
|
|
||||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
q.textureGroups.RemoveAt(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void CloseWindow(MA_TextureAtlasserProWindow curWindow)
|
|
||||||
{
|
|
||||||
if(curWindow == null)
|
|
||||||
{
|
|
||||||
Debug.LogError("Closing window Failed: curWindow == null");
|
|
||||||
}
|
|
||||||
curWindow.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool IsPowerOfTwo(int value)
|
|
||||||
{
|
|
||||||
//While x is even and > 1
|
|
||||||
while (((value % 2) == 0) && value > 1)
|
|
||||||
{
|
|
||||||
value /= 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (value == 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Export
|
|
||||||
public static void ExportAtlasModels(MA_TextureAtlasserProAtlas atlas, ModelExportSettings modelExportSettings, string savePath = EXPORTASSETPATH)
|
|
||||||
{
|
|
||||||
switch(modelExportSettings.modelFormat)
|
|
||||||
{
|
|
||||||
case ModelFormat.None:
|
|
||||||
break;
|
|
||||||
case ModelFormat.Obj:
|
|
||||||
ExportAtlasObj(atlas, modelExportSettings, savePath);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ExportAtlasObj(MA_TextureAtlasserProAtlas atlas, ModelExportSettings modelExportSettings, string savePath = EXPORTASSETPATH)
|
|
||||||
{
|
|
||||||
if (atlas == null || atlas.textureQuads == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(modelExportSettings.replaceModel)
|
|
||||||
{
|
|
||||||
var quads = atlas.textureQuads;
|
|
||||||
|
|
||||||
for (var index = 0; index < quads.Count; index++)
|
|
||||||
{
|
|
||||||
var quad = quads[index];
|
|
||||||
if (quad.meshes == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var meshes = quad.meshes;
|
|
||||||
for (var meshIndex = 0; meshIndex < quad.meshes.Count; meshIndex++)
|
|
||||||
{
|
|
||||||
if (meshes[meshIndex] == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
MA_MeshUtils.MA_UVReMap(meshes[meshIndex], atlas.textureAtlasSize, quad.guiRect, modelExportSettings.uvChannel, modelExportSettings.uvFlipY, modelExportSettings.uvWrap);
|
|
||||||
EditorUtility.SetDirty(meshes[meshIndex]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (MA_TextureAtlasserProQuad quad in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
//Export Mesh
|
|
||||||
if (quad.meshes != null)
|
|
||||||
{
|
|
||||||
for (int m = 0; m < quad.meshes.Count; m++)
|
|
||||||
{
|
|
||||||
if (quad.meshes[m] != null)
|
|
||||||
{
|
|
||||||
//Create new mesh
|
|
||||||
Mesh newMesh = new Mesh();
|
|
||||||
//Duplicate it from the current one
|
|
||||||
newMesh = MA_MeshUtils.MA_DuplicateMesh(quad.meshes[m]);
|
|
||||||
//Remap UV's
|
|
||||||
newMesh = MA_MeshUtils.MA_UVReMap(newMesh, atlas.textureAtlasSize, quad.guiRect, modelExportSettings.uvChannel, modelExportSettings.uvFlipY, modelExportSettings.uvWrap);
|
|
||||||
//Save it
|
|
||||||
string modelName = string.IsNullOrEmpty(quad.name) ? "" : quad.name + "-";
|
|
||||||
modelName += quad.meshes[m].name;
|
|
||||||
int n = m + 1;
|
|
||||||
modelName += "_" + n.ToString("#000");
|
|
||||||
|
|
||||||
MA_MeshUtils.MeshToFile(newMesh, modelName, savePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ExportAtlasTextures(MA_TextureAtlasserProAtlas atlas, TextureExportSettings textureExportSettings, string savePath = EXPORTASSETPATH)
|
|
||||||
{
|
|
||||||
switch (textureExportSettings.textureFormat)
|
|
||||||
{
|
|
||||||
case TextureFormat.None:
|
|
||||||
break;
|
|
||||||
case TextureFormat.Png:
|
|
||||||
ExportAtlasPNG(atlas, textureExportSettings, savePath);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void ExportAtlasPNG(MA_TextureAtlasserProAtlas atlas, TextureExportSettings textureExportSettings, string savePath = EXPORTASSETPATH)
|
|
||||||
{
|
|
||||||
if (atlas == null || atlas.textureQuads == null || atlas.textureGroupRegistration == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Foreach texture group
|
|
||||||
for (int i = 0; i < atlas.textureGroupRegistration.Count; i++)
|
|
||||||
{
|
|
||||||
//Create new Texture Atlas
|
|
||||||
Texture2D newTexture = new Texture2D((int)atlas.textureAtlasSize.x, (int)atlas.textureAtlasSize.y)
|
|
||||||
{
|
|
||||||
name = atlas.name + "_" + atlas.textureGroupRegistration[i].name
|
|
||||||
};
|
|
||||||
|
|
||||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
if (q.textureGroups != null && q.textureGroups[i].texture != null)
|
|
||||||
{
|
|
||||||
//Create new texture part
|
|
||||||
Texture2D newTexturePart = (Texture2D)MA_TextureUtils.ConvertToReadableTexture(q.textureGroups[i].texture);
|
|
||||||
//Scale it
|
|
||||||
newTexturePart = newTexturePart.MA_Scale2D((int)q.guiRect.width, (int)q.guiRect.height, textureExportSettings.textureScaleMode);
|
|
||||||
//Add it
|
|
||||||
newTexture = newTexture.MA_Combine2D(newTexturePart, (int)q.guiRect.x, (int)q.guiRect.y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Save it
|
|
||||||
newTexture.MA_Save2D(newTexture.name, savePath);
|
|
||||||
|
|
||||||
TextureImporter textureImporter = (TextureImporter)AssetImporter.GetAtPath(savePath + newTexture.name + ".png");
|
|
||||||
textureImporter.textureType = TextureImporterType.Default;
|
|
||||||
textureImporter.SaveAndReimport();
|
|
||||||
}
|
|
||||||
|
|
||||||
SetAtlasPNGSpriteSettings(atlas, textureExportSettings, savePath);
|
|
||||||
|
|
||||||
//Refresh
|
|
||||||
AssetDatabase.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void SetAtlasPNGSpriteSettings(MA_TextureAtlasserProAtlas atlas, TextureExportSettings textureExportSettings, string savePath = EXPORTASSETPATH)
|
|
||||||
{
|
|
||||||
//Foreach texture group
|
|
||||||
for (int i = 0; i < atlas.textureGroupRegistration.Count; i++)
|
|
||||||
{
|
|
||||||
//Convert
|
|
||||||
string textureName = atlas.name + "_" + atlas.textureGroupRegistration[i].name + ".png";
|
|
||||||
TextureImporter textureImporter = (TextureImporter)AssetImporter.GetAtPath(savePath + textureName);
|
|
||||||
textureImporter.textureType = TextureImporterType.Sprite;
|
|
||||||
textureImporter.alphaIsTransparency = true;
|
|
||||||
|
|
||||||
//Slice sprites.
|
|
||||||
if (textureExportSettings.textureType == TextureType.SpriteSliced)
|
|
||||||
{
|
|
||||||
textureImporter.spriteImportMode = SpriteImportMode.None; //Reset it to update?
|
|
||||||
textureImporter.spriteImportMode = SpriteImportMode.Multiple;
|
|
||||||
List<SpriteMetaData> spriteMetaData = new List<SpriteMetaData>();
|
|
||||||
|
|
||||||
foreach (MA_TextureAtlasserProQuad q in atlas.textureQuads)
|
|
||||||
{
|
|
||||||
if (q.textureGroups != null && q.textureGroups[i].texture != null)
|
|
||||||
{
|
|
||||||
//Create new SpriteMetaData.
|
|
||||||
SpriteMetaData smd = new SpriteMetaData
|
|
||||||
{
|
|
||||||
name = q.name,
|
|
||||||
rect = new Rect(q.guiRect.x, atlas.textureAtlasSize.y - q.guiRect.y - q.guiRect.height, q.guiRect.width, q.guiRect.height)
|
|
||||||
};
|
|
||||||
|
|
||||||
spriteMetaData.Add(smd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
textureImporter.spritesheet = spriteMetaData.ToArray();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
textureImporter.spriteImportMode = SpriteImportMode.Single;
|
|
||||||
}
|
|
||||||
|
|
||||||
textureImporter.SaveAndReimport();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -1 +0,0 @@
|
|||||||
Export settigns are supposed to be here.
|
|
@ -1,25 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!114 &11400000
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 81466035f9fafc64db33b9e6114d774b, type: 3}
|
|
||||||
m_Name: MA_DefaultExportSettings
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
canModify: 0
|
|
||||||
modelExportSettings:
|
|
||||||
modelFormat: 1
|
|
||||||
replaceModel: 0
|
|
||||||
uvFlipY: 1
|
|
||||||
uvChannel: 0
|
|
||||||
uvWrap: 1
|
|
||||||
textureExportSettings:
|
|
||||||
textureFormat: 1
|
|
||||||
textureType: 0
|
|
||||||
textureScaleMode: 0
|
|
@ -1,25 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!114 &11400000
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 81466035f9fafc64db33b9e6114d774b, type: 3}
|
|
||||||
m_Name: MA_DefaultSpriteExportSettings
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
canModify: 0
|
|
||||||
modelExportSettings:
|
|
||||||
modelFormat: 1
|
|
||||||
replaceModel: 0
|
|
||||||
uvFlipY: 1
|
|
||||||
uvChannel: 0
|
|
||||||
uvWrap: 1
|
|
||||||
textureExportSettings:
|
|
||||||
textureFormat: 1
|
|
||||||
textureType: 0
|
|
||||||
textureScaleMode: 0
|
|
@ -1,24 +0,0 @@
|
|||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!114 &11400000
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 73f5e66553c13034e9b894ef2cc31b66, type: 3}
|
|
||||||
m_Name: MA_TextureAtlasserProSettings
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
useHotkeys: 1
|
|
||||||
modifierKey: 1
|
|
||||||
addQuadHotKey: 113
|
|
||||||
removeQuadHotKey: 114
|
|
||||||
duplicateHotKey: 100
|
|
||||||
zoomInHotKey: 61
|
|
||||||
zoomOutHotKey: 45
|
|
||||||
copySelectedQuadData: 1
|
|
||||||
duplicatedQuadNamePrefix: 'new '
|
|
||||||
autoFocus: 1
|
|
@ -1 +0,0 @@
|
|||||||
Settigns are supposed to be here.
|
|
@ -1,218 +0,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;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEditor;
|
|
||||||
|
|
||||||
namespace MA_Mesh
|
|
||||||
{
|
|
||||||
public static class MA_MeshUtils
|
|
||||||
{
|
|
||||||
public static void MA_SaveMeshAsset(Mesh mesh, string savePath, string meshName = "")
|
|
||||||
{
|
|
||||||
Mesh newMesh = new Mesh();
|
|
||||||
newMesh.SetVertices(new List<Vector3>(mesh.vertices));
|
|
||||||
newMesh.SetTriangles(mesh.triangles, 0);
|
|
||||||
newMesh.SetUVs(0, new List<Vector2>(mesh.uv));
|
|
||||||
|
|
||||||
if(meshName == "")
|
|
||||||
{
|
|
||||||
newMesh.name = mesh.name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newMesh.name = meshName;
|
|
||||||
}
|
|
||||||
|
|
||||||
AssetDatabase.CreateAsset(newMesh, savePath);
|
|
||||||
AssetDatabase.SaveAssets();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Mesh MA_DuplicateMesh(Mesh mesh)
|
|
||||||
{
|
|
||||||
Mesh newMesh = new Mesh
|
|
||||||
{
|
|
||||||
name = mesh.name,
|
|
||||||
bounds = mesh.bounds,
|
|
||||||
colors = mesh.colors,
|
|
||||||
subMeshCount = mesh.subMeshCount
|
|
||||||
};
|
|
||||||
|
|
||||||
newMesh.SetVertices(new List<Vector3>(mesh.vertices));
|
|
||||||
for (int i = 0; i < mesh.subMeshCount; i++)
|
|
||||||
{
|
|
||||||
newMesh.SetTriangles(mesh.GetTriangles(i), i);
|
|
||||||
}
|
|
||||||
newMesh.SetNormals(new List<Vector3>(mesh.normals));
|
|
||||||
newMesh.SetUVs(0, new List<Vector2>(mesh.uv));
|
|
||||||
newMesh.SetTangents(new List<Vector4>(mesh.tangents));
|
|
||||||
|
|
||||||
return newMesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Mesh MA_ReMapUV(this Mesh mesh, Vector2 atlasSize, Vector2 textureSize, Vector2 texturePosition, int uvChannel = 0)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
0 1
|
|
||||||
512 x 512
|
|
||||||
|
|
||||||
0 .5 = 1 / 512 * 256
|
|
||||||
256 x 256
|
|
||||||
|
|
||||||
+ pos
|
|
||||||
*/
|
|
||||||
|
|
||||||
List<Vector2> uvs = new List<Vector2>();
|
|
||||||
|
|
||||||
//Get UV's
|
|
||||||
mesh.GetUVs(uvChannel, uvs);
|
|
||||||
|
|
||||||
foreach (Vector2 uvCordinate in uvs)
|
|
||||||
{
|
|
||||||
float x = (uvCordinate.x / atlasSize.x * textureSize.x) + texturePosition.x;
|
|
||||||
float y = (uvCordinate.y / atlasSize.y * textureSize.y) + texturePosition.y;
|
|
||||||
uvCordinate.Set(x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
mesh.SetUVs(uvChannel, uvs);
|
|
||||||
|
|
||||||
return mesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Mesh MA_UVReMap(this Mesh mesh, Vector2 atlasSize, Rect textureRect, int uvChannel = 0, bool flipY = true, bool wrap = true)
|
|
||||||
{
|
|
||||||
//Get UV's
|
|
||||||
List<Vector2> uvs = new List<Vector2>();
|
|
||||||
mesh.GetUVs(uvChannel, uvs);
|
|
||||||
|
|
||||||
//Min and max bounds in 0-1 space.
|
|
||||||
float xMin, xMax, yMin, yMax;
|
|
||||||
xMin = (1f / atlasSize.x * textureRect.width);
|
|
||||||
xMax = (1f / atlasSize.x * textureRect.x);
|
|
||||||
yMin = (1f / atlasSize.y * textureRect.height);
|
|
||||||
|
|
||||||
//Flip uv's if needed.
|
|
||||||
if (flipY)
|
|
||||||
{
|
|
||||||
yMax = (1f / atlasSize.y * (atlasSize.y - textureRect.height - textureRect.y));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
yMax = (1f / atlasSize.y * textureRect.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < uvs.Count; i++)
|
|
||||||
{
|
|
||||||
float newX = uvs[i].x * xMin + xMax;
|
|
||||||
float newY = uvs[i].y * yMin + yMax;
|
|
||||||
|
|
||||||
//Wrap the verts outside of the uv space around back into the uv space.
|
|
||||||
if (wrap)
|
|
||||||
{
|
|
||||||
newX = Wrap(newX, xMax, xMin + xMax);
|
|
||||||
newY = Wrap(newY, yMax, yMin + yMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
uvs[i] = new Vector2(newX, newY);
|
|
||||||
}
|
|
||||||
|
|
||||||
mesh.SetUVs(uvChannel, uvs);
|
|
||||||
|
|
||||||
return mesh;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float Wrap(float val, float min, float max)
|
|
||||||
{
|
|
||||||
val -= (float)Math.Round((val - min) / (max - min)) * (max - min);
|
|
||||||
if (val < min)
|
|
||||||
val = val + max - min;
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Start http://wiki.unity3d.com/index.php?title=ObjExporter
|
|
||||||
public static string MeshToString(Mesh mesh)
|
|
||||||
{
|
|
||||||
int vertexOffset = 0;
|
|
||||||
int normalOffset = 0;
|
|
||||||
int uvOffset = 0;
|
|
||||||
|
|
||||||
Material material = new Material(Shader.Find("Standard"));
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
|
|
||||||
sb.Append("g ").Append(mesh.name).Append("\n");
|
|
||||||
|
|
||||||
foreach(Vector3 v in mesh.vertices)
|
|
||||||
{
|
|
||||||
//This is sort of ugly - inverting x-component since we're in
|
|
||||||
//a different coordinate system than "everyone" is "used to".
|
|
||||||
sb.Append(string.Format("v {0} {1} {2}\n", -v.x, v.y, v.z));
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.Append("\n");
|
|
||||||
|
|
||||||
foreach(Vector3 v in mesh.normals)
|
|
||||||
{
|
|
||||||
sb.Append(string.Format("vn {0} {1} {2}\n", -v.x, v.y, v.z));
|
|
||||||
}
|
|
||||||
|
|
||||||
sb.Append("\n");
|
|
||||||
|
|
||||||
foreach(Vector3 v in mesh.uv)
|
|
||||||
{
|
|
||||||
sb.Append(string.Format("vt {0} {1}\n", v.x, v.y));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int m = 0 ; m < mesh.subMeshCount; m++)
|
|
||||||
{
|
|
||||||
sb.Append("\n");
|
|
||||||
sb.Append("usemtl ").Append(material.name + m).Append("\n");
|
|
||||||
sb.Append("usemap ").Append(material.name + m).Append("\n");
|
|
||||||
|
|
||||||
// int[] triangles = mesh.GetTriangles(m);
|
|
||||||
// for (int i = 0; i < triangles.Length; i += 3)
|
|
||||||
// {
|
|
||||||
// sb.Append(string.Format("f {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\n", triangles[i]+1, triangles[i+1]+1, triangles[i+2]+1));
|
|
||||||
// }
|
|
||||||
|
|
||||||
int[] triangles = mesh.GetTriangles(m);
|
|
||||||
for (int i = 0; i < triangles.Length; i += 3)
|
|
||||||
{
|
|
||||||
//Because we inverted the x-component, we also needed to alter the triangle winding.
|
|
||||||
sb.Append(string.Format("f {1}/{1}/{1} {0}/{0}/{0} {2}/{2}/{2}\n", triangles[i]+ 1 + vertexOffset, triangles[i + 1] + 1 + normalOffset, triangles[i +2 ] + 1 + uvOffset));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//vertexOffset += mesh.vertices.Length;
|
|
||||||
//normalOffset += mesh.normals.Length;
|
|
||||||
//uvOffset += mesh.uv.Length;
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void MeshToFile(Mesh mesh, string filename, string savePath)
|
|
||||||
{
|
|
||||||
using (StreamWriter sw = new StreamWriter(savePath + filename + ".obj"))
|
|
||||||
{
|
|
||||||
sw.Write(MeshToString(mesh));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//End
|
|
||||||
}
|
|
||||||
|
|
||||||
//struct ObjMaterial
|
|
||||||
//{
|
|
||||||
// public string name;
|
|
||||||
// public string textureName;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
#endif
|
|
40
Packages/manifest.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"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.ugui": "1.0.0",
|
||||||
|
"com.unity.modules.ai": "1.0.0",
|
||||||
|
"com.unity.modules.androidjni": "1.0.0",
|
||||||
|
"com.unity.modules.animation": "1.0.0",
|
||||||
|
"com.unity.modules.assetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.audio": "1.0.0",
|
||||||
|
"com.unity.modules.cloth": "1.0.0",
|
||||||
|
"com.unity.modules.director": "1.0.0",
|
||||||
|
"com.unity.modules.imageconversion": "1.0.0",
|
||||||
|
"com.unity.modules.imgui": "1.0.0",
|
||||||
|
"com.unity.modules.jsonserialize": "1.0.0",
|
||||||
|
"com.unity.modules.particlesystem": "1.0.0",
|
||||||
|
"com.unity.modules.physics": "1.0.0",
|
||||||
|
"com.unity.modules.physics2d": "1.0.0",
|
||||||
|
"com.unity.modules.screencapture": "1.0.0",
|
||||||
|
"com.unity.modules.terrain": "1.0.0",
|
||||||
|
"com.unity.modules.terrainphysics": "1.0.0",
|
||||||
|
"com.unity.modules.tilemap": "1.0.0",
|
||||||
|
"com.unity.modules.ui": "1.0.0",
|
||||||
|
"com.unity.modules.uielements": "1.0.0",
|
||||||
|
"com.unity.modules.umbra": "1.0.0",
|
||||||
|
"com.unity.modules.unityanalytics": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequest": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestaudio": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequesttexture": "1.0.0",
|
||||||
|
"com.unity.modules.unitywebrequestwww": "1.0.0",
|
||||||
|
"com.unity.modules.vehicles": "1.0.0",
|
||||||
|
"com.unity.modules.video": "1.0.0",
|
||||||
|
"com.unity.modules.vr": "1.0.0",
|
||||||
|
"com.unity.modules.wind": "1.0.0",
|
||||||
|
"com.unity.modules.xr": "1.0.0"
|
||||||
|
}
|
||||||
|
}
|
19
ProjectSettings/AudioManager.asset
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!11 &1
|
||||||
|
AudioManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Volume: 1
|
||||||
|
Rolloff Scale: 1
|
||||||
|
Doppler Factor: 1
|
||||||
|
Default Speaker Mode: 2
|
||||||
|
m_SampleRate: 0
|
||||||
|
m_DSPBufferSize: 1024
|
||||||
|
m_VirtualVoiceCount: 512
|
||||||
|
m_RealVoiceCount: 32
|
||||||
|
m_SpatializerPlugin:
|
||||||
|
m_AmbisonicDecoderPlugin:
|
||||||
|
m_DisableAudio: 0
|
||||||
|
m_VirtualizeEffects: 1
|
||||||
|
m_RequestedDSPBufferSize: 0
|
6
ProjectSettings/ClusterInputManager.asset
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!236 &1
|
||||||
|
ClusterInputManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_Inputs: []
|
35
ProjectSettings/DynamicsManager.asset
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!55 &1
|
||||||
|
PhysicsManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 13
|
||||||
|
m_Gravity: {x: 0, y: -9.81, z: 0}
|
||||||
|
m_DefaultMaterial: {fileID: 0}
|
||||||
|
m_BounceThreshold: 2
|
||||||
|
m_SleepThreshold: 0.005
|
||||||
|
m_DefaultContactOffset: 0.01
|
||||||
|
m_DefaultSolverIterations: 6
|
||||||
|
m_DefaultSolverVelocityIterations: 1
|
||||||
|
m_QueriesHitBackfaces: 0
|
||||||
|
m_QueriesHitTriggers: 1
|
||||||
|
m_EnableAdaptiveForce: 0
|
||||||
|
m_ClothInterCollisionDistance: 0
|
||||||
|
m_ClothInterCollisionStiffness: 0
|
||||||
|
m_ContactsGeneration: 1
|
||||||
|
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||||
|
m_AutoSimulation: 1
|
||||||
|
m_AutoSyncTransforms: 0
|
||||||
|
m_ReuseCollisionCallbacks: 0
|
||||||
|
m_ClothInterCollisionSettingsToggle: 0
|
||||||
|
m_ClothGravity: {x: 0, y: -9.81, z: 0}
|
||||||
|
m_ContactPairsMode: 0
|
||||||
|
m_BroadphaseType: 0
|
||||||
|
m_WorldBounds:
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
m_Extent: {x: 250, y: 250, z: 250}
|
||||||
|
m_WorldSubdivisions: 8
|
||||||
|
m_FrictionType: 0
|
||||||
|
m_EnableEnhancedDeterminism: 0
|
||||||
|
m_EnableUnifiedHeightmaps: 1
|
||||||
|
m_DefaultMaxAngularSpeed: 50
|
8
ProjectSettings/EditorBuildSettings.asset
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!1045 &1
|
||||||
|
EditorBuildSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Scenes: []
|
||||||
|
m_configObjects: {}
|
25
ProjectSettings/EditorSettings.asset
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!159 &1
|
||||||
|
EditorSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 7
|
||||||
|
m_ExternalVersionControlSupport: Hidden Meta Files
|
||||||
|
m_SerializationMode: 2
|
||||||
|
m_LineEndingsForNewScripts: 2
|
||||||
|
m_DefaultBehaviorMode: 0
|
||||||
|
m_PrefabRegularEnvironment: {fileID: 0}
|
||||||
|
m_PrefabUIEnvironment: {fileID: 0}
|
||||||
|
m_SpritePackerMode: 0
|
||||||
|
m_SpritePackerPaddingPower: 1
|
||||||
|
m_EtcTextureCompressorBehavior: 1
|
||||||
|
m_EtcTextureFastCompressor: 1
|
||||||
|
m_EtcTextureNormalCompressor: 2
|
||||||
|
m_EtcTextureBestCompressor: 4
|
||||||
|
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp
|
||||||
|
m_ProjectGenerationRootNamespace:
|
||||||
|
m_CollabEditorSettings:
|
||||||
|
inProgressEnabled: 1
|
||||||
|
m_EnableTextureStreamingInEditMode: 1
|
||||||
|
m_EnableTextureStreamingInPlayMode: 1
|
||||||
|
m_AsyncShaderCompilation: 1
|
62
ProjectSettings/GraphicsSettings.asset
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!30 &1
|
||||||
|
GraphicsSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 12
|
||||||
|
m_Deferred:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_DeferredReflections:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ScreenSpaceShadows:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LegacyDeferred:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_DepthNormals:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_MotionVectors:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LightHalo:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_LensFlare:
|
||||||
|
m_Mode: 1
|
||||||
|
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_AlwaysIncludedShaders:
|
||||||
|
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_PreloadedShaders: []
|
||||||
|
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||||
|
type: 0}
|
||||||
|
m_CustomRenderPipeline: {fileID: 0}
|
||||||
|
m_TransparencySortMode: 0
|
||||||
|
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
|
||||||
|
m_DefaultRenderingPath: 1
|
||||||
|
m_DefaultMobileRenderingPath: 1
|
||||||
|
m_TierSettings: []
|
||||||
|
m_LightmapStripping: 0
|
||||||
|
m_FogStripping: 0
|
||||||
|
m_InstancingStripping: 0
|
||||||
|
m_LightmapKeepPlain: 1
|
||||||
|
m_LightmapKeepDirCombined: 1
|
||||||
|
m_LightmapKeepDynamicPlain: 1
|
||||||
|
m_LightmapKeepDynamicDirCombined: 1
|
||||||
|
m_LightmapKeepShadowMask: 1
|
||||||
|
m_LightmapKeepSubtractive: 1
|
||||||
|
m_FogKeepLinear: 1
|
||||||
|
m_FogKeepExp: 1
|
||||||
|
m_FogKeepExp2: 1
|
||||||
|
m_AlbedoSwatchInfos: []
|
||||||
|
m_LightsUseLinearIntensity: 0
|
||||||
|
m_LightsUseColorTemperature: 0
|
295
ProjectSettings/InputManager.asset
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!13 &1
|
||||||
|
InputManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Axes:
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Horizontal
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton: left
|
||||||
|
positiveButton: right
|
||||||
|
altNegativeButton: a
|
||||||
|
altPositiveButton: d
|
||||||
|
gravity: 3
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 3
|
||||||
|
snap: 1
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Vertical
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton: down
|
||||||
|
positiveButton: up
|
||||||
|
altNegativeButton: s
|
||||||
|
altPositiveButton: w
|
||||||
|
gravity: 3
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 3
|
||||||
|
snap: 1
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire1
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: left ctrl
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: mouse 0
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire2
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: left alt
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: mouse 1
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire3
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: left shift
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: mouse 2
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Jump
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: space
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Mouse X
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0
|
||||||
|
sensitivity: 0.1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 1
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Mouse Y
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0
|
||||||
|
sensitivity: 0.1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 1
|
||||||
|
axis: 1
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Mouse ScrollWheel
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0
|
||||||
|
sensitivity: 0.1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 1
|
||||||
|
axis: 2
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Horizontal
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0.19
|
||||||
|
sensitivity: 1
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 2
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Vertical
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton:
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 0
|
||||||
|
dead: 0.19
|
||||||
|
sensitivity: 1
|
||||||
|
snap: 0
|
||||||
|
invert: 1
|
||||||
|
type: 2
|
||||||
|
axis: 1
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire1
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 0
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire2
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 1
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Fire3
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 2
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Jump
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: joystick button 3
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton:
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Submit
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: return
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: joystick button 0
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Submit
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: enter
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: space
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
m_Name: Cancel
|
||||||
|
descriptiveName:
|
||||||
|
descriptiveNegativeName:
|
||||||
|
negativeButton:
|
||||||
|
positiveButton: escape
|
||||||
|
altNegativeButton:
|
||||||
|
altPositiveButton: joystick button 1
|
||||||
|
gravity: 1000
|
||||||
|
dead: 0.001
|
||||||
|
sensitivity: 1000
|
||||||
|
snap: 0
|
||||||
|
invert: 0
|
||||||
|
type: 0
|
||||||
|
axis: 0
|
||||||
|
joyNum: 0
|
91
ProjectSettings/NavMeshAreas.asset
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!126 &1
|
||||||
|
NavMeshProjectSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
areas:
|
||||||
|
- name: Walkable
|
||||||
|
cost: 1
|
||||||
|
- name: Not Walkable
|
||||||
|
cost: 1
|
||||||
|
- name: Jump
|
||||||
|
cost: 2
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
- name:
|
||||||
|
cost: 1
|
||||||
|
m_LastAgentTypeID: -887442657
|
||||||
|
m_Settings:
|
||||||
|
- serializedVersion: 2
|
||||||
|
agentTypeID: 0
|
||||||
|
agentRadius: 0.5
|
||||||
|
agentHeight: 2
|
||||||
|
agentSlope: 45
|
||||||
|
agentClimb: 0.75
|
||||||
|
ledgeDropHeight: 0
|
||||||
|
maxJumpAcrossDistance: 0
|
||||||
|
minRegionArea: 2
|
||||||
|
manualCellSize: 0
|
||||||
|
cellSize: 0.16666667
|
||||||
|
manualTileSize: 0
|
||||||
|
tileSize: 256
|
||||||
|
accuratePlacement: 0
|
||||||
|
debug:
|
||||||
|
m_Flags: 0
|
||||||
|
m_SettingNames:
|
||||||
|
- Humanoid
|
56
ProjectSettings/Physics2DSettings.asset
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!19 &1
|
||||||
|
Physics2DSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Gravity: {x: 0, y: -9.81}
|
||||||
|
m_DefaultMaterial: {fileID: 0}
|
||||||
|
m_VelocityIterations: 8
|
||||||
|
m_PositionIterations: 3
|
||||||
|
m_VelocityThreshold: 1
|
||||||
|
m_MaxLinearCorrection: 0.2
|
||||||
|
m_MaxAngularCorrection: 8
|
||||||
|
m_MaxTranslationSpeed: 100
|
||||||
|
m_MaxRotationSpeed: 360
|
||||||
|
m_BaumgarteScale: 0.2
|
||||||
|
m_BaumgarteTimeOfImpactScale: 0.75
|
||||||
|
m_TimeToSleep: 0.5
|
||||||
|
m_LinearSleepTolerance: 0.01
|
||||||
|
m_AngularSleepTolerance: 2
|
||||||
|
m_DefaultContactOffset: 0.01
|
||||||
|
m_JobOptions:
|
||||||
|
serializedVersion: 2
|
||||||
|
useMultithreading: 0
|
||||||
|
useConsistencySorting: 0
|
||||||
|
m_InterpolationPosesPerJob: 100
|
||||||
|
m_NewContactsPerJob: 30
|
||||||
|
m_CollideContactsPerJob: 100
|
||||||
|
m_ClearFlagsPerJob: 200
|
||||||
|
m_ClearBodyForcesPerJob: 200
|
||||||
|
m_SyncDiscreteFixturesPerJob: 50
|
||||||
|
m_SyncContinuousFixturesPerJob: 50
|
||||||
|
m_FindNearestContactsPerJob: 100
|
||||||
|
m_UpdateTriggerContactsPerJob: 100
|
||||||
|
m_IslandSolverCostThreshold: 100
|
||||||
|
m_IslandSolverBodyCostScale: 1
|
||||||
|
m_IslandSolverContactCostScale: 10
|
||||||
|
m_IslandSolverJointCostScale: 10
|
||||||
|
m_IslandSolverBodiesPerJob: 50
|
||||||
|
m_IslandSolverContactsPerJob: 50
|
||||||
|
m_AutoSimulation: 1
|
||||||
|
m_QueriesHitTriggers: 1
|
||||||
|
m_QueriesStartInColliders: 1
|
||||||
|
m_CallbacksOnDisable: 1
|
||||||
|
m_ReuseCollisionCallbacks: 0
|
||||||
|
m_AutoSyncTransforms: 0
|
||||||
|
m_AlwaysShowColliders: 0
|
||||||
|
m_ShowColliderSleep: 1
|
||||||
|
m_ShowColliderContacts: 0
|
||||||
|
m_ShowColliderAABB: 0
|
||||||
|
m_ContactArrowScale: 0.2
|
||||||
|
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
|
||||||
|
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
|
||||||
|
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
|
||||||
|
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
|
||||||
|
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|