Files
cocos4/tests/asset-manager/common-class.ts
T
minggo 0d7c5c8f56 move cocos/core/scene-graph to cocos/scene-graph (#12868)
* 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``
2022-09-26 11:02:22 +08:00

69 lines
1.6 KiB
TypeScript

import { Asset } from "../../cocos/asset/assets/asset"
import { serializable, type } from "../../cocos/core/data/decorators";
import { ccclass } from "../../cocos/core/data/decorators/ccclass";
import { Vec2 } from "../../cocos/core/math";
import { Component } from "../../cocos/scene-graph";
@ccclass('TestTexture')
class TestTexture extends Asset{
@serializable
public width = 0;
@serializable
public height = 0;
}
@ccclass('TestSprite')
export class TestSprite extends Asset {
@serializable
public pivot = new Vec2(0.5, 0.5);
@serializable
public x = 0;
@serializable
public y = 0;
@serializable
public width = 0;
@serializable
public height = 0;
@type(TestTexture)
public texture = null;
@serializable
public rotated = false;
@serializable
public trimLeft = 0;
@serializable
public trimTop = 0;
@serializable
public rawWidth = 0;
@serializable
public rawHeight = 0;
//pixelLevelHitTest: false,
//alphaThreshold: 25,
@serializable
public insetTop = 0;
@serializable
public insetBottom = 0;
@serializable
public insetLeft = 0;
@serializable
public insetRight = 0;
get rotatedWidth () {
return this.rotated ? this.height : this.width;
}
get rotatedHeight () {
return this.rotated ? this.width : this.height;
}
}
@ccclass('TestScript')
class TestScript extends Component {
@type(Node)
target = null;
@type(Node)
target2 = null;
}
@ccclass('TestDependency')
class TestDependency extends Asset {
@serializable
dependency = null;
}