Beispiel #1
0
	public static UpdateCountdownMessage Send(bool started, float time)
	{
		UpdateCountdownMessage msg = new UpdateCountdownMessage
		{
			Started = started,
			Time = time
		};
		msg.SendToAll();
		return msg;
	}
Beispiel #2
0
    /// <summary>
    /// Calculates when the countdown will end from the time left and sends it to all clients
    /// </summary>
    /// <param name="started">Has the countdown started or stopped?</param>
    /// <param name="time">How much time is left on the countdown?</param>
    /// <returns></returns>
    public static UpdateCountdownMessage Send(bool started, float time)
    {
        // Calculate when the countdown will end relative to the current NetworkTime
        double endTime             = NetworkTime.time + time;
        UpdateCountdownMessage msg = new UpdateCountdownMessage
        {
            Started = started,
            EndTime = endTime
        };

        msg.SendToAll();
        return(msg);
    }