[0]自建view挂载任何runtime都是undefined

ide版本:2.13.1
系统:win10
 
新建2d展示项目---->得到自动生成的子弹打箱子游戏,运行成功
 
新建一个MainTest.scene, 仅拖入一个按钮,设置导出为分享模式,F9设为启动场景,运行成功,出现了此view
 
给新建的MainTest.scene runtime拖入已存在的脚本,Bullet.ts,保存清理导出,运行出错,Uncaught can not find scene:script/Bullet.ts undefined
 
新建一个脚本MyTest.ts(与bullet同目录),给新建的MainTest.scene runtime拖入,保存清理导出,运行出错,Uncaught can not find scene:script/MyTest.ts undefined
 
删项目重复多次,必现
 
 
laya_bug.png


laya2.png


laya3.png


laya4.png

 
已邀请:

1567600631用户

赞同来自:

Laya的runtime一般要继承Laya的ui显示对象 比如view button 等ui显示对象
export default class TestVewRuntime extends Laya.View {
    constructor() {
        // alert(1);
        super();
    }
}
但是看你现在是继承的Laya的Script 所以你这个要改成添加组件 把这个文件拖到右边面板的添加组件的地方
 

要回复问题请先

商务合作
商务合作