
export  class AssetPath {

    public static MainScene = "subpackage/LayaScene_main/Conventional/main.ls";
    public static Player = ["subpackage/LayaScene_role/Conventional/player1.lh",
        "subpackage/LayaScene_role/Conventional/player2.lh",
        "subpackage/LayaScene_role/Conventional/player3.lh",
        "subpackage/LayaScene_role/Conventional/player4.lh",
        "subpackage/LayaScene_role/Conventional/player5.lh",
        "subpackage/LayaScene_role/Conventional/player6.lh",
    ];

    /******************************************************************** */
    private loadUI():void {
			
		Laya.loader.load(["res/threeDimen/ui/button.png"], Laya.Handler.create(this, function():void {
				
			var changeActionButton = Laya.stage.addChild(new Laya.Button("res/threeDimen/ui/button.png", "切换注视目标")) as Laya.Button;
			changeActionButton.size(200, 40);
			changeActionButton.labelBold = true;
			changeActionButton.labelSize = 30;
			changeActionButton.sizeGrid = "4,4,4,4";
			changeActionButton.scale(Laya.Browser.pixelRatio, Laya.Browser.pixelRatio);
			changeActionButton.pos(Laya.stage.width / 2 - changeActionButton.width * Laya.Browser.pixelRatio / 2 , Laya.stage.height - 100 * Laya.Browser.pixelRatio);
				
			changeActionButton.on(Laya.Event.CLICK, this, function():void{
				this.index++;
				if (this.index % 3 === 1 ){
					//摄像机捕捉模型目标
					this.camera.transform.lookAt(this.box.transform.position, this.upVector);
				}
				else if (this.index % 3 === 2){
					//摄像机捕捉模型目标
					this.camera.transform.lookAt(this.cylinder.transform.position, this.upVector);
				}
				else{
					//摄像机捕捉模型目标
					this.camera.transform.lookAt(this.capsule.transform.position, this.upVector);
				}
			});
					
		}));
	}		
    /******************************************************************** */
    public static Enemy = "subpackage/LayaScene_role/Conventional/enemy.lh";
    public static PlayerShot = "subpackage/LayaScene_prop/Conventional/PlayerBullet.lh";
    public static Mound = "subpackage/LayaScene_prop/Conventional/Tower.lh";

    public static Barrier = [
        "subpackage/LayaScene_barrier/Conventional/barrier_1.lh",
        "subpackage/LayaScene_barrier/Conventional/barrier_2.lh",
        "subpackage/LayaScene_barrier/Conventional/barrier_3.lh",
        "subpackage/LayaScene_barrier/Conventional/barrier_4.lh",
        "subpackage/LayaScene_barrier/Conventional/move_barrier.lh",
        "subpackage/LayaScene_barrier/Conventional/stone_1.lh",
        "subpackage/LayaScene_barrier/Conventional/stone_2.lh",
        "subpackage/LayaScene_barrier/Conventional/stone_3.lh",
        "subpackage/LayaScene_barrier/Conventional/stone_4.lh",
        "subpackage/LayaScene_barrier/Conventional/Block1.lh",
    ]

    public static Particle=[
        "subpackage/LayaScene_effect/Conventional/boom.lh",
        "subpackage/LayaScene_effect/Conventional/hit.lh",
        "subpackage/LayaScene_effect/Conventional/xue.lh",
    ]

    public static Config = {
        level: "level",
        road: "road",
        block: "block",
        thing: "thing",
        atk: "atk",
        rate: "rate",
        global: "global",
        theme:"theme"
    };
}


export class AppSetting {

    /******************************************************************** */
    private scene:Laya.Scene3D;
	private camera:Laya.Camera;
	private _ray:Laya.Ray;
	private _outHitResult:Laya.HitResult = new Laya.HitResult();
	private outs:Array<Laya.HitResult> = new Array<Laya.HitResult>();
	private posX:number = 0.0;
	private posY:number = 0.0;
	private point:Laya.Vector2 = new Laya.Vector2();

	private tmpVector:Laya.Vector3;
	private albedoColor:Laya.Vector4;	
    public addBoxXYZ(x, y, z):void {
		var mat1 = new Laya.BlinnPhongMaterial();
		Laya.Texture2D.load("res/threeDimen/Physics/rocks.jpg", Laya.Handler.create(null, function(tex) {
			mat1.albedoTexture = tex;
		}));
		
		//随机生成坐标值
		var sX = Math.random() * 0.75 + 0.25;
		var sY = Math.random() * 0.75 + 0.25;
		var sZ = Math.random() * 0.75 + 0.25;
		//创建盒型MeshSprite3D
		var box = new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(sX, sY, sZ));
		this.scene.addChild(box);
		//设置材质
		box.meshRenderer.material = mat1;
		this.tmpVector.setValue(x, y, z);
		box.transform.position = this.tmpVector;
		//设置欧拉角
		this.tmpVector.setValue(Math.random() * 360, Math.random() * 360, Math.random() * 360);
		box.transform.rotationEuler = this.tmpVector;
		//创建刚体碰撞器
		var rigidBody = box.addComponent(Laya.Rigidbody3D) as Laya.Rigidbody3D;
		//创建盒子形状碰撞器
		var boxShape = new Laya.BoxColliderShape(sX, sY, sZ);
		//设置盒子的碰撞形状
		rigidBody.colliderShape = boxShape; 
		//设置刚体的质量
		rigidBody.mass = 10;
    }
    /******************************************************************** */
    
    public static sharetitle: string;
    public static shareimage: string;

    //public static keyboxLevelcount: number

    public static bannerCanMove: number;
    public static moveTime: number=1;
    public static OpenSceneValue: number;
    public static freeUpdateVideotime:number;
    public static freecoinValue:number;
    public static freeGetcoinTime:number;

    //误触
    public static cheat:string;
    //误触时间
    public static cheattime:number;
    //检测场景值
    public static checkscene:string;
}


