import { _decorator, Component, EventKeyboard, EventTouch, Input, input, instantiate, KeyCode, Node, Prefab } from 'cc'; import {GameManager} from './Manager/GameManager' import { EventCustom } from './Common/EventCustom'; import { Global } from './Common/Global'; const { ccclass, property } = _decorator; @ccclass('MainGame') export class MainGame extends Component { @property(Prefab) Game: Prefab = null; _game: Node; start() { } showGame() { if (this._game) { this._game.destroy(); } let g = instantiate(this.Game); this.node.addChild(g); g.setPosition(0,0); //g.setScale(1.5,1.5); this._game = g; } gameEnd() { if (this._game) { this._game.destroy(); } } }