
import ResDic from "./ResDic";
import { DispatcherControl, DispatcherState } from "./DispatcherControl";

export class AssetManager{
    private static ins:AssetManager;
    //主场景
    public mainscene:Laya.Scene3D;
    //主相机
    public maincamera:Laya.Camera;
    //僵尸
    public Zombie:ResDic = new ResDic();
    //警察
    public Police:ResDic = new ResDic();
    //平民
    public People:ResDic = new ResDic();
    
    constructor(){
        AssetManager.ins = this;
        // DispatcherControl.DispatcherOn(DispatcherState.GoldGet,this,this.Init);
    }
    public static get Instance():AssetManager{
        if(AssetManager.ins){
            return AssetManager.ins;
        }
        else{
            return new AssetManager();
        }
    }
  
    Init(){
        Laya.stage.addChild(this.mainscene);
        this.maincamera = this.mainscene.getChildByName("MainCamera") as Laya.Camera;
    }


}
export class ResourcesPath{
    private static ins:ResourcesPath;
    constructor(){
        ResourcesPath.ins = this;
    }
    public static get Instance():ResourcesPath{
        if(ResourcesPath.ins){
            return ResourcesPath.ins
        }
        else{
            return new ResourcesPath();
        }
    }
    static MainScene = "Game/res/MainScene/LayaScene_mainscene/Conventional/mainscene.ls";
    static People = 
    [
        "Game/res/Role/LayaScene_mainscene/Conventional/role1.lh",
        "Game/res/Role/LayaScene_mainscene/Conventional/role2.lh",
        "Game/res/Role/LayaScene_mainscene/Conventional/role3.lh"
    ]
    static Police = "Game/res/Role/LayaScene_mainscene/Conventional/police.lh";
    static Zombie = "Game/res/Role/LayaScene_mainscene/Conventional/Zombie.lh";
}