public void Bake()
{
// Validate Project Platform
if (!Unity3D2Babylon.Tools.ValidateProjectPlatform())
{
return;
}
try
{
atlasMaterial = null;
mainTextures = null;
bumpTextures = null;
bumpFilename = String.Empty;
hasBumpTexture = false;
CreateTextureAtlas();
PackTextureAtlasNormals();
ExporterWindow.ReportProgress(1, "Saving assets to disk...");
AssetDatabase.SaveAssets();
}
catch (Exception ex)
{
UnityEngine.Debug.LogException(ex);
}
finally
{
ExporterWindow.ReportProgress(1, "Refresing assets database...");
AssetDatabase.Refresh();
ExporterWindow.ReportProgress(1, "Texture atlas baking complete.");
EditorUtility.ClearProgressBar();
}
this.Close();
}