mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
0d7c5c8f56
* move `cocos/core/scene-graph` to `cocos/scene-graph` * move some files in `cocos/core/components` to `cocos/scene-graph`: - component.ts - component-event-handler.ts - component-event-handler-schema.ts * move some files in `cocos/core/components` to `cocos/misc`: - missing-script.ts - model-renderer.ts - renderer.ts - camera-component.ts * move `cocos/core/components/system.ts` to ``cocos/core/system.ts``
32 lines
852 B
TypeScript
32 lines
852 B
TypeScript
import { Button } from "../../cocos/ui/button";
|
|
import { Node } from "../../cocos/scene-graph/node";
|
|
import { Vec3 } from "../../cocos/core/math/vec3";
|
|
|
|
test('Button scale with interactable', function () {
|
|
|
|
let node0 = new Node();
|
|
node0.addComponent(Button);
|
|
let button0 = node0.getComponent(Button) as Button;
|
|
|
|
|
|
let node1 = new Node();
|
|
node1.addComponent(Button);
|
|
let button1 = node1.getComponent(Button) as Button;
|
|
|
|
let newScale = new Vec3(0.5,0.5,0.5);
|
|
|
|
node0.scale = newScale;
|
|
button0.interactable = false;
|
|
|
|
button1.interactable = false;
|
|
node1.scale = newScale;
|
|
|
|
let same = Vec3.equals(node0.scale,node1.scale);
|
|
expect(same).toBe(true);
|
|
|
|
same = Vec3.equals(node0.scale,newScale);
|
|
expect(same).toBe(true);
|
|
|
|
same = Vec3.equals(node1.scale,newScale);
|
|
expect(same).toBe(true);
|
|
}); |