import EventDispatcher=Laya.EventDispatcher;
import Sprite3D = Laya.Sprite3D;
import Vector3=Laya.Vector3;
export class AssetPath
{
   
    /*粒子特效地址*/
    static FxPrefabsPath="res/character/FX/Conventional/FX.lh";

}

export class AssetManager
{

    /**所有地图*/
    static AllMapDic:Sprite3D[]=new Array();


    /**加载资源*/
    static LoadAssetFun(fun:Function)
    {
        var respaths:string[] = [];
        respaths=respaths.concat(AssetPath.FxPrefabsPath);
        Laya.loader.create(respaths,Laya.Handler.create(this,()=>{

           var PlayerPrefabs=Laya.loader.getRes(AssetPath.FxPrefabsPath) as Sprite3D;
           if(PlayerPrefabs)
           {
               for(var i=0;i<PlayerPrefabs.numChildren;i++)
               {
                  var asset=PlayerPrefabs.getChildAt(i) as Sprite3D;
                  asset.active=false;
                  this.AllMapDic.push(asset);
               }
               Laya.loader.clearRes(AssetPath.FxPrefabsPath);
           }else
           {
               console.log("PolicePrefabs为空");
           }


            if(fun)
            {
                fun();

            }else
            {
                console.log("fun为空");
            }

        }));

    }



}

