
using UnityEngine;
using UnityEditor;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Giant.Resource;


    public static class AssetbundleTool
    {
        static public BuildTarget currentBuildAssetbundleTarget = BuildTarget.StandaloneWindows64;

        const string kDiscreteResourceMode = "Giant Tools/AssetBundles/Use AssetBundles Resource";
        [MenuItem(kDiscreteResourceMode)]
        public static void ToggleSimulationMode()
        {
            AssetBundleManager.UseAssetBundle = !AssetBundleManager.UseAssetBundle;
            //if (!AssetBundleManager.UseAssetBundle)
            //    ResourcesFolderResource.Instance.BuildSceneList();
            //else
            //    ResourcesFolderResource.Instance.RestoreSceneBuildList();
        }


        [MenuItem(kDiscreteResourceMode, true)]
        public static bool ToggleSimulationModeValidate()
        {
            Menu.SetChecked(kDiscreteResourceMode, AssetBundleManager.UseAssetBundle);
            return true;
        }

        /*[MenuItem("Tools/AssetBundles(打包资源)/Build AssetBundles(Win)")]
        public static void CreateABByFileListWindows()
        {
            currentBuildAssetbundleTarget = BuildTarget.StandaloneWindows64;
            Exporter.CreateABForAssetFolder(BuildTarget.StandaloneWindows64);
        }


        [MenuItem("Tools/AssetBundles(打包资源)/Build AssetBundles(Android)")]
        public static void CreateABByFileListAndroid()
        {
            currentBuildAssetbundleTarget = BuildTarget.Android;
            Exporter.CreateABForAssetFolder(BuildTarget.Android);
        }

        [MenuItem("Tools/AssetBundles(打包资源)/Build AssetBundles(IOS)")]
        public static void CreateABByFileListIOS()
        {
            currentBuildAssetbundleTarget = BuildTarget.iOS;
            Exporter.CreateABForAssetFolder(BuildTarget.iOS);
        }
        */
        [MenuItem("Giant Tools/AssetBundles/Show AssetBundles(打包资源)")]
        public static void ShowAssetBundles()
        {
            ExporterWindow.OpenExporterWindow();
        }
}
