public IEnumerator ServerCountdownCoroutine() { float remainingTime = prematchCountdown; int floorTime = Mathf.FloorToInt(remainingTime); LobbyCountdown countdown; while (remainingTime > 0) { yield return(null); remainingTime -= Time.deltaTime; int newFloorTime = Mathf.FloorToInt(remainingTime); if (newFloorTime != floorTime) { floorTime = newFloorTime; countdown = LobbyCountdown.Create(GlobalTargets.Everyone); countdown.Time = floorTime; countdown.Send(); } } countdown = LobbyCountdown.Create(GlobalTargets.Everyone); countdown.Time = 0; countdown.Send(); BoltNetwork.LoadScene(gameScene.SimpleSceneName); }
public IEnumerator ServerCountdownCoroutine() { float remainingTime = 4f;//prematchCountdown; int floorTime = Mathf.FloorToInt(remainingTime); LobbyCountdown countdown; ChangeTo(countdownPanel.GetComponent <RectTransform>()); while (remainingTime > 0) { yield return(null); remainingTime -= Time.deltaTime; int newFloorTime = Mathf.FloorToInt(remainingTime); if (newFloorTime != floorTime) { floorTime = newFloorTime; countdown = LobbyCountdown.Create(GlobalTargets.Everyone); countdown.Time = floorTime; countdown.Send(); } } countdown = LobbyCountdown.Create(GlobalTargets.Everyone); countdown.Time = 0; countdown.Send(); BoltNetwork.LoadScene(gameScene.SimpleSceneName); LoadHandler.instance.sceneBuildIndex = LoadHandler.instance.mainSceneIndex; }
public void LobbyCoutndownEvent() { LobbyCountdown countdownEvent = LobbyCountdown.Create(); countdownEvent.Time = 0; countdownEvent.Send(); }
//BOLT public override void OnEvent(LobbyCountdown evnt) { if (evnt.Time == 3) { ShowPlayerCamera(); } }
public override void OnEvent(LobbyCountdown evnt) { if (!_alreadyLaunched) { _numberCooldown.Play(); _alreadyLaunched = true; } }
public override void OnEvent(LobbyCountdown evnt) { ChangeTo(countdownPanel.GetComponent <RectTransform>()); Text text = countdownPanel.UIText; text.fontSize = 80; text.text = "Match Starting in " + evnt.Time; countdownPanel.gameObject.SetActive(evnt.Time != 0); }
/// <summary> /// Called whenever the lobby countdown starts. /// </summary> public void OnLobbyCountdownStarted(LobbyCountdown timer) { this.timer = timer; this.timer.TickEvent += OnLobbyCountdownTick; this.timer.TimeOutEvent += OnLobbyCountdownTimeOut; gameObject.SetActive(true); text_mesh.text = timer.time.ToString(); iTween.FadeFrom(gameObject, 0.0f, fade_duration); }
private IEnumerator CountdownCoroutine() { float remainingTime = _countdownSettings.Timer; int floorTime = Mathf.FloorToInt(remainingTime); LobbyCountdown countdownEvent; if (_countdownSettings.Countdown) { while (remainingTime > 0) { remainingTime -= Time.deltaTime; int newFloorTime = Mathf.FloorToInt(remainingTime); if (newFloorTime != floorTime) { floorTime = newFloorTime; countdownEvent = LobbyCountdown.Create(GlobalTargets.Everyone); countdownEvent.Time = floorTime; countdownEvent.Send(); } yield return(null); } } countdownEvent = LobbyCountdown.Create(GlobalTargets.Everyone); countdownEvent.Time = 0; countdownEvent.Send(); GameReady gameReadyEvent = GameReady.Create(GlobalTargets.Everyone); gameReadyEvent.Send(); _gameIsStarted = true; }
public override void OnEvent(LobbyCountdown evt) { uiCountdownPanel.SetText(string.Format("Match Starting in {0}", evt.Time)); uiCountdownPanel.ToggleVisibility(evt.Time != 0); }
// ----------------- Client callbacks ------------------ public override void OnEvent(LobbyCountdown evnt) { countdownPanel.UIText.text = "Match Starting in " + evnt.Time; countdownPanel.gameObject.SetActive(evnt.Time != 0); }
public override void OnEvent(LobbyCountdown evnt) { //Debug.Log("Starts in " + evnt.Time); }
/// <summary> /// Called whenever the lobby countdown starts. /// </summary> public void OnLobbyCountdownStarted(LobbyCountdown timer) { gameObject.SetActive(false); }