import ResDic from "./ResDic";
import { EventManager, EventState } from "./EventManager";
import { GameTools } from "./GameTools";

export class AssetManager{
    private static ins:AssetManager;
    //主场景
    public mainscene:Laya.Scene3D;
    //主相机
    public maincamera:Laya.Camera;
    //灯光
    public Light:Laya.DirectionLight;
    // //plane
    // public Plane:Laya.Sprite3D;
    //boss
    public Boss:ResDic = new ResDic();
    //玩家
    public Player:ResDic = new ResDic();
    //马
    public Horse:ResDic = new ResDic();
    //帽子
    public Cap:ResDic = new ResDic();
    //道具
    public Prop:ResDic = new ResDic();
    //板子
    public Plane:ResDic = new ResDic();
    //石头
    public Stone:ResDic = new ResDic();
    //树
    public Tree:ResDic = new ResDic();
    //小栅栏  用作边界
    public Small_Fence:ResDic = new ResDic();
    
    constructor(){
        AssetManager.ins = this;
        EventManager.EventOn(EventState.LoadComplete,this,this.Init);
    }
    public static get Instance():AssetManager{
        if(AssetManager.ins){
            return AssetManager.ins
        }
        else{
            return new AssetManager();
        }
    }
    Init(){
        this.maincamera = this.mainscene.getChildByName("Main Camera") as Laya.Camera;
        this.maincamera.transform.position = new Laya.Vector3(0,10,-12);
        this.maincamera.transform.rotationEuler = new Laya.Vector3(-35.7,180,0);
        this.maincamera.enableHDR = false;
        this.Light = this.mainscene.getChildByName("Directional light") as Laya.DirectionLight;
        this.Light.intensity = 0.7;
        // this.Plane = this.mainscene.getChildByName("Plane") as Laya.Sprite3D;
        // GameTools.Instance.SetCollider(this.Plane,100);
        EventManager.EventTrigger(EventState.SceneInit);
    }
}
export class ResourcesPath{
    static MainScene = "Game/res/MainScene/LayaScene_Mainscene/Conventional/Mainscene.ls";
    
    static Boss = 
    [
        "Game/res/Role/LayaScene_Role/Conventional/boss.lh"
    ]
    static Player = 
    [
        "Game/res/Role/LayaScene_Role/Conventional/player.lh"
    ]
    static Horse =
    [
        "Game/res/Horse/LayaScene_Horse/Conventional/horse1.lh",
        "Game/res/Horse/LayaScene_Horse/Conventional/horse2.lh",
        "Game/res/Horse/LayaScene_Horse/Conventional/horse3.lh",
        "Game/res/Horse/LayaScene_Horse/Conventional/horse4.lh",
        "Game/res/Horse/LayaScene_Horse/Conventional/horse5.lh"
    ] 
    static Cap = 
    [
        "Game/res/Cap/LayaScene_Cap/Conventional/cap1.lh",
        "Game/res/Cap/LayaScene_Cap/Conventional/cap2.lh",
        "Game/res/Cap/LayaScene_Cap/Conventional/cap3.lh",
        "Game/res/Cap/LayaScene_Cap/Conventional/cap4.lh",
        "Game/res/Cap/LayaScene_Cap/Conventional/cap5.lh"
    ]
    //1.栅栏 2.火堆 3-11.石头 12.圆木堆 13.npc 14.npc/人质 15.小草 19 地面
    static Prop = "Game/res/Prop/LayaScene_Prop/Conventional/Prop.lh";
    
    
    // static Prop = 
    // {
    //     1:"Game/res/Prop/LayaScene_Prop/Conventional/Archer.lh",//弓
    //     2:"Game/res/Prop/LayaScene_Prop/Conventional/Arrow.lh",//箭
    //     3:"Game/res/Prop/LayaScene_Prop/Conventional/big_fence.lh",//大栅栏
    //     4:"Game/res/Prop/LayaScene_Prop/Conventional/small_fence.lh",//小栅栏
    //     5:"Game/res/Prop/LayaScene_Prop/Conventional/bonfire.lh",//火堆
    //     6:"Game/res/Prop/LayaScene_Prop/Conventional/stone1.lh",//石头
    //     7:"Game/res/Prop/LayaScene_Prop/Conventional/stone2.lh",
    //     8:"Game/res/Prop/LayaScene_Prop/Conventional/stone3.lh",
    //     9:"Game/res/Prop/LayaScene_Prop/Conventional/stone4.lh",
    //     10:"Game/res/Prop/LayaScene_Prop/Conventional/stone5.lh",
    //     11:"Game/res/Prop/LayaScene_Prop/Conventional/stone6.lh",
    //     12:"Game/res/Prop/LayaScene_Prop/Conventional/stone7.lh",
    //     13:"Game/res/Prop/LayaScene_Prop/Conventional/stone8.lh",
    //     14:"Game/res/Prop/LayaScene_Prop/Conventional/stone9.lh",
    //     15:"Game/res/Prop/LayaScene_Prop/Conventional/tree1.lh",//树
    //     16:"Game/res/Prop/LayaScene_Prop/Conventional/tree2.lh",
    //     17:"Game/res/Prop/LayaScene_Prop/Conventional/tree3.lh",
    //     18:"Game/res/Prop/LayaScene_Prop/Conventional/tree4.lh",
    //     19:"Game/res/Prop/LayaScene_Prop/Conventional/wood_Cylinder.lh",//圆木堆
    // }
        
}