RT,今天对以往的项目进行一波大的整理归档,业务框架更新维护。
顺便集中记录一下个人发现的一些:已解决,未解决,未知原因,等等状态的BUG,每个BUG都是亲身经历,如数家珍。
问题:切换编辑 Prefab / Scene 时,3D 按钮状态不会改变。
解决方案:狠狠点它几下。
Creator 中 PhysicsManager.testPoint() 为什么只能检测动态刚体 - Creator 2.x - Cocos中文社区
问题:PhysicsManager.testPoint() 只监测动态物体。
解决方案:自定义引擎成本高,直接在项目中加入增量修改:
function PhysicsAABBQueryCallback() {
this._point = new b2.Vec2();
this._isPoint = false;
this._fixtures = [];
}
PhysicsAABBQueryCallback.prototype.init = function (point) {
if (point) {
this._isPoint = true;
this._point.x = point.x;
this._point.y = point.y;
}
else {
this._isPoint = false;
}
this._fixtures.length = 0;
};
PhysicsAABBQueryCallback.prototype.ReportFixture = function (fixture) {
var body = fixture.GetBody();
if (this._isPoint) {
if (fixture.TestPoint(this._point)) {
this._fixtures.push(fixture);
// We are done, terminate the query.
return false;
}
}
else {
this._fixtures.push(fixture);
}
// https://forum.cocos.org/t/creator-physicsmanager-testpoint/61757
// Creator 中 PhysicsManager.testPoint() 为什么只能检测动态刚体
// if (body.GetType() === cc.RigidBodyType.Dynamic) {
// }
// True to continue the query, false to terminate the query.
return true;
};
PhysicsAABBQueryCallback.prototype.getFixture = function () {
return this._fixtures[0];
};
PhysicsAABBQueryCallback.prototype.getFixtures = function () {
return this._fixtures;
};
cc.PhysicsAABBQueryCallback = PhysicsAABBQueryCallback;
module.exports = PhysicsAABBQueryCallback;
问题: 摄像机在不勾选AlignWithScreen时黑屏 - Creator 2.x - Cocos中文社区
解决方案:自定义引擎成本高,直接在项目中加入增量修改:
Object.assign(cc.Camera.prototype, {
beforeDraw: function () {
if (!this._camera) return;
if (this._alignWithScreen) {
this._onAlignWithScreen();
}
else {
let fov = this._fov * cc.macro.RAD;
this.node.z = this._orthoSize * 2 / (Math.tan(fov / 2) * 2);
fov = Math.atan(Math.tan(fov / 2) / this.zoomRatio) * 2;
this._camera.setFov(fov);
this._camera.setOrthoHeight(this._orthoSize / this.zoomRatio);
}
this._camera.dirty = true;
},
});
这个是有问题的。因为写死了z轴,编辑器的摄像机Z轴会被这个代码定死。
问题:ResizeMode.Container 的 cc.Layout 在最后一个子节点删除时,尺寸不会更新。
解决方案:未解决。
2d摄像机 写死Z轴有啥影响么?
还有想问问视频播放在安卓上这个问题有解决方案吗??????安卓!!!是安卓!!!!
就是在安卓上使用VideoPlayer播放视频的时候需要隐藏掉控制按钮
Android 上本身就是没有控制按钮的
这个可以随时去掉没问题的。。。你不能要求用户把这个东西看完啊。。然后,如果解决不了的话你可以考虑接一个第三方的播放器也是可以的。
在2.4.6 中spine动画,Use Tint 也就是染色功能。如果动画中使用了染色功能,并且在项目中勾选了Use Tint在web显示正常。Android 不行。染色没有效果。
问题:在Android spine动画染色功能失效。
解决方案:未解决
做的需求是类似王者荣耀登录界面,那种播动画,目的不是让人看完,就是能看到视频就好
接个第三方吧,TXVodPlayer 或者git StandardGSYVideoPlayer都可以,接入也很简单.
TXVodPlayer可以教一下如何接入吗?
你就去看腾讯的那个sdk就行了,有啥搞不定的再问我。。我就是按那个来的。
如果要在2.4X 做3D功能,进入3D后,包括编辑器视图的camera全会被锁定Z。