Exemple #1
0
    static void CreateTextureAtlas()
    {
        var srcFolder = EditorUtility.OpenFolderPanel("Select Source Images Folder", "", "");
        var destFolder = EditorUtility.SaveFolderPanel("Select Location for Atlas", "", "");
        if(srcFolder.Contains("Assets") != true && destFolder.Contains ("Assets") != true) {
            Debug.LogError("Both source and destination folders must be in the project hierarchy");
            return;
        }

        var generator = new AtlasGenerator(srcFolder, destFolder);
        generator.ProcessAndSave();
    }