fix bug with reimport of texture
This commit is contained in:
@@ -342,16 +342,24 @@ namespace SplashEdit.RuntimeCode
|
||||
}
|
||||
string assetPath = AssetDatabase.GetAssetPath(texture);
|
||||
var tImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter;
|
||||
bool needReimport = false;
|
||||
if (tImporter != null)
|
||||
{
|
||||
if (tImporter.maxTextureSize > MaxTextureSize)
|
||||
{
|
||||
tImporter.maxTextureSize = MaxTextureSize;
|
||||
needReimport = true;
|
||||
}
|
||||
if (tImporter.isReadable != isReadable)
|
||||
{
|
||||
tImporter.isReadable = isReadable;
|
||||
needReimport = true;
|
||||
}
|
||||
if (needReimport)
|
||||
{
|
||||
AssetDatabase.ImportAsset(assetPath);
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
tImporter.isReadable = isReadable;
|
||||
|
||||
AssetDatabase.ImportAsset(assetPath);
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user