[]LayaAir 2.0 TS版编译出错GameConfig跟创建项目时生成的内容不一致了
这是创建项目时的内容
TypeScript error: src/gameconfig.ts(11,27): Error TS2552: Cannot find name 'script'. Did you mean 'WScript'?
/**This class is automatically generated by LayaAirIDE, please do not make any modifications. */编译之后变成:
import GameUI from "./script/GameUI"
import GameControl from "./script/GameControl"
import Bullet from "./script/Bullet"
import DropBox from "./script/DropBox"
/*
* 游戏初始化配置;
*/
export default class GameConfig{
static width:number=640;
static height:number=1136;
static scaleMode:string="fixedwidth";
static screenMode:string="none";
static startScene:string="test/TestScene.scene";
static sceneRoot:string="";
static debug:boolean=false;
static stat:boolean=false;
static physicsDebug:boolean=false;
static exportSceneToJson:boolean=true;
constructor(){}
static init(){
var reg: Function = Laya.ClassUtils.regClass;
reg("script/GameUI.ts",GameUI);
reg("script/GameControl.ts",GameControl);
reg("script/Bullet.ts",Bullet);
reg("script/DropBox.ts",DropBox);
}
}
GameConfig.init();
/*并提示错误:
* 游戏初始化配置;
*/
class GameConfig{
static width:number=1136;
static height:number=640;
static scaleMode:string="showall";
static screenMode:string="none";
static alignV:string="top";
static alignH:string="left";
static startScene:any=script/GameUI.ts;
static sceneRoot:string="";
static debug:boolean=false;
static stat:boolean=false;
constructor(){
}
}
TypeScript error: src/gameconfig.ts(11,27): Error TS2552: Cannot find name 'script'. Did you mean 'WScript'?
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
Aar0n
赞同来自: 欢乐马07
hj
赞同来自: