Exemplo n.º 1
0
        // BOLT

#if UNITY_EDITOR
        public override void BoltStartDone()
        {
            if (BoltNetwork.IsServer)
            {
                InitializeSpawns();

                GameReady gameReadyEvent = GameReady.Create(GlobalTargets.Everyone);
                gameReadyEvent.Send();
            }
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
        public void TriggerGameReadyEvent()
        {
            GameReady gameReadyEvent = GameReady.Create();

            gameReadyEvent.Send();
        }