[]2.0 Beta3版本中,runtime脚本的的问题

给一个图片的runtime设置 “game/ImageRunTime.ts”
如果这个图片没有取名,就是var属性为空, 运行起来是OK的,runtime也生效了, 如果 给它取名了, 比如:

(Q29{8KA450KGKH46G{1O)1.png

就成这样了~
 
用2.0的beta 3版本的, 之前 想自定义组件,发现不行,小明给我说那个编译库不兼容。暂时不能自定义,让我用runtime, runtime也够折腾的, 也没搞成, 我现在不知道是我的问题,还是程序 的问题?
 
我试着把runtime脚本中的类单独导出, 或者写在模块里导出, 各种办法都试了,就是不行?
 
能不能麻烦老大在这个版本测试一下, 如果能搞成给我个demo行吗, 折腾好久了
 
已邀请:

三五七

赞同来自:

未标题-1.png

 

三五七

赞同来自:

runtime设置, 是 “game/ImageRunTime.ts” 这样的形式,还是 “game.ImageRunTime”这样的形式?
 
这两种形式都试了效果是一样的!

Aar0n

赞同来自:

/*layaMaxUI.ts  *This class is automatically generated by LayaAirIDE, please do not make any modifications. */
import View=Laya.View;
import Dialog=Laya.Dialog;
import Scene=Laya.Scene;
export module ui {
export class BGPageUI extends View {
constructor(){ super()}
createChildren():void {
super.createChildren();
this.loadScene("BGPage");
}
}
export class MonkeyPageUI extends View {
constructor(){ super()}
createChildren():void {
super.createChildren();
this.loadScene("MonkeyPage");
}
}
}
 
 
===============================
/*GameConfig.ts *This class is automatically generated by LayaAirIDE, please do not make any modifications. */
import ImageRunTime from "./game/ImageRunTime"
/*
* 游戏初始化配置;
*/
export default class GameConfig{
static width:number=640;
static height:number=1136;
static scaleMode:string="fixedwidth";
static screenMode:string="none";
static alignV:string="top";
static alignH:string="left";
static startScene:any="mainscene.scene";
static sceneRoot:string="";
static debug:boolean=false;
static stat:boolean=false;
static physicsDebug:boolean=false;
static exportSceneToJson:boolean=false;
constructor(){}
static init(){
var reg: Function = Laya.ClassUtils.regClass;
reg("game/ImageRunTime.ts",ImageRunTime);
}
}
GameConfig.init();

Aar0n

赞同来自:

https://ldc2.layabox.com/doc/?nav=zh-as-2-4-1  照着文档,很快就做出来

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作