mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
6c53d88327
* add scene-2d template * Update editor/assets/default_file_content/ts Co-authored-by: SijieWang <itharbors@outlook.com> Co-authored-by: SijieWang <itharbors@outlook.com>
45 lines
1017 B
Plaintext
45 lines
1017 B
Plaintext
|
|
import { _decorator, Component, Node } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
/**
|
|
* Predefined variables
|
|
* Name = <%Name%>
|
|
* DateTime = <%DateTime%>
|
|
* Author = <%Author%>
|
|
* FileBasename = <%FileBasename%>
|
|
* FileBasenameNoExtension = <%FileBasenameNoExtension%>
|
|
* URL = <%URL%>
|
|
* ManualUrl = <%ManualUrl%>
|
|
*
|
|
*/
|
|
|
|
@ccclass('<%Name%>')
|
|
export class <%Name%> extends Component {
|
|
// [1]
|
|
// dummy = '';
|
|
|
|
// [2]
|
|
// @property
|
|
// serializableDummy = 0;
|
|
|
|
start () {
|
|
// [3]
|
|
}
|
|
|
|
// 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: <%ManualUrl%>scripting/
|
|
* Learn more about CCClass: <%ManualUrl%>scripting/ccclass.html
|
|
* Learn more about life-cycle callbacks: <%ManualUrl%>scripting/life-cycle-callbacks.html
|
|
*/
|