12345678910111213141516171819202122 |
- import { _decorator, Component, Game, game, Node } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('ch_sdk_comp')
- export class ch_sdk_comp extends Component {
- protected onLoad(): void {
- game.on(Game.EVENT_SHOW, () => {
- chsdk.sdk_event.emit(chsdk.sdk_event.key.show);
- }, this);
- game.on(Game.EVENT_HIDE, () => {
- chsdk.sdk_event.emit(chsdk.sdk_event.key.hide);
- }, this);
- /*window.addEventListener("blur", () => {
- chsdk.sdk_event.emit(chsdk.sdk_event.key.hide);
- });
- window.addEventListener("focus", () => {
- chsdk.sdk_event.emit(chsdk.sdk_event.key.show);
- });*/
- }
- }
|