[LayaAirIDE 2.0]2.3.0beta 各种bug
最最无语的是,断点不能打在.ts里面,非得打bundle.js!!!,真不知道是啥想法
错误代码编译也能通过,修改
typescript({
check: true, //Set to false to avoid doing any diagnostic checks on the code
tsconfigOverride:{compilerOptions:{removeComments: true}}
}),如果有
async(){
await xxxx
}会报这个错误
TS2354: [31mThis syntax requires an imported helper but module 'tslib' cannot be found.
一、万年没修成功过的自定义导出类 自动添加Laya前缀问题
二、切换类库依旧报错
三、拖尾依然没提供重置方法,带拖尾的特效非得销毁吗!!!! 每次升级引擎都需要自己修改
四、2.1的代码,库升级到2.3.0beta。物理碰撞全部失效。要重新写?
五、安卓版百度小游戏如果昵称是表情包,会卡屏
//文字输出为表情的时候报错兼容
if (rect) {
if (rect[2] == -1)
rect[2] = Math.ceil((cri.width + lineWidth * 2) * this.lastScaleX);
}
var dt_w = w != 0 ? w : 1;
var dt_h = h != 0 ? h : 1;
if(rect){
dt_w = rect[2] != 0 ? rect[2] : 1;
dt_h = rect[3] != 0 ? rect[3] : 1;
}
var imgdt = rect ? (ctx.getImageData(rect[0], rect[1], dt_w, dt_h)) : (ctx.getImageData(0, 0,dt_w, dt_h));
vivo下
getStyle 有时候莫名为空
13518行
getStyle() {
this._style === SpriteStyle.EMPTY && (this._style = SpriteStyle.create());
if( this._style == null){
this._style = SpriteStyle.create()
}
return this._style;
}
core.js
vivo下getJSON报错兼容
static getJSON(key) {
if(Storage.support){
var obj = Storage.items.getItem(key);
if(obj){
return JSON.parse(obj);
}
}
return null;
// return JSON.parse(Storage.support ? Storage.items.getItem(key) : null);
}
错误代码编译也能通过,修改
typescript({
check: true, //Set to false to avoid doing any diagnostic checks on the code
tsconfigOverride:{compilerOptions:{removeComments: true}}
}),如果有
async(){
await xxxx
}会报这个错误
TS2354: [31mThis syntax requires an imported helper but module 'tslib' cannot be found.
一、万年没修成功过的自定义导出类 自动添加Laya前缀问题
二、切换类库依旧报错
三、拖尾依然没提供重置方法,带拖尾的特效非得销毁吗!!!! 每次升级引擎都需要自己修改
四、2.1的代码,库升级到2.3.0beta。物理碰撞全部失效。要重新写?
五、安卓版百度小游戏如果昵称是表情包,会卡屏
//文字输出为表情的时候报错兼容
if (rect) {
if (rect[2] == -1)
rect[2] = Math.ceil((cri.width + lineWidth * 2) * this.lastScaleX);
}
var dt_w = w != 0 ? w : 1;
var dt_h = h != 0 ? h : 1;
if(rect){
dt_w = rect[2] != 0 ? rect[2] : 1;
dt_h = rect[3] != 0 ? rect[3] : 1;
}
var imgdt = rect ? (ctx.getImageData(rect[0], rect[1], dt_w, dt_h)) : (ctx.getImageData(0, 0,dt_w, dt_h));
vivo下
getStyle 有时候莫名为空
13518行
getStyle() {
this._style === SpriteStyle.EMPTY && (this._style = SpriteStyle.create());
if( this._style == null){
this._style = SpriteStyle.create()
}
return this._style;
}
core.js
vivo下getJSON报错兼容
static getJSON(key) {
if(Storage.support){
var obj = Storage.items.getItem(key);
if(obj){
return JSON.parse(obj);
}
}
return null;
// return JSON.parse(Storage.support ? Storage.items.getItem(key) : null);
}
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
136*****740
赞同来自:
自定义导出类 自动添加Laya前缀问题可以这样解决
在 compile.js 添加task 替换文件
// 如果是发布时调用编译功能,增加prevTasks
let prevTasks = "";
if (global.publish) {
prevTasks = ["loadConfig","替换Laya前缀"];
}else{
prevTasks = ["替换Laya前缀"]
}
const fs = require("fs");
function readFile(path) {
if (fs.existsSync(path)) {
return fs.readFileSync(path, "utf-8");
}
return null;
}
gulp.task('替换Laya前缀', function(){
var layaMaxUI_Path = workSpaceDir + "/src/ui/layaMaxUI.ts"
let fileContent = readFile(layaMaxUI_Path);
// console.log("读取文件",fileContent)
if (fileContent ) {
fileContent = fileContent.replace(/Laya\.UICodeView/g,"UICodeView");
fs.writeFileSync(layaMaxUI_Path, fileContent, 'utf-8');
}
}
);
默认的物理引擎碰撞被禁用的,需要重新开启
修改 laya.d3.js
class PhysicsCollider extends PhysicsTriggerComponent {
constructor(collisionGroup = Physics3DUtils.COLLISIONFILTERGROUP_DEFAULTFILTER, canCollideWith = Physics3DUtils.COLLISIONFILTERGROUP_ALLFILTER) {
super(collisionGroup, canCollideWith);
// this._enableProcessCollisions = false;
}
拖尾重置
拖尾提供重置方法
TrailFilter
resetGeometry(){
var render = this._owner._render;
var element = render._renderElements[0]._geometry;
element && element.resetGeometry()
}
TrailGeometry
resetGeometry(){
var count=this._endIndex;
for (var i=this._activeIndex;i < count;i++){
var nextIndex=i+1;
if (nextIndex!==count)
this._owner._totalLength-=this._subDistance[nextIndex];
if (this._isTempEndVertex && (nextIndex===count-1)){
var offset=this._floatCountPerVertices1 *i *2;
var fixedPos=this._lastFixedVertexPosition;
fixedPos.x=this._vertices1[0];
fixedPos.y=this._vertices1[1];
fixedPos.z=this._vertices1[2];
this._isTempEndVertex=false;
}
this._activeIndex++;
}
}