using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class ShowABWindow : EditorWindow
{
    public static void Open() {
        ShowABWindow window = EditorWindow.CreateWindow<ShowABWindow>();
        window.Show();
    }

    private void OnEnable()
    {

    }
    private Dictionary<string, bool> toggle = new Dictionary<string, bool>();

    private void OnGUI()
    {
        var dic = Exporter.GetBuildAssetList(BuildTarget.StandaloneWindows64);
        EditorGUILayout.BeginVertical();
        foreach (var kv in dic) {
            if (!toggle.ContainsKey(kv.Key))
                toggle.Add(kv.Key, false);
            toggle[kv.Key] = EditorGUILayout.BeginFoldoutHeaderGroup(toggle[kv.Key], kv.Key);

            if (toggle[kv.Key]) {
                for (int i = 0; i < kv.Value.Length; i++)
                {
                    EditorGUILayout.LabelField(kv.Value[i]);
                }
            }
            
            EditorGUILayout.EndFoldoutHeaderGroup();
        }
        EditorGUILayout.EndVertical();
    }
}
