12
13
14
15
16
17
18
|
using
UnityEngine
;
using
System
.
Collections
;
using
UnityEditor
;
using
System
.
IO
;
public
class
Post
:
AssetPostprocessor
{
void
OnPostprocessTexture
(
Texture2D
texture
)
{
string
AtlasName
=
new
DirectoryInfo
(
Path
.
GetDirectoryName
(
assetPath
)
)
.
Name
;
TextureImporter
textureImporter
=
assetImporter
as
TextureImporter
;
textureImporter
.
textureType
=
TextureImporterType
.
Sprite
;
textureImporter
.
spritePackingTag
=
AtlasName
;
textureImporter
.
mipmapEnabled
=
false
;
}
}
|
12
13
14
15
16
17
18
|
using
UnityEngine
;
using
System
.
Collections
;
using
UnityEditor
;
using
System
.
IO
;
public
class
Post
:
AssetPostprocessor
{
void
OnPostprocessTexture
(
Texture2D
texture
)
{
string
AtlasName
=
new
DirectoryInfo
(
Path
.
GetDirectoryName
(
assetPath
)
)
.
Name
;
TextureImporter
textureImporter
=
assetImporter
as
TextureImporter
;
textureImporter
.
textureType
=
TextureImporterType
.
Sprite
;
textureImporter
.
spritePackingTag
=
AtlasName
;
textureImporter
.
mipmapEnabled
=
false
;
}
}
|