3e7d59d5-5478-474a-bb27-6eddb22dc614 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { _decorator, Component, Node } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('<%UnderscoreCaseClassName%>')
  4. export class <%UnderscoreCaseClassName%> extends Component {
  5. start() {
  6. }
  7. update(deltaTime: number) {
  8. }
  9. }
  10. /**
  11. * COMMENTS_GENERATE_IGNORE
  12. * Use "COMMENTS_GENERATE_IGNORE" tag if you do not want later created scripts to contain these comments.
  13. *
  14. * Predefined Variables
  15. * You can use predefined variables below to setup your scripting preference. For example, whether to use camel case style.
  16. *
  17. * <%UnderscoreCaseClassName%>, class name in underscore format, like 'new_component'
  18. * <%CamelCaseClassName%>, class name in camel format, like 'NewComponent'
  19. * <%Author%>, Who create this file
  20. * <%DateTime%>, when create this file
  21. * <%FileBasename%>, creating file name with extension
  22. * <%FileBasenameNoExtension%>, creating file name without extension
  23. * <%URL%>, url of this file in COCOS ASSET URL format
  24. * <%ManualUrl%>, url of office help document, like 'https://docs.cocos.com/creator/manual/en/'
  25. *
  26. *
  27. * Example:
  28. *
  29. @ccclass('<%UnderscoreCaseClassName%>')
  30. export class <%UnderscoreCaseClassName%> extends Component {
  31. // class member could be defined like this.
  32. dummy = '';
  33. // Use 'property' decorator if your want the member to be serializable.
  34. @property
  35. serializableDummy = 0;
  36. start () {
  37. // Your initialization goes here.
  38. }
  39. update (deltaTime: number) {
  40. // Your update function goes here.
  41. }
  42. }
  43. *
  44. * Learn more about scripting: <%ManualUrl%>scripting/
  45. * Learn more about CCClass: <%ManualUrl%>scripting/decorator.html
  46. * Learn more about life-cycle callbacks: <%ManualUrl%>scripting/life-cycle-callbacks.html
  47. */