public static void SetupApiTestSettings(AssetbundleBuildSettings settings = null)
 {
     if (Application.isPlaying)
     {
         throw new System.Exception("This funcion cannot be called while playing!");
     }
     if (settings == null)
     {
         settings = AssetbundleBuildSettings.EditorInstance;
     }
     if (settings == null || !settings.IsValid())
     {
         throw new System.Exception("AssetbundleBuildSetting is not valid");
     }
     UseAssetDatabase = true;
     //create editor asset map only for testing
     s_EditorAssetMap = new EditorAssetMap(settings);
 }
        static void SetupAssetdatabaseUsage()
        {
            s_EditorBuildSettings = AssetbundleBuildSettings.EditorInstance;
            if (s_EditorBuildSettings == null || !s_EditorBuildSettings.IsValid())
            {
                throw new System.Exception("AssetbundleBuildSetting is not valid");
            }

            if (s_EditorBuildSettings.CleanCacheInEditor)
            {
                Caching.ClearCache();
            }

            UseAssetDatabase = !s_EditorBuildSettings.EmulateInEditor;

            //create editor asset map
            if (UseAssetDatabase)
            {
                s_EditorAssetMap = new EditorAssetMap(s_EditorBuildSettings);
                //set initialied so it does not need explit call initialzed when using aassetdatabase
                Initialized = true;
            }
        }