public void Init(SRSXocXocConfig config, AssetBundleSettingItem assetBundleConfig, XocXocSignalRServer server, SRSXocXoc xocXocData) { ClearUI(); _config = config; _xocxoc = xocXocData; _assetBundleConfig = assetBundleConfig; _settingSound = AudioAssistant.Instance.GetSettingSound(_config.gameId); _account = Database.Instance.Account(); _server = server; _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; transSystemChip.gameObject.SetActive(_xocxoc.session.RoomType == XocXocRoom.Fifty); uiPlayerMaster.gameObject.SetActive(_xocxoc.session.RoomType != XocXocRoom.Fifty); gUiCoints.ForEach(a => a.SetActive(_xocxoc.moneyType == MoneyType.COIN)); gUiGolds.ForEach(a => a.SetActive(_xocxoc.moneyType == MoneyType.GOLD)); SetNotify(""); LoadMoneyType(); LoadMyData(); LoadRoomData(); LoadRoomUser(); LoadGate(); FirstLoadPlayer(); LoadHistory(); LoadButtonMaster(); ChangeChip(uiChips[0]); UpdateGame(); }
public void Init() { UILayerController.Instance.ShowLoading(); uiSelect.gameObject.SetActive(false); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID); _soundSetting = AudioAssistant.Instance.GetSettingSound(_GAMEID, true); moneyType = (int)MoneyType.GOLD; _server = SignalRController.Instance.CreateServer <VuaBaoSignalRServer>((int)_GAMEID); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _server.SRSInit(_URL, _HUBNAME); this.roomIdSelected = 1; lastResult = null; this.isAuto = false; btAuto.SetupAll(false); vkBtBets[roomIdSelected - 1].VKInteractable = false; this.accountInfo = Database.Instance.Account(); ChangeSound(); ChangeTypeMoney(); slotMachine.ClearUI(); List <int> id = new List <int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 }; slotMachine.InitLineSelected(id); }
public void Init() { UILayerController.Instance.ShowLoading(); // Music AudioAssistant.Instance.PlayMusicGame(_bacayConfig.gameId, _bacayConfig.audioBackground); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_bacayConfig.gameId); _settingSound = AudioAssistant.Instance.GetSettingSound(_bacayConfig.gameId); _server = SignalRController.Instance.CreateServer <SignalRServer>(_bacayConfig.gameId); _server.OnSRSEvent = OnSRSEvent; //_server.OnSRSHubEvent = OnSRSHubEvent; _server.SRSInit(_bacayConfig.urlServer, _bacayConfig.hubName); _server.Connection.OnConnected += HandleConnected; _server.AddListener("lobbyInfo", HandleLobby); _server.AddListener("joinGame", HandleJoin); _server.AddListener("error", HandleErrorCode); moneyType = MoneyType.GOLD; LoadMoney(); ChangeTypeMoney(); }
public void Init(SRSSamConfig config, AssetBundleSettingItem assetBundleConfig, SamSignalRServer server, SRSSamGameSession session, int moneyType, bool isSolo) { _sam = new SRSSam(); _sam.session = session; _sam.moneyType = moneyType; ClearUI(); _config = config; _assetBundleConfig = assetBundleConfig; _settingSound = AudioAssistant.Instance.GetSettingSound(_config.gameId); _account = Database.Instance.Account(); _server = server; _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _server.OnSRSHubCallEvent = OnSRSHubCallEvent; gUiCoints.ForEach(a => a.SetActive(_sam.moneyType == MoneyType.COIN)); gUiGolds.ForEach(a => a.SetActive(_sam.moneyType == MoneyType.GOLD)); gUiSamNormals.ForEach(a => a.SetActive(!isSolo)); gUiSamSolos.ForEach(a => a.SetActive(isSolo)); LoadRoomInfo(); LoadUserFirst(isSolo); }
public void MuteSoundGame(int gameId) { SettingSoundItem item = GetSettingSound(gameId); item.isMuteSound = !item.isMuteSound; SaveSettingSound(); }
// On/off by game public void MuteMusicGame(int gameId) { SettingSoundItem item = GetSettingSound(gameId); item.isMuteMusic = !item.isMuteMusic; StartCoroutine(CrossFadeGame(item.isMuteMusic ? null : currentTrack, item.isMuteMusic)); SaveSettingSound(); }
public void Init() { _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID); _soundSetting = AudioAssistant.Instance.GetSettingSound(_GAMEID); btSpin.interactable = true; gCapcha.SetActive(false); UILayerController.Instance.ShowLoading(); SendRequest.SendGetAvailable(urlApi); ChangeSound(); }
// A single sound effect public void PlaySoundGame(int gameId, AudioClip clip) { SettingSoundItem item = GetSettingSound(gameId); if (item.isMuteSound) { return; } if (clip != null) { sfx.PlayOneShot(clip); } }
public void Init(SRSSlot20LineConfig config, Slot20lineSignalRServer server, SRSSlot20LineAccount account, AssetBundleSettingItem assetBundleConfig, int roomId, int mType) { _config = config; ClearUI(); _server = server; _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _assetBundleConfig = assetBundleConfig; _settingSound = AudioAssistant.Instance.GetSettingSound(_config.gameId); this.accountSpin = account; this.accountInfo = Database.Instance.Account(); this.roomBetId = roomId; this.moneyType = mType; this.roomBetValue = accountSpin.RoomBetValue(roomBetId); txtRomBet.SetNumber(roomBetValue); SetNotifyFree(); SetLineSelected(account.GetLineData()); // event OnEventUpdate(); // update jackpot if (_server.jackpots.ContainsKey(roomBetId.ToString())) { jackpot = _server.jackpots[roomBetId.ToString()]; UpdateJackpot(); } // Set data imgIconMoney.sprite = sprIconMoney[moneyType == MoneyType.GOLD ? 0 : 1]; vkTxtMyMoney.SetNumber(accountInfo.GetCurrentBalance(moneyType)); // finish bonus if (account.BonusId > 0) { _server.HubCallFinishBonusGame(moneyType, account.BonusId); } }
public void Init() { UILayerController.Instance.ShowLoading(); // Music AudioAssistant.Instance.PlayMusicGame(_config.gameId, _config.audioBackground); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_config.gameId); _settingSound = AudioAssistant.Instance.GetSettingSound(_config.gameId); _server = SignalRController.Instance.CreateServer <Slot20lineSignalRServer>((int)_config.gameId); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; moneyType = MoneyType.GOLD; _server.SRSInit(_config.urlServer, _config.hubName); LoadMoney(); StartCoroutine(WaitToLoadEvent()); }
public void Init() { isClickChoiNhanh = false; UILayerController.Instance.ShowLoading(); // Music AudioAssistant.Instance.PlayMusicGame(_config.gameId, _config.audioBackground); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_config.gameId); _settingSound = AudioAssistant.Instance.GetSettingSound(_config.gameId); _server = SignalRController.Instance.CreateServer <XocXocSignalRServer>(_config.gameId); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; moneyType = MoneyType.GOLD; _server.SRSInit(_config.urlServer, _config.hubName); LoadMoney(); ChangeTypeMoney(); }
public void Init() { ClearUI(); UILayerController.Instance.ShowLoading(); _taixiu = new SRSTaiXiu(); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID); _soundSetting = AudioAssistant.Instance.GetSettingSound(_GAMEID); _taixiu.MoneyType = MoneyType.GOLD; _server = SignalRController.Instance.CreateServer <TaiXiuSignalRServer>((int)_GAMEID); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _server.SRSInit(_URL, _HUBNAME); this._account = Database.Instance.Account(); ChangeSound(); ShowMoneyType(); UpdateMoneyType(); UpdateGameInfo(); }
public void Init() { this.roomIdSelected = 1; this.moneyType = MoneyType.GOLD; ClearUI(); UILayerController.Instance.ShowLoading(); _account = Database.Instance.Account(); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID); _soundSetting = AudioAssistant.Instance.GetSettingSound(_GAMEID); _server = SignalRController.Instance.CreateServer <HighLowSignalRServer>((int)_GAMEID); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _server.SRSInit(_URL, _HUBNAME); ChangeSound(); ChangeTypeMoney(); vkTxtJackpot.UpdateNumber(0); }
public void Init() { _baucua = new SRSBauCua(); _baucua.moneyType = MoneyType.GOLD; ClearUI(); UILayerController.Instance.ShowLoading(); _account = Database.Instance.Account(); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID); _soundSetting = AudioAssistant.Instance.GetSettingSound(_GAMEID); _server = SignalRController.Instance.CreateServer <BauCuaSignalRServer>((int)_GAMEID); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _server.SRSInit(_URL, _HUBNAME); ChangeSound(); ChangeTypeMoney(); ChangeChip(uiChips[0]); }
public void Init() { UILayerController.Instance.ShowLoading(); _assetBundleConfig = AssetbundlesManager.Instance.assetSetting.GetItemByGameId(_GAMEID); _soundSetting = AudioAssistant.Instance.GetSettingSound(_GAMEID); moneyType = (int)MoneyType.GOLD; _server = SignalRController.Instance.CreateServer <MiniPokerSignalRServer>((int)_GAMEID); _server.OnSRSEvent = OnSRSEvent; _server.OnSRSHubEvent = OnSRSHubEvent; _server.SRSInit(_URL, _HUBNAME); this.accountInfo = Database.Instance.Account(); this.roomIdSelected = 1; vkBtBets[roomIdSelected - 1].VKInteractable = false; ChangeSound(); ChangeTypeMoney(); toggleAuto.isOn = false; toggleFast.isOn = false; ButtonFastSpinClickListener(); var rnd = new System.Random(); var randomNumbers = Enumerable.Range(1, 49).OrderBy(x => rnd.Next()).Take(5).ToList(); VKDebug.LogColorRed(randomNumbers.Count); for (int i = 0; i < randomNumbers.Count; i++) { VKDebug.LogColorRed(randomNumbers[i]); } for (int i = 0; i < lines.Count; i++) { lines[i].LoadCard(randomNumbers[i]); } }
// Play GAME // Launching a music track public void PlayMusicGame(int gameId, AudioClip track) { SettingSoundItem item = GetSettingSound(gameId); StartCoroutine(CrossFadeGame(track, item.isMuteMusic)); }
public void Init(Account myself, SignalRServer server, SRSBacay bacayData, SRSBaCayConfig config) { accountIdNumber = myself.AccountID; accountIdString = Convert.ToString(accountIdNumber); _config = config; _bacayData = bacayData; _server = server; _server.AddListener("playerLeave", HandlePlayerLeave); _server.AddListener("playerJoin", HandlePlayerJoin); _server.AddListener("startGame", HandleStartGame); _server.AddListener("startBettingTime", HandleStartBettingTime); _server.AddListener("updateBetting", HandleUpdateBetting); _server.AddListener("feedChicken", HandleUpdateFeedChicken); _server.AddListener("startAnimationTime", HandleStartAnimationTime); _server.AddListener("showAllResult", HandleShowAllResult); _server.AddListener("showPrize", HandleShowPrize); _server.AddListener("askToSell", HandleAskToSell); _server.AddListener("askOtherToBuy", HandleAskOtherToBuy); _server.AddListener("changeOwner", HandleChangeOwner); _server.AddListener("updateSession", HandleUpdateSession); _server.AddListener("updateAccount", HandleUpdateAccount); _server.AddListener("message", HandleMessage); //_server.AddListener("error", HandleError); _server.AddListener("recieveMessage", HandleRecieveMessage); _server.AddListener("notifyEvent", HandleNotifyEvent); _server.AddListener("stopHub", HandleStopHub); _settingSound = AudioAssistant.Instance.GetSettingSound(_config.gameId); posRoot = _bacayData.Players[accountIdString].Position; leaveRoom = false; notify.transform.parent.gameObject.SetActive(false); feedChecken.transform.parent.gameObject.SetActive(false); register.gameObject.SetActive(false); resign.gameObject.SetActive(false); noResign.gameObject.SetActive(false); showOneCard.gameObject.SetActive(false); showAllCard.gameObject.SetActive(false); submitChecken.gameObject.SetActive(false); register.onClick.AddListener(OnRegisterOwnerClick); resign.onClick.AddListener(OnRresignOwnerClick); noResign.onClick.AddListener(OnTakeOwnerClick); showOneCard.onClick.AddListener(OnShowOneCardClick); showAllCard.onClick.AddListener(OnShowAllCardClick); submitChecken.onClick.AddListener(OnSubmitCheckenClick); submitBet.onClick.AddListener(OnSubmitBetClick); if (_bacayData.GameLoop.Phrase < 0) { SetRoomState(8); } else { SetRoomState(0); } SetupBetOption(); HideBetOption(); LoadRoomInfo(); LoadRoomPlayer(true); Ping(); LoadSound(); }