"use strict";
cc._RF.push(module, 'e1b90/rohdEk4SdmmEZANaD', 'Helloworld');
// Script/Helloworld.ts

Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Helloworld = /** @class */ (function (_super) {
    __extends(Helloworld, _super);
    function Helloworld() {
        // @property(cc.Label)
        // label: cc.Label = null;
        var _this = _super !== null && _super.apply(this, arguments) || this;
        // @property
        // text: string = 'hello';
        // @property(cc.ToggleContainer)
        // ToggleContainer: cc.ToggleContainer = null
        // @property(cc.Node)
        // toggleitem: cc.Node = null
        // @property(cc.Sprite)
        // ttestspf: cc.Sprite = null
        _this.A = null;
        _this.B = null;
        // @property(cc.AudioClip)
        // mymusic: cc.AudioClip = null
        _this._ListToggle = [];
        _this._isc = false;
        _this._audioSource = null;
        _this._musicId = -1;
        return _this;
    }
    Helloworld.prototype.start = function () {
        var _this = this;
        this.A.on('click', function () {
            cc.director.loadScene('A');
        });
        // setTimeout(() => {
        //     if (!cc.audioEngine.isMusicPlaying()) {
        //         cc.audioEngine.playMusic(this.mymusic, false)
        //     }
        // }, 1000);
        // this._audioSource = this.node.getComponent(cc.AudioSource)
        // this._audioSource.volume = 0.5
        cc.loader.loadRes('lobbyBg', cc.AudioClip, function (err, sound) {
            if (err) {
                console.log('err');
                return;
            }
            cc.audioEngine.stopAll();
            _this._musicId = cc.audioEngine.playMusic(sound, true);
        });
    };
    Helloworld.prototype.onLoad = function () {
    };
    Helloworld.prototype.sliderCall = function (target) {
        console.log(target.progress);
        // this._audioSource.volume = target.progress
        cc.audioEngine.setMusicVolume(target.progress);
        // cc.audioEngine.setVolume(this._musicId,target.progress)
    };
    Helloworld.prototype.onDestroy = function () {
        cc.audioEngine.stop(this._musicId);
    };
    Helloworld.prototype.reload = function () {
        location.reload();
    };
    // click() {
    //     // cc.director.loadScene('Helloscene')
    //     let a = !this._isc
    //     this._ListToggle[0].check()
    // }
    Helloworld.prototype.joinChanel = function () {
        // agora.joinChannel(null, "123456789");
    };
    __decorate([
        property(cc.Node)
    ], Helloworld.prototype, "A", void 0);
    __decorate([
        property(cc.Node)
    ], Helloworld.prototype, "B", void 0);
    Helloworld = __decorate([
        ccclass
    ], Helloworld);
    return Helloworld;
}(cc.Component));
exports.default = Helloworld;
cc.game.on(cc.game.EVENT_HIDE, function () {
    console.log('cc.game.EVENT_HIDE');
    // cc.audioEngine.pauseMusic()
    // cc.audioEngine.pauseAllEffects()
    cc.audioEngine.setMusicVolume(0);
});
cc.game.on(cc.game.EVENT_SHOW, function () {
    console.log('cc.game.EVENT_SHOW');
    cc.audioEngine.setMusicVolume(1);
    // cc.audioEngine.resumeMusic()
    // cc.audioEngine.resumeAllEffects()
});

cc._RF.pop();