FetchServerTimestamp
How do I use Fetch Server Timestamp
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
Line | Code | Ex.. |
---|---|---|
2214 | public static void FetchServerTimestamp() | 1 |
14 | PhotonNetwork.FetchServerTimestamp(); | 2 |
File name: PhotonNetwork.cs
Copy
2214 public static void FetchServerTimestamp()
2215 {
2216 if (networkingPeer != null)
2217 {
2218 networkingPeer.FetchServerTimestamp();
2219 }
2220 }
File name: ServerTime.cs
Copy
8 void OnGUI()
9 {
10 GUILayout.BeginArea(new Rect(Screen.width/2-100, 0, 200,30));
11 GUILayout.Label(string.Format("Time Offset: {0}", PhotonNetwork.networkingPeer.ServerTimeInMilliSeconds - Environment.TickCount));
12 if (GUILayout.Button("fetch"))
13 {
14 PhotonNetwork.FetchServerTimestamp();
15 }
16 GUILayout.EndArea();
17 }
FetchServerTimestamp 126 lượt xem
Gõ tìm kiếm nhanh...