This document is about: PUN 2
SWITCH TO

PUN Classic (v1)、PUN 2 和 Bolt 處於維護模式。 PUN 2 將支援 Unity 2019 至 2022,但不會添加新功能。 當然,您所有的 PUN & Bolt 專案可以用已知性能繼續運行使用。 對於任何即將開始或新的專案:請切換到 Photon Fusion 或 Quantum。

Photon Lag Simulation Gui

PUN includes a simple GUI component to control the built-in network and lag simulation of the Photon client. Provided your network conditions are relatively good, you can add lag and loss to try out how well your game mechanics work in worse conditions.

Usage

Add the component PhotonNetSimSettingsGui to an enabled GameObject in your scene. At runtime, the top left of the screen shows the current roundtrip time (RTT) and the controls for network simulation:

  • RTT: The roundtrip time is the average of milliseconds until a message was acknowledged by the server. The variance value (behind the +/-) shows how stable the rtt is (a lower value being better).
  • "Sim" toggle: Enables and disables the simulation. A sudden, big change of network conditions might result in disconnects.
  • "Lag" slider: Adds a fixed delay to all outgoing and incoming messages. In milliseconds.
  • "Jit" slider: Adds a random delay of "up to X milliseconds" per message.
  • "Loss" slider: Drops the set percentage of messages. You can expect less than 2% drop in the internet today.
Back to top