mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-09-03 07:27:12 +08:00
32 lines
863 B
TypeScript
32 lines
863 B
TypeScript
|
|
import { _decorator, Component, Node, Graphics } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
|
|
@ccclass('GraphicsManager')
|
|
export class GraphicsManager extends Component {
|
|
|
|
@property({ type: Graphics })
|
|
pencil: Graphics = null;
|
|
|
|
start() {
|
|
|
|
}
|
|
|
|
// update (deltaTime: number) {
|
|
// // [4]
|
|
// }
|
|
}
|
|
|
|
/**
|
|
* [1] Class member could be defined like this.
|
|
* [2] Use `property` decorator if your want the member to be serializable.
|
|
* [3] Your initialization goes here.
|
|
* [4] Your update function goes here.
|
|
*
|
|
* Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
|
|
* Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/ccclass.html
|
|
* Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
|
|
*/
|