From abe97e390d2427dc8cb39a476c34ce998db83ff0 Mon Sep 17 00:00:00 2001 From: gameu3d Date: Fri, 24 May 2019 16:58:35 +0800 Subject: [PATCH] fix euler data problem (#4486) * fix euler data problem * update euler before serialize --- cocos/scene-graph/node.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos/scene-graph/node.ts b/cocos/scene-graph/node.ts index 7e4e846e8f..d9b984108c 100644 --- a/cocos/scene-graph/node.ts +++ b/cocos/scene-graph/node.ts @@ -193,7 +193,7 @@ class Node extends BaseNode { vec3.copy(this._pos, this._lpos); quat.copy(this._rot, this._lrot); vec3.copy(this._scale, this._lscale); - this._eulerDirty = this._dirty = this._hasChanged = true; + this._dirty = this._hasChanged = true; this._eventMask = 0; for (const child of this._children) { child._onBatchCreated(); @@ -204,6 +204,11 @@ class Node extends BaseNode { this._onBatchCreated(); } + public _onBeforeSerialize () { + // tslint:disable-next-line: no-unused-expression + this.eulerAngles; // make sure we save the correct eulerAngles + } + // =============================== // transform helper, convenient but not the most efficient // ===============================