Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
        public void LobbyCoutndownEvent()
        {
            LobbyCountdown countdownEvent = LobbyCountdown.Create();

            countdownEvent.Time = 0;
            countdownEvent.Send();
        }
Esempio n. 4
0
        //BOLT

        public override void OnEvent(LobbyCountdown evnt)
        {
            if (evnt.Time == 3)
            {
                ShowPlayerCamera();
            }
        }
Esempio n. 5
0
 public override void OnEvent(LobbyCountdown evnt)
 {
     if (!_alreadyLaunched)
     {
         _numberCooldown.Play();
         _alreadyLaunched = true;
     }
 }
Esempio n. 6
0
        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);
        }
Esempio n. 7
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);
    }
Esempio n. 8
0
        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;
        }
Esempio n. 9
0
 public override void OnEvent(LobbyCountdown evt)
 {
     uiCountdownPanel.SetText(string.Format("Match Starting in {0}", evt.Time));
     uiCountdownPanel.ToggleVisibility(evt.Time != 0);
 }
Esempio n. 10
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);
 }