コード例 #1
0
        public static RoundSession Create(
            int countDown,
            float time,
            float countDownTime,
            float intermissionTime,
            int index)
        {
            RoundSession session = NetworkingLibrary.Instance.RoundSession.Create(null);

            session._startIntermissionTime = intermissionTime;
            session._index          = index;
            session._countDown      = countDown;
            session._remainingTime  = time;
            session._countDownTime  = countDownTime;
            session._countDownTimer = new Timer(
                countDownTime,
                start: false,
                repeat: true);

            if (CustomNetworkManager.IsServer)
            {
                session._timerGameObject = ServerTimer.Create(
                    session._remainingTime,
                    start: false).gameObject;
                session.Timer.OnRoundTimeLimitHandler += session.Cmd_OnRoundTimeout;
            }

            session._startIntermissionTimer = new Timer(
                session._startIntermissionTime,
                start: false,
                repeat: false);

            NetworkServer.Spawn(
                session.gameObject,
                NetworkServer.localConnection);

            return(session);
        }