-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: deserialized scene should have node transforms invalidated at in…
…itial (#16353) * Bug: deserialized scene should have node transforms invalidated * Remove transformFlags modification in _onBatchCreated
- Loading branch information
1 parent
5465d2b
commit 767f44a
Showing
4 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { deserialize } from "../../cocos/serialization"; | ||
import '../utils/matchers/value-type-asymmetric-matchers'; | ||
import { v3 } from "../../cocos/core"; | ||
import { Scene } from "../../cocos/scene-graph"; | ||
|
||
test(`Bugfix cocos/cocos-engine#16352: deserialized scene should have node transforms invalidated`, () => { | ||
const archive = [{ | ||
__type__: 'cc.Scene', | ||
_children: [{ | ||
__type__: 'cc.Node', | ||
_name: 'Node', | ||
_lscale: { | ||
__type__: 'cc.Vec3', | ||
x: 2, | ||
y: 1, | ||
z: 1, | ||
}, | ||
}], | ||
}]; | ||
|
||
const scene = deserialize(archive) as Scene; | ||
|
||
const node = scene.getChildByPath('Node')!; | ||
expect(node).not.toBeNull(); | ||
expect(node.worldScale).toBeCloseToVec3(v3(2, 1, 1)); | ||
}); |