player.ts 475 B

12345678910111213141516171819202122232425262728293031
  1. const { ccclass, property } = cc._decorator;
  2. @ccclass
  3. export default class player extends cc.Component {
  4. private static _instance: player = null;
  5. public static getInstance(): any {
  6. if (this._instance == null) {
  7. this._instance = new player();
  8. }
  9. return this._instance;
  10. }
  11. onLoad() {
  12. player._instance = this;
  13. }
  14. start(){
  15. }
  16. update(dt: number) {
  17. }
  18. }