mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 17:42:41 +08:00
767f44a313
* Bug: deserialized scene should have node transforms invalidated * Remove transformFlags modification in _onBatchCreated
26 lines
802 B
TypeScript
26 lines
802 B
TypeScript
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));
|
|
}); |