const { ccclass, property } = cc._decorator; @ccclass export default class player extends cc.Component { private static _instance: player = null; public static getInstance(): any { if (this._instance == null) { this._instance = new player(); } return this._instance; } onLoad() { player._instance = this; } start(){ } update(dt: number) { } }