├── .gitignore
├── Content
├── DemoScene.scene
├── GameSettings.json
├── Materials
│ ├── Blue Material.flax
│ ├── MAT_FlaxDecal.flax
│ ├── Solid Color Material.flax
│ └── White Material.flax
├── Menu.scene
├── Players
│ ├── PFB_LocalPlayer.prefab
│ └── PFB_NetworkPlayer.prefab
├── SceneData
│ ├── DemoScene
│ │ ├── CSG_Collision.flax
│ │ ├── CSG_Data.flax
│ │ └── CSG_Mesh.flax
│ └── Scene
│ │ ├── CSG_Collision.flax
│ │ ├── CSG_Data.flax
│ │ ├── CSG_Mesh.flax
│ │ ├── EnvProbes
│ │ └── da5e1c454a56377517d41686ebb0348f.flax
│ │ ├── Lightmaps
│ │ ├── Lightmap00-0.flax
│ │ ├── Lightmap00-1.flax
│ │ └── Lightmap00-2.flax
│ │ └── SkyLights
│ │ └── eb18e84d41670d6314174b89a1d5ffea.flax
├── Settings
│ ├── Android Settings.json
│ ├── Audio Settings.json
│ ├── Build Settings.json
│ ├── Graphics Settings.json
│ ├── Input Settings.json
│ ├── Layers And Tags Settings.json
│ ├── Linux Settings.json
│ ├── Localization Settings.json
│ ├── Navigation Settings.json
│ ├── Network Settings.json
│ ├── Physics Settings.json
│ ├── Streaming Settings.json
│ ├── Time Settings.json
│ ├── UWP Settings.json
│ └── Windows Settings.json
├── flaxlogo
│ ├── FlaxLogo.prefab
│ ├── FlaxLogoCollisionData.flax
│ ├── Material.001.flax
│ ├── Physical Material 0.json
│ ├── flaxlogo.flax
│ └── flaxlogocollider.flax
├── network-sample-menu.png
├── network-sample-players-list.png
└── network-sample-players.jpg
├── LICENSE
├── NetworkingSample.flaxproj
├── README.md
├── Source
├── Game
│ ├── Game.Build.cs
│ ├── GameSession.cs
│ ├── Network
│ │ ├── ConnectionRegistry.cs
│ │ ├── NetworkSession.cs
│ │ ├── PacketRegistry.cs
│ │ └── Packets
│ │ │ ├── ChatMessagePacket.cs
│ │ │ ├── ConnectionRequestPacket.cs
│ │ │ ├── ConnectionResponsePacket.cs
│ │ │ ├── NetworkPacket.cs
│ │ │ ├── PlayerConnectedPacket.cs
│ │ │ ├── PlayerDisconnectedPacket.cs
│ │ │ ├── PlayerListPacket.cs
│ │ │ ├── PlayerTransformPacket.cs
│ │ │ └── PlayersTransformPacket.cs
│ ├── Player.cs
│ ├── Scripts
│ │ ├── ChatScript.cs
│ │ ├── DemoSceneScript.cs
│ │ ├── ExitOnEsc.cs
│ │ ├── FreeCamera.cs
│ │ ├── HostConnectScreenScript.cs
│ │ ├── LocalPlayerScript.cs
│ │ ├── NetworkPlayerScript.cs
│ │ └── PlayerListScript.cs
│ └── Utils
│ │ └── StringExtensions.cs
├── GameEditorTarget.Build.cs
└── GameTarget.Build.cs
└── image.png
/.gitignore:
--------------------------------------------------------------------------------
1 | # Ignore Flax project files
2 | /Binaries/
3 | /Cache/
4 | /Logs/
5 | /Output/
6 | /Screenshots/
7 | *.HotReload.*
8 | Source/*.Gen.*
9 |
10 | # Local files
11 | imgui.ini
12 |
13 | # Ignore Visual Studio project files (generated locally)
14 | *.csproj
15 | *.sln
16 | launchSettings.json
17 |
18 | # Ignore Visual Code project files (generated locally)
19 | *.code-workspace
20 | *.vscode/
21 |
22 | # Ignore Rider project files (generated locally)
23 | *.idea/
24 |
25 | # Ignore thumbnails created by Windows
26 | Thumbs.db
27 |
28 | # Ignore files built by Visual Studio
29 | *.obj
30 | *.exe
31 | *.pdb
32 | *.user
33 | *.aps
34 | *.pch
35 | *.vspscc
36 | *_i.c
37 | *_p.c
38 | *.ncb
39 | *.suo
40 | *.tlb
41 | *.tlh
42 | *.bak
43 | *.cache
44 | *.ilk
45 | *.log
46 | [Bb]in
47 | *.lib
48 | *.sbr
49 | /Source/obj/
50 | _ReSharper*/
51 | [Tt]est[Rr]esult*
52 | .vs/
53 |
54 | # Ignore Nuget packages folder
55 | packages/
56 |
--------------------------------------------------------------------------------
/Content/DemoScene.scene:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "74a68a984824b4510d12589f199ad68f",
3 | "TypeName": "FlaxEngine.SceneAsset",
4 | "EngineBuild": 6704,
5 | "Data": [
6 | {
7 | "ID": "74a68a984824b4510d12589f199ad68f",
8 | "TypeName": "FlaxEngine.Scene",
9 | "Lightmaps": [
10 | {
11 | "Lightmap0": "520522344858c273e9e7d9a9131555df",
12 | "Lightmap1": "bf2bef904ca9b75147d352a1b5089ace",
13 | "Lightmap2": "69b94adb41aca213ce537d91d53dc89d"
14 | }
15 | ],
16 | "LightmapSettings": {
17 | "IndirectLightingIntensity": 1.0,
18 | "GlobalObjectsScale": 1.0,
19 | "ChartsPadding": 3,
20 | "AtlasSize": 1024,
21 | "BounceCount": 1,
22 | "CompressLightmaps": true,
23 | "UseGeometryWithNoMaterials": true,
24 | "Quality": 100
25 | },
26 | "CSG": {
27 | "Model": "c91570f843acc5d741133b803211d574",
28 | "Data": "0e5f7de9441f282e370327b31385c016",
29 | "CollisionData": "104e0dc7466c412f593951a357343ccf"
30 | }
31 | },
32 | {
33 | "ID": "6ff0581d474c84230b3d0fa9f17e0972",
34 | "TypeName": "ExitOnEsc",
35 | "ParentID": "74a68a984824b4510d12589f199ad68f",
36 | "V": {}
37 | },
38 | {
39 | "ID": "37e1ccab4634efa613650999b83cb98d",
40 | "TypeName": "Game.DemoSceneScript",
41 | "ParentID": "74a68a984824b4510d12589f199ad68f",
42 | "V": {
43 | "PlayerPrefab": "fa0ddf034c718af8fbf893836d3c7283"
44 | }
45 | },
46 | {
47 | "ID": "28553d634087c67c711ebd96080482aa",
48 | "TypeName": "FlaxEngine.EmptyActor",
49 | "ParentID": "74a68a984824b4510d12589f199ad68f",
50 | "Name": "Visuals"
51 | },
52 | {
53 | "ID": "bc81376747666609b0974580a21519a1",
54 | "TypeName": "FlaxEngine.Sky",
55 | "ParentID": "28553d634087c67c711ebd96080482aa",
56 | "Name": "Sky",
57 | "Transform": {
58 | "Translation": {
59 | "X": -69.65292358398438,
60 | "Y": 75.30659484863281,
61 | "Z": -14.423166275024414
62 | }
63 | },
64 | "Sun": "deecf0894777293a4f478dadacf2a6f8"
65 | },
66 | {
67 | "ID": "da5e1c454a56377517d41686ebb0348f",
68 | "TypeName": "FlaxEngine.EnvironmentProbe",
69 | "ParentID": "28553d634087c67c711ebd96080482aa",
70 | "Name": "Environment Probe",
71 | "Transform": {
72 | "Translation": {
73 | "X": 0.0,
74 | "Y": 108.5870361328125,
75 | "Z": 0.0
76 | }
77 | },
78 | "ProbeID": "1e1fb3a7447c1265b15967b480549d98"
79 | },
80 | {
81 | "ID": "deecf0894777293a4f478dadacf2a6f8",
82 | "TypeName": "FlaxEngine.DirectionalLight",
83 | "ParentID": "28553d634087c67c711ebd96080482aa",
84 | "Name": "Directional Light",
85 | "Transform": {
86 | "Translation": {
87 | "X": -1.6893305778503418,
88 | "Y": 90.0248794555664,
89 | "Z": 0.0
90 | },
91 | "Orientation": {
92 | "X": 0.5176515579223633,
93 | "Y": 0.0833025798201561,
94 | "Z": 0.06534233689308167,
95 | "W": 0.8490158915519714
96 | }
97 | },
98 | "Color": {
99 | "R": 1.0,
100 | "G": 0.9606999754905701,
101 | "B": 0.8050000071525574,
102 | "A": 1.0
103 | },
104 | "MinRoughness": 0.0,
105 | "ShadowsDistance": 2000.0,
106 | "ShadowsFadeDistance": 50.0,
107 | "ShadowsDepthBias": 0.009999999776482582
108 | },
109 | {
110 | "ID": "eb18e84d41670d6314174b89a1d5ffea",
111 | "TypeName": "FlaxEngine.SkyLight",
112 | "ParentID": "28553d634087c67c711ebd96080482aa",
113 | "Name": "SkyLight",
114 | "Transform": {
115 | "Translation": {
116 | "X": 0.0,
117 | "Y": 150.0,
118 | "Z": 0.0
119 | }
120 | },
121 | "BakedProbe": "1c0e10484ff57d402275289550564b9f",
122 | "Mode": 0
123 | },
124 | {
125 | "ID": "71485f22423f938f9572b7b9779a44d5",
126 | "TypeName": "FlaxEngine.EmptyActor",
127 | "ParentID": "74a68a984824b4510d12589f199ad68f",
128 | "Name": "Brushes"
129 | },
130 | {
131 | "ID": "b0af681c49f525c9996e3c8feb3c4a03",
132 | "TypeName": "FlaxEngine.BoxBrush",
133 | "ParentID": "71485f22423f938f9572b7b9779a44d5",
134 | "Name": "Box Brush",
135 | "Size": {
136 | "X": 1000.0,
137 | "Y": 10.0,
138 | "Z": 1000.0
139 | },
140 | "Surfaces": [
141 | {
142 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
143 | },
144 | {
145 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
146 | },
147 | {
148 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
149 | },
150 | {
151 | "Material": "382f1ae946c519eff6e6f3a2965cf56b",
152 | "ScaleInLightmap": 0.0
153 | },
154 | {
155 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
156 | },
157 | {
158 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
159 | }
160 | ]
161 | },
162 | {
163 | "ID": "56e934c543c02d12fecc6e8a563ee2af",
164 | "TypeName": "FlaxEngine.BoxBrush",
165 | "ParentID": "71485f22423f938f9572b7b9779a44d5",
166 | "Name": "Box Brush",
167 | "Transform": {
168 | "Translation": {
169 | "X": 24.59819793701172,
170 | "Y": 53.55231475830078,
171 | "Z": -60.500328063964844
172 | }
173 | },
174 | "Surfaces": [
175 | {
176 | "Material": "8391b6da40053a988a0959ab9f26f700"
177 | },
178 | {
179 | "Material": "8391b6da40053a988a0959ab9f26f700"
180 | },
181 | {
182 | "Material": "8391b6da40053a988a0959ab9f26f700"
183 | },
184 | {
185 | "ScaleInLightmap": 0.0
186 | },
187 | {
188 | "Material": "8391b6da40053a988a0959ab9f26f700"
189 | },
190 | {
191 | "Material": "8391b6da40053a988a0959ab9f26f700"
192 | }
193 | ]
194 | },
195 | {
196 | "ID": "4ae9d99c471bd2ead3e0afa8fa899568",
197 | "TypeName": "FlaxEngine.BoxBrush",
198 | "ParentID": "71485f22423f938f9572b7b9779a44d5",
199 | "Name": "BoxBrush",
200 | "Transform": {
201 | "Translation": {
202 | "X": 494.0848388671875,
203 | "Y": 145.60263061523438,
204 | "Z": 0.0
205 | }
206 | },
207 | "Size": {
208 | "X": 10.0,
209 | "Y": 300.0,
210 | "Z": 1000.0
211 | },
212 | "Surfaces": [
213 | {
214 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
215 | },
216 | {
217 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
218 | },
219 | {
220 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
221 | },
222 | {
223 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
224 | },
225 | {
226 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
227 | },
228 | {
229 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
230 | }
231 | ]
232 | },
233 | {
234 | "ID": "35457dbc457f21c015e3b3b484c705f6",
235 | "TypeName": "FlaxEngine.BoxBrush",
236 | "ParentID": "71485f22423f938f9572b7b9779a44d5",
237 | "Name": "Box Brush 0",
238 | "Transform": {
239 | "Translation": {
240 | "X": 389.76849365234375,
241 | "Y": 54.76124572753906,
242 | "Z": -121.00065612792969
243 | }
244 | },
245 | "Size": {
246 | "X": 200.0,
247 | "Y": 100.0,
248 | "Z": 400.0
249 | },
250 | "Surfaces": [
251 | {
252 | "Material": "8391b6da40053a988a0959ab9f26f700"
253 | },
254 | {
255 | "Material": "8391b6da40053a988a0959ab9f26f700"
256 | },
257 | {
258 | "Material": "8391b6da40053a988a0959ab9f26f700"
259 | },
260 | {
261 | "ScaleInLightmap": 0.0
262 | },
263 | {
264 | "Material": "8391b6da40053a988a0959ab9f26f700"
265 | },
266 | {
267 | "Material": "8391b6da40053a988a0959ab9f26f700"
268 | }
269 | ]
270 | },
271 | {
272 | "ID": "0f78506843aeee29e81f6cb61fff7a4e",
273 | "TypeName": "FlaxEngine.BoxBrush",
274 | "ParentID": "71485f22423f938f9572b7b9779a44d5",
275 | "Name": "Box Brush 0",
276 | "Transform": {
277 | "Translation": {
278 | "X": 389.0957946777344,
279 | "Y": 26.361007690429688,
280 | "Z": 103.68790435791016
281 | }
282 | },
283 | "Size": {
284 | "X": 200.0,
285 | "Y": 50.0,
286 | "Z": 50.0
287 | },
288 | "Surfaces": [
289 | {
290 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
291 | },
292 | {
293 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
294 | },
295 | {
296 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
297 | },
298 | {
299 | "Material": "382f1ae946c519eff6e6f3a2965cf56b",
300 | "ScaleInLightmap": 0.0
301 | },
302 | {
303 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
304 | },
305 | {
306 | "Material": "382f1ae946c519eff6e6f3a2965cf56b"
307 | }
308 | ]
309 | },
310 | {
311 | "ID": "a9ae06ec42882434ee61aab42a1c82c5",
312 | "TypeName": "FlaxEngine.MeshCollider",
313 | "ParentID": "74a68a984824b4510d12589f199ad68f",
314 | "Name": "CSG.Collider",
315 | "HideFlags": 4,
316 | "Material": "1126eb1f43a8e12e734c86a0da2981c8",
317 | "CollisionData": "104e0dc7466c412f593951a357343ccf"
318 | },
319 | {
320 | "ID": "7eff8e8543a2b10f19dc35b92fc11b99",
321 | "TypeName": "FlaxEngine.StaticModel",
322 | "ParentID": "74a68a984824b4510d12589f199ad68f",
323 | "Name": "CSG.Model",
324 | "HideFlags": 4,
325 | "Model": "c91570f843acc5d741133b803211d574",
326 | "LightmapIndex": 0,
327 | "LightmapArea": {
328 | "Location": {
329 | "X": 0.0029296875,
330 | "Y": 0.0029296875
331 | },
332 | "Size": {
333 | "X": 0.0537109375,
334 | "Y": 0.0537109375
335 | }
336 | },
337 | "Buffer": {
338 | "Entries": [
339 | {
340 | "Material": "00000000000000000000000000000000",
341 | "ShadowsMode": 3,
342 | "Visible": true,
343 | "ReceiveDecals": true
344 | },
345 | {
346 | "Material": "00000000000000000000000000000000",
347 | "ShadowsMode": 3,
348 | "Visible": true,
349 | "ReceiveDecals": true
350 | },
351 | {
352 | "Material": "00000000000000000000000000000000",
353 | "ShadowsMode": 3,
354 | "Visible": true,
355 | "ReceiveDecals": true
356 | }
357 | ]
358 | }
359 | },
360 | {
361 | "ID": "85cff9bc4630ffd9de5fcdb374ccfe3e",
362 | "TypeName": "FlaxEngine.UICanvas",
363 | "ParentID": "74a68a984824b4510d12589f199ad68f",
364 | "Name": "UI",
365 | "Transform": {
366 | "Orientation": {
367 | "X": 1.0,
368 | "Y": 4.371138828673793e-8,
369 | "Z": 4.371138828673793e-8,
370 | "W": 1.910685465164705e-15
371 | }
372 | },
373 | "V": {}
374 | },
375 | {
376 | "ID": "f3abe03a4d39ed82eef37d9a2f6ce9bd",
377 | "TypeName": "FlaxEngine.UIControl",
378 | "ParentID": "85cff9bc4630ffd9de5fcdb374ccfe3e",
379 | "Name": "PlayerList",
380 | "Transform": {
381 | "Translation": {
382 | "X": 860.0,
383 | "Y": 440.0,
384 | "Z": 0.0
385 | }
386 | },
387 | "Control": "FlaxEngine.GUI.Panel",
388 | "Data": {
389 | "ScrollBars": 0,
390 | "ScrollBarsSize": 14.0,
391 | "AlwaysShowScrollbars": false,
392 | "ScrollMargin": {
393 | "Left": 0.0,
394 | "Right": 0.0,
395 | "Top": 0.0,
396 | "Bottom": 0.0
397 | },
398 | "ScrollbarTrackColor": {
399 | "R": 0.32941177,
400 | "G": 0.32941177,
401 | "B": 0.36078432,
402 | "A": 1.0
403 | },
404 | "ScrollbarThumbColor": {
405 | "R": 0.24705882,
406 | "G": 0.24705882,
407 | "B": 0.27450982,
408 | "A": 1.0
409 | },
410 | "ScrollbarThumbSelectedColor": {
411 | "R": 0.0,
412 | "G": 0.47843137,
413 | "B": 0.8,
414 | "A": 1.0
415 | },
416 | "ClipChildren": true,
417 | "CullChildren": true,
418 | "AnchorMin": {
419 | "X": 0.5,
420 | "Y": 0.5
421 | },
422 | "AnchorMax": {
423 | "X": 0.5,
424 | "Y": 0.5
425 | },
426 | "Offsets": {
427 | "Left": -100.0,
428 | "Right": 200.0,
429 | "Top": -100.0,
430 | "Bottom": 200.0
431 | },
432 | "Scale": {
433 | "X": 1.0,
434 | "Y": 1.0
435 | },
436 | "Pivot": {
437 | "X": 0.5,
438 | "Y": 0.5
439 | },
440 | "Shear": {
441 | "X": 0.0,
442 | "Y": 0.0
443 | },
444 | "Rotation": 0.0,
445 | "BackgroundColor": {
446 | "R": 0.0,
447 | "G": 0.0,
448 | "B": 0.0,
449 | "A": 0.0
450 | },
451 | "BackgroundBrush": null,
452 | "Enabled": true,
453 | "Visible": true,
454 | "AutoFocus": false
455 | }
456 | },
457 | {
458 | "ID": "3b9da9a04b6b5cf73cbbcf8bfed56bd2",
459 | "TypeName": "Game.PlayerListScript",
460 | "ParentID": "f3abe03a4d39ed82eef37d9a2f6ce9bd",
461 | "V": {
462 | "VerticalPanel": "8f4645804d234692cfb1b9a27ffd5825",
463 | "ListFont": {
464 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
465 | "Size": 12.0
466 | }
467 | }
468 | },
469 | {
470 | "ID": "f3ec497045c6d69aa0b4709c987120cd",
471 | "TypeName": "FlaxEngine.UIControl",
472 | "ParentID": "f3abe03a4d39ed82eef37d9a2f6ce9bd",
473 | "Name": "VerticalPanel",
474 | "Control": "FlaxEngine.GUI.VerticalPanel",
475 | "Data": {
476 | "Spacing": 2.0,
477 | "Offset": {
478 | "X": 0.0,
479 | "Y": 0.0
480 | },
481 | "AutoSize": true,
482 | "ControlChildSize": true,
483 | "Margin": {
484 | "Left": 2.0,
485 | "Right": 2.0,
486 | "Top": 2.0,
487 | "Bottom": 2.0
488 | },
489 | "Alignment": 0,
490 | "ClipChildren": true,
491 | "CullChildren": true,
492 | "AnchorMin": {
493 | "X": 0.5,
494 | "Y": 0.0
495 | },
496 | "AnchorMax": {
497 | "X": 0.5,
498 | "Y": 1.0
499 | },
500 | "Offsets": {
501 | "Left": -100.0,
502 | "Right": 200.0,
503 | "Top": 0.0,
504 | "Bottom": 4.0
505 | },
506 | "Scale": {
507 | "X": 1.0,
508 | "Y": 1.0
509 | },
510 | "Pivot": {
511 | "X": 0.5,
512 | "Y": 0.5
513 | },
514 | "Shear": {
515 | "X": 0.0,
516 | "Y": 0.0
517 | },
518 | "Rotation": 0.0,
519 | "BackgroundColor": {
520 | "R": 0.0,
521 | "G": 0.0,
522 | "B": 0.0,
523 | "A": 0.0
524 | },
525 | "BackgroundBrush": null,
526 | "Enabled": true,
527 | "Visible": true,
528 | "AutoFocus": false
529 | }
530 | },
531 | {
532 | "ID": "17f3b4b2425d7f3c77e8398a3a943e8c",
533 | "TypeName": "FlaxEngine.UIControl",
534 | "ParentID": "f3ec497045c6d69aa0b4709c987120cd",
535 | "Name": "Panel",
536 | "Transform": {
537 | "Translation": {
538 | "X": 2.0,
539 | "Y": 2.0,
540 | "Z": 0.0
541 | }
542 | },
543 | "Control": "FlaxEngine.GUI.Panel",
544 | "Data": {
545 | "ScrollBars": 0,
546 | "ScrollBarsSize": 14.0,
547 | "AlwaysShowScrollbars": false,
548 | "ScrollMargin": {
549 | "Left": 0.0,
550 | "Right": 0.0,
551 | "Top": 0.0,
552 | "Bottom": 0.0
553 | },
554 | "ScrollbarTrackColor": {
555 | "R": 0.32941177,
556 | "G": 0.32941177,
557 | "B": 0.36078432,
558 | "A": 1.0
559 | },
560 | "ScrollbarThumbColor": {
561 | "R": 0.24705882,
562 | "G": 0.24705882,
563 | "B": 0.27450982,
564 | "A": 1.0
565 | },
566 | "ScrollbarThumbSelectedColor": {
567 | "R": 0.0,
568 | "G": 0.47843137,
569 | "B": 0.8,
570 | "A": 1.0
571 | },
572 | "ClipChildren": true,
573 | "CullChildren": true,
574 | "AnchorMin": {
575 | "X": 0.0,
576 | "Y": 0.0
577 | },
578 | "AnchorMax": {
579 | "X": 0.0,
580 | "Y": 0.0
581 | },
582 | "Offsets": {
583 | "Left": 2.0,
584 | "Right": 196.0,
585 | "Top": 2.0,
586 | "Bottom": 40.0
587 | },
588 | "Scale": {
589 | "X": 1.0,
590 | "Y": 1.0
591 | },
592 | "Pivot": {
593 | "X": 0.5,
594 | "Y": 0.5
595 | },
596 | "Shear": {
597 | "X": 0.0,
598 | "Y": 0.0
599 | },
600 | "Rotation": 0.0,
601 | "BackgroundColor": {
602 | "R": 0.0,
603 | "G": 0.0,
604 | "B": 0.0,
605 | "A": 0.5
606 | },
607 | "BackgroundBrush": null,
608 | "Enabled": true,
609 | "Visible": true,
610 | "AutoFocus": false
611 | }
612 | },
613 | {
614 | "ID": "bcd3ec3d42795d573acc1aa91ef8bc1a",
615 | "TypeName": "FlaxEngine.UIControl",
616 | "ParentID": "17f3b4b2425d7f3c77e8398a3a943e8c",
617 | "Name": "Label",
618 | "Transform": {
619 | "Translation": {
620 | "X": 48.0,
621 | "Y": 10.0,
622 | "Z": 0.0
623 | }
624 | },
625 | "Control": "FlaxEngine.GUI.Label",
626 | "Data": {
627 | "Text": "Player List",
628 | "CaseOption": 0,
629 | "Bold": false,
630 | "Italic": false,
631 | "TextColor": {
632 | "R": 1.0,
633 | "G": 1.0,
634 | "B": 1.0,
635 | "A": 1.0
636 | },
637 | "TextColorHighlighted": {
638 | "R": 1.0,
639 | "G": 1.0,
640 | "B": 1.0,
641 | "A": 1.0
642 | },
643 | "HorizontalAlignment": 1,
644 | "VerticalAlignment": 1,
645 | "Wrapping": 0,
646 | "BaseLinesGapScale": 1.0,
647 | "Font": {
648 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
649 | "Size": 16.0
650 | },
651 | "Material": null,
652 | "Margin": {
653 | "Left": 0.0,
654 | "Right": 0.0,
655 | "Top": 0.0,
656 | "Bottom": 0.0
657 | },
658 | "ClipText": false,
659 | "AutoWidth": false,
660 | "AutoHeight": false,
661 | "AutoFitText": false,
662 | "AutoFitTextRange": {
663 | "X": 0.1,
664 | "Y": 100.0
665 | },
666 | "ClipChildren": true,
667 | "CullChildren": true,
668 | "AnchorMin": {
669 | "X": 0.5,
670 | "Y": 0.5
671 | },
672 | "AnchorMax": {
673 | "X": 0.5,
674 | "Y": 0.5
675 | },
676 | "Offsets": {
677 | "Left": -50.0,
678 | "Right": 100.0,
679 | "Top": -10.0,
680 | "Bottom": 20.0
681 | },
682 | "Scale": {
683 | "X": 1.0,
684 | "Y": 1.0
685 | },
686 | "Pivot": {
687 | "X": 0.5,
688 | "Y": 0.5
689 | },
690 | "Shear": {
691 | "X": 0.0,
692 | "Y": 0.0
693 | },
694 | "Rotation": 0.0,
695 | "BackgroundColor": {
696 | "R": 0.0,
697 | "G": 0.0,
698 | "B": 0.0,
699 | "A": 0.0
700 | },
701 | "BackgroundBrush": null,
702 | "Enabled": true,
703 | "Visible": true,
704 | "AutoFocus": false
705 | }
706 | },
707 | {
708 | "ID": "0d30e47445897a404bc9e5ba8226bce9",
709 | "TypeName": "FlaxEngine.UIControl",
710 | "ParentID": "f3ec497045c6d69aa0b4709c987120cd",
711 | "Name": "Panel 0",
712 | "Transform": {
713 | "Translation": {
714 | "X": 2.0,
715 | "Y": 44.0,
716 | "Z": 0.0
717 | }
718 | },
719 | "Control": "FlaxEngine.GUI.Panel",
720 | "Data": {
721 | "ScrollBars": 2,
722 | "ScrollBarsSize": 14.0,
723 | "AlwaysShowScrollbars": true,
724 | "ScrollMargin": {
725 | "Left": 0.0,
726 | "Right": 0.0,
727 | "Top": 0.0,
728 | "Bottom": 0.0
729 | },
730 | "ScrollbarTrackColor": {
731 | "R": 0.32941177,
732 | "G": 0.32941177,
733 | "B": 0.36078432,
734 | "A": 1.0
735 | },
736 | "ScrollbarThumbColor": {
737 | "R": 0.24705882,
738 | "G": 0.24705882,
739 | "B": 0.27450982,
740 | "A": 1.0
741 | },
742 | "ScrollbarThumbSelectedColor": {
743 | "R": 0.0,
744 | "G": 0.47843137,
745 | "B": 0.8,
746 | "A": 1.0
747 | },
748 | "ClipChildren": true,
749 | "CullChildren": true,
750 | "AnchorMin": {
751 | "X": 0.0,
752 | "Y": 0.0
753 | },
754 | "AnchorMax": {
755 | "X": 0.0,
756 | "Y": 0.0
757 | },
758 | "Offsets": {
759 | "Left": 2.0,
760 | "Right": 196.0,
761 | "Top": 44.0,
762 | "Bottom": 150.0
763 | },
764 | "Scale": {
765 | "X": 1.0,
766 | "Y": 1.0
767 | },
768 | "Pivot": {
769 | "X": 0.5,
770 | "Y": 0.5
771 | },
772 | "Shear": {
773 | "X": 0.0,
774 | "Y": 0.0
775 | },
776 | "Rotation": 0.0,
777 | "BackgroundColor": {
778 | "R": 0.0,
779 | "G": 0.0,
780 | "B": 0.0,
781 | "A": 0.5
782 | },
783 | "BackgroundBrush": null,
784 | "Enabled": true,
785 | "Visible": true,
786 | "AutoFocus": false
787 | }
788 | },
789 | {
790 | "ID": "8f4645804d234692cfb1b9a27ffd5825",
791 | "TypeName": "FlaxEngine.UIControl",
792 | "ParentID": "0d30e47445897a404bc9e5ba8226bce9",
793 | "Name": "VerticalPanel",
794 | "Transform": {
795 | "Translation": {
796 | "X": -7.0,
797 | "Y": 0.0,
798 | "Z": 0.0
799 | }
800 | },
801 | "Control": "FlaxEngine.GUI.VerticalPanel",
802 | "Data": {
803 | "Spacing": 2.0,
804 | "Offset": {
805 | "X": 0.0,
806 | "Y": 0.0
807 | },
808 | "AutoSize": true,
809 | "ControlChildSize": true,
810 | "Margin": {
811 | "Left": 2.0,
812 | "Right": 2.0,
813 | "Top": 2.0,
814 | "Bottom": 2.0
815 | },
816 | "Alignment": 0,
817 | "ClipChildren": true,
818 | "CullChildren": true,
819 | "AnchorMin": {
820 | "X": 0.5,
821 | "Y": 0.0
822 | },
823 | "AnchorMax": {
824 | "X": 0.5,
825 | "Y": 0.0
826 | },
827 | "Offsets": {
828 | "Left": -98.0,
829 | "Right": 196.0,
830 | "Top": 0.0,
831 | "Bottom": 4.0
832 | },
833 | "Scale": {
834 | "X": 1.0,
835 | "Y": 1.0
836 | },
837 | "Pivot": {
838 | "X": 0.5,
839 | "Y": 0.0
840 | },
841 | "Shear": {
842 | "X": 0.0,
843 | "Y": 0.0
844 | },
845 | "Rotation": 0.0,
846 | "BackgroundColor": {
847 | "R": 0.0,
848 | "G": 0.0,
849 | "B": 0.0,
850 | "A": 0.0
851 | },
852 | "BackgroundBrush": null,
853 | "Enabled": true,
854 | "Visible": true,
855 | "AutoFocus": false
856 | }
857 | },
858 | {
859 | "ID": "b00ad6444d05145964020893958b7bba",
860 | "TypeName": "FlaxEngine.UIControl",
861 | "ParentID": "85cff9bc4630ffd9de5fcdb374ccfe3e",
862 | "Name": "Chat",
863 | "Transform": {
864 | "Translation": {
865 | "X": 5.0,
866 | "Y": 545.0,
867 | "Z": -2.168404344971009e-19
868 | }
869 | },
870 | "Control": "FlaxEngine.GUI.Panel",
871 | "Data": {
872 | "ScrollBars": 3,
873 | "ScrollBarsSize": 14.0,
874 | "AlwaysShowScrollbars": false,
875 | "ScrollMargin": {
876 | "Left": 0.0,
877 | "Right": 0.0,
878 | "Top": 0.0,
879 | "Bottom": 0.0
880 | },
881 | "ScrollbarTrackColor": {
882 | "R": 0.32941177,
883 | "G": 0.32941177,
884 | "B": 0.36078432,
885 | "A": 1.0
886 | },
887 | "ScrollbarThumbColor": {
888 | "R": 0.24705882,
889 | "G": 0.24705882,
890 | "B": 0.27450982,
891 | "A": 1.0
892 | },
893 | "ScrollbarThumbSelectedColor": {
894 | "R": 0.0,
895 | "G": 0.47843137,
896 | "B": 0.8,
897 | "A": 1.0
898 | },
899 | "ClipChildren": false,
900 | "CullChildren": true,
901 | "AnchorMin": {
902 | "X": 0.0,
903 | "Y": 0.5
904 | },
905 | "AnchorMax": {
906 | "X": 0.0,
907 | "Y": 0.5
908 | },
909 | "Offsets": {
910 | "Left": 5.0,
911 | "Right": 350.0,
912 | "Top": 5.0,
913 | "Bottom": 150.0
914 | },
915 | "Scale": {
916 | "X": 1.0,
917 | "Y": 1.0
918 | },
919 | "Pivot": {
920 | "X": 0.5,
921 | "Y": 0.5
922 | },
923 | "Shear": {
924 | "X": 0.0,
925 | "Y": 0.0
926 | },
927 | "Rotation": 0.0,
928 | "BackgroundColor": {
929 | "R": 0.0,
930 | "G": 0.0,
931 | "B": 0.0,
932 | "A": 0.0
933 | },
934 | "BackgroundBrush": null,
935 | "Enabled": true,
936 | "Visible": true,
937 | "AutoFocus": false
938 | }
939 | },
940 | {
941 | "ID": "4da4e27647e7cf43385c9795f7b4b8f3",
942 | "TypeName": "ChatScript",
943 | "ParentID": "b00ad6444d05145964020893958b7bba",
944 | "V": {
945 | "MessageBox": "c49bee084383f3d96ada4fbfc6566c90",
946 | "Panel": "ed533eaa449ae52e72334bbd9c1f8850",
947 | "VertPanel": "a89523dd45f914b02c21c3802098d963",
948 | "ChatFont": {
949 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
950 | "Size": 9.0
951 | }
952 | }
953 | },
954 | {
955 | "ID": "ed533eaa449ae52e72334bbd9c1f8850",
956 | "TypeName": "FlaxEngine.UIControl",
957 | "ParentID": "b00ad6444d05145964020893958b7bba",
958 | "Name": "Panel",
959 | "Control": "FlaxEngine.GUI.Panel",
960 | "Data": {
961 | "ScrollBars": 2,
962 | "ScrollBarsSize": 14.0,
963 | "AlwaysShowScrollbars": false,
964 | "ScrollMargin": {
965 | "Left": 0.0,
966 | "Right": 0.0,
967 | "Top": 0.0,
968 | "Bottom": 0.0
969 | },
970 | "ScrollbarTrackColor": {
971 | "R": 0.32941177,
972 | "G": 0.32941177,
973 | "B": 0.36078432,
974 | "A": 1.0
975 | },
976 | "ScrollbarThumbColor": {
977 | "R": 0.24705882,
978 | "G": 0.24705882,
979 | "B": 0.27450982,
980 | "A": 1.0
981 | },
982 | "ScrollbarThumbSelectedColor": {
983 | "R": 0.0,
984 | "G": 0.47843137,
985 | "B": 0.8,
986 | "A": 1.0
987 | },
988 | "ClipChildren": true,
989 | "CullChildren": true,
990 | "AnchorMin": {
991 | "X": 0.0,
992 | "Y": 0.0
993 | },
994 | "AnchorMax": {
995 | "X": 1.0,
996 | "Y": 1.0
997 | },
998 | "Offsets": {
999 | "Left": 0.0,
1000 | "Right": 0.0,
1001 | "Top": 0.0,
1002 | "Bottom": 24.0
1003 | },
1004 | "Scale": {
1005 | "X": 1.0,
1006 | "Y": 1.0
1007 | },
1008 | "Pivot": {
1009 | "X": 0.5,
1010 | "Y": 0.5
1011 | },
1012 | "Shear": {
1013 | "X": 0.0,
1014 | "Y": 0.0
1015 | },
1016 | "Rotation": 0.0,
1017 | "BackgroundColor": {
1018 | "R": 0.0,
1019 | "G": 0.0,
1020 | "B": 0.0,
1021 | "A": 0.0
1022 | },
1023 | "BackgroundBrush": null,
1024 | "Enabled": true,
1025 | "Visible": true,
1026 | "AutoFocus": false
1027 | }
1028 | },
1029 | {
1030 | "ID": "a89523dd45f914b02c21c3802098d963",
1031 | "TypeName": "FlaxEngine.UIControl",
1032 | "ParentID": "ed533eaa449ae52e72334bbd9c1f8850",
1033 | "Name": "VerticalPanel",
1034 | "Control": "FlaxEngine.GUI.VerticalPanel",
1035 | "Data": {
1036 | "Spacing": 2.0,
1037 | "Offset": {
1038 | "X": 0.0,
1039 | "Y": 0.0
1040 | },
1041 | "AutoSize": true,
1042 | "ControlChildSize": true,
1043 | "Margin": {
1044 | "Left": 10.0,
1045 | "Right": 10.0,
1046 | "Top": 3.0,
1047 | "Bottom": 3.0
1048 | },
1049 | "Alignment": 0,
1050 | "ClipChildren": true,
1051 | "CullChildren": true,
1052 | "AnchorMin": {
1053 | "X": 0.0,
1054 | "Y": 0.0
1055 | },
1056 | "AnchorMax": {
1057 | "X": 1.0,
1058 | "Y": 1.0
1059 | },
1060 | "Offsets": {
1061 | "Left": 0.0,
1062 | "Right": 0.0,
1063 | "Top": 0.0,
1064 | "Bottom": 120.0
1065 | },
1066 | "Scale": {
1067 | "X": 1.0,
1068 | "Y": 1.0
1069 | },
1070 | "Pivot": {
1071 | "X": 0.0,
1072 | "Y": 0.0
1073 | },
1074 | "Shear": {
1075 | "X": 0.0,
1076 | "Y": 0.0
1077 | },
1078 | "Rotation": 0.0,
1079 | "BackgroundColor": {
1080 | "R": 0.0,
1081 | "G": 0.0,
1082 | "B": 0.0,
1083 | "A": 0.0
1084 | },
1085 | "BackgroundBrush": null,
1086 | "Enabled": true,
1087 | "Visible": true,
1088 | "AutoFocus": false
1089 | }
1090 | },
1091 | {
1092 | "ID": "c49bee084383f3d96ada4fbfc6566c90",
1093 | "TypeName": "FlaxEngine.UIControl",
1094 | "ParentID": "b00ad6444d05145964020893958b7bba",
1095 | "IsActive": false,
1096 | "Name": "TextBox",
1097 | "Transform": {
1098 | "Translation": {
1099 | "X": 0.0,
1100 | "Y": 127.0,
1101 | "Z": 0.0
1102 | }
1103 | },
1104 | "Control": "FlaxEngine.GUI.TextBox",
1105 | "Data": {
1106 | "ObfuscateText": false,
1107 | "ObfuscateCharacter": "●",
1108 | "WatermarkText": "",
1109 | "CaseOption": 0,
1110 | "Bold": false,
1111 | "Italic": false,
1112 | "VerticalAlignment": 1,
1113 | "HorizontalAlignment": 0,
1114 | "Wrapping": 0,
1115 | "Font": {
1116 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
1117 | "Size": 9.0
1118 | },
1119 | "TextMaterial": null,
1120 | "TextColor": {
1121 | "R": 1.0,
1122 | "G": 1.0,
1123 | "B": 1.0,
1124 | "A": 1.0
1125 | },
1126 | "WatermarkTextColor": {
1127 | "R": 0.47058824,
1128 | "G": 0.47058824,
1129 | "B": 0.5137255,
1130 | "A": 1.0
1131 | },
1132 | "SelectionColor": {
1133 | "R": 0.0,
1134 | "G": 0.47843137,
1135 | "B": 0.8,
1136 | "A": 1.0
1137 | },
1138 | "EndEditOnClick": true,
1139 | "IsMultiline": false,
1140 | "MaxLength": 2147483646,
1141 | "IsReadOnly": false,
1142 | "IsSelectable": true,
1143 | "ClipText": true,
1144 | "IsMultilineScrollable": true,
1145 | "BackgroundSelectedColor": {
1146 | "R": 0.24705882,
1147 | "G": 0.24705882,
1148 | "B": 0.27450982,
1149 | "A": 1.0
1150 | },
1151 | "CaretColor": {
1152 | "R": 1.0,
1153 | "G": 1.0,
1154 | "B": 1.0,
1155 | "A": 1.0
1156 | },
1157 | "CaretFlashSpeed": 6.0,
1158 | "BackgroundSelectedFlashSpeed": 6.0,
1159 | "HasBorder": true,
1160 | "BorderThickness": 1.0,
1161 | "BorderColor": {
1162 | "R": 0.0,
1163 | "G": 0.0,
1164 | "B": 0.0,
1165 | "A": 0.0
1166 | },
1167 | "BorderSelectedColor": {
1168 | "R": 0.0,
1169 | "G": 0.47843137,
1170 | "B": 0.8,
1171 | "A": 1.0
1172 | },
1173 | "Text": "",
1174 | "SelectionRange": {
1175 | "StartIndex": -1,
1176 | "EndIndex": -1
1177 | },
1178 | "ClipChildren": true,
1179 | "CullChildren": true,
1180 | "AnchorMin": {
1181 | "X": 0.0,
1182 | "Y": 1.0
1183 | },
1184 | "AnchorMax": {
1185 | "X": 1.0,
1186 | "Y": 1.0
1187 | },
1188 | "Offsets": {
1189 | "Left": 0.0,
1190 | "Right": 0.0,
1191 | "Top": -23.0,
1192 | "Bottom": 22.0
1193 | },
1194 | "Scale": {
1195 | "X": 1.0,
1196 | "Y": 1.0
1197 | },
1198 | "Pivot": {
1199 | "X": 0.5,
1200 | "Y": 0.5
1201 | },
1202 | "Shear": {
1203 | "X": 0.0,
1204 | "Y": 0.0
1205 | },
1206 | "Rotation": 0.0,
1207 | "BackgroundColor": {
1208 | "R": 0.0009273159,
1209 | "G": 0.0009273159,
1210 | "B": 0.0010000467,
1211 | "A": 0.5
1212 | },
1213 | "BackgroundBrush": null,
1214 | "Enabled": true,
1215 | "Visible": false,
1216 | "AutoFocus": true
1217 | }
1218 | },
1219 | {
1220 | "ID": "672cf69c411c4d6c1b97c5a61d467576",
1221 | "PrefabID": "3c0da8cf4469a986341366b3d951e4ce",
1222 | "PrefabObjectID": "1440aef34913715de95133a71d610652",
1223 | "ParentID": "74a68a984824b4510d12589f199ad68f",
1224 | "Name": "Player_FlaxPlayer",
1225 | "Transform": {
1226 | "Translation": {
1227 | "X": -281.3502197265625,
1228 | "Y": 142.57920837402344,
1229 | "Z": 36.899627685546875
1230 | }
1231 | }
1232 | },
1233 | {
1234 | "ID": "8691cb9645ec691b43ae919cdc429bd2",
1235 | "PrefabID": "3c0da8cf4469a986341366b3d951e4ce",
1236 | "PrefabObjectID": "9e98ab71443952414432c1bd6affcdd5",
1237 | "ParentID": "672cf69c411c4d6c1b97c5a61d467576",
1238 | "V": {
1239 | "MaxVelocityAir": 400.0
1240 | }
1241 | },
1242 | {
1243 | "ID": "06ae8a7d469da33153f5a3b55f1d1d16",
1244 | "PrefabID": "3c0da8cf4469a986341366b3d951e4ce",
1245 | "PrefabObjectID": "8b0603c44c52faa46629598d36559644",
1246 | "ParentID": "672cf69c411c4d6c1b97c5a61d467576"
1247 | },
1248 | {
1249 | "ID": "18c66e4f4f58c75763706f8685500f5f",
1250 | "TypeName": "FlaxEngine.EmptyActor",
1251 | "ParentID": "74a68a984824b4510d12589f199ad68f",
1252 | "Name": "SpawnPoint",
1253 | "Transform": {
1254 | "Translation": {
1255 | "X": -281.3502197265625,
1256 | "Y": 142.57920837402344,
1257 | "Z": 36.899627685546875
1258 | }
1259 | }
1260 | }
1261 | ]
1262 | }
--------------------------------------------------------------------------------
/Content/GameSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "9eba3d2a4cee4c099117f49c5dffc171",
3 | "TypeName": "FlaxEditor.Content.Settings.GameSettings",
4 | "EngineBuild": 6337,
5 | "Data": {
6 | "ProductName": "NetwrokSample",
7 | "CompanyName": "My Company",
8 | "CopyrightNotice": null,
9 | "Icon": null,
10 | "FirstScene": "d8ddc95040eec2d25b65a0b68c298f0e",
11 | "NoSplashScreen": false,
12 | "SplashScreen": null,
13 | "Time": "9acd18b0496064d35799f390d3a2b374",
14 | "Audio": "fc8ef1bb474956920c5505b7ea7ea9ff",
15 | "LayersAndTags": "bb6fbecf458db0ecffa5e2a5155b2b4f",
16 | "Physics": "7871f0364d398555ccd9e297acdc8983",
17 | "Input": "f4c1c67842f6b745a6976aa8e7eff360",
18 | "Graphics": "4eaf325e4cd72aa4cdeb6393cad05466",
19 | "Network": "f168fe7a43c90e4f82676b86d8cb027a",
20 | "Navigation": "9d5e29604efb16eff6b815aa4a110227",
21 | "Localization": "7ce4a8c64c8116aefe23b184adcabcfb",
22 | "GameCooking": "2364031e4e327637c1ad88b415fa756e",
23 | "Streaming": "46f7ca204355d836ff4bf4aa43d211ac",
24 | "CustomSettings": null,
25 | "WindowsPlatform": "79ac390447f4263e30f56e9190a70dbc",
26 | "UWPPlatform": "8660bbf44f1ea61cb9bc4580b3631973",
27 | "LinuxPlatform": "1bf4eedd41508974d6646e8faa55420a",
28 | "PS4Platform": null,
29 | "XboxOnePlatform": null,
30 | "XboxScarlettPlatform": null,
31 | "AndroidPlatform": "9ac06a884463f4ae9435e2b03c866259",
32 | "SwitchPlatform": null,
33 | "PS5Platform": null,
34 | "MacPlatform": null
35 | }
36 | }
--------------------------------------------------------------------------------
/Content/Materials/Blue Material.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/Materials/Blue Material.flax
--------------------------------------------------------------------------------
/Content/Materials/MAT_FlaxDecal.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/Materials/MAT_FlaxDecal.flax
--------------------------------------------------------------------------------
/Content/Materials/Solid Color Material.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/Materials/Solid Color Material.flax
--------------------------------------------------------------------------------
/Content/Materials/White Material.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/Materials/White Material.flax
--------------------------------------------------------------------------------
/Content/Menu.scene:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "d8ddc95040eec2d25b65a0b68c298f0e",
3 | "TypeName": "FlaxEngine.SceneAsset",
4 | "EngineBuild": 6222,
5 | "Data": [
6 | {
7 | "ID": "d8ddc95040eec2d25b65a0b68c298f0e",
8 | "TypeName": "FlaxEngine.Scene",
9 | "LightmapSettings": {
10 | "IndirectLightingIntensity": 1.0,
11 | "GlobalObjectsScale": 1.0,
12 | "ChartsPadding": 3,
13 | "AtlasSize": 1024,
14 | "BounceCount": 1,
15 | "CompressLightmaps": true,
16 | "UseGeometryWithNoMaterials": true,
17 | "Quality": 10
18 | }
19 | },
20 | {
21 | "ID": "d7a07b8a4adfa1bd5dfd75907a9fec3d",
22 | "TypeName": "ExitOnEsc",
23 | "ParentID": "d8ddc95040eec2d25b65a0b68c298f0e",
24 | "V": {}
25 | },
26 | {
27 | "ID": "4c54a11e4ff7210b41f97eb03693c04d",
28 | "TypeName": "FlaxEngine.DirectionalLight",
29 | "ParentID": "d8ddc95040eec2d25b65a0b68c298f0e",
30 | "Name": "Sun",
31 | "Transform": {
32 | "Translation": {
33 | "X": 40.0,
34 | "Y": 160.0,
35 | "Z": 0.0
36 | },
37 | "Orientation": {
38 | "X": 0.3826834559440613,
39 | "Y": 0.0,
40 | "Z": 0.0,
41 | "W": 0.9238795042037964
42 | }
43 | },
44 | "Brightness": 2.0,
45 | "ShadowsMode": 0
46 | },
47 | {
48 | "ID": "04dd4121461754aa5aa8acbbc3385821",
49 | "TypeName": "FlaxEngine.Sky",
50 | "ParentID": "d8ddc95040eec2d25b65a0b68c298f0e",
51 | "Name": "Sky",
52 | "Transform": {
53 | "Translation": {
54 | "X": 40.0,
55 | "Y": 150.0,
56 | "Z": 0.0
57 | }
58 | },
59 | "Sun": "4c54a11e4ff7210b41f97eb03693c04d"
60 | },
61 | {
62 | "ID": "fbc2d01745b0eef836c172994d1a90de",
63 | "TypeName": "FlaxEngine.SkyLight",
64 | "ParentID": "d8ddc95040eec2d25b65a0b68c298f0e",
65 | "Name": "SkyLight",
66 | "Brightness": 2.5,
67 | "CustomTexture": "c54410104ff39427bc11e5bc761d66b0"
68 | },
69 | {
70 | "ID": "f6b38577427b4db8a657848a24d6d933",
71 | "TypeName": "FlaxEngine.Camera",
72 | "ParentID": "d8ddc95040eec2d25b65a0b68c298f0e",
73 | "Name": "Camera",
74 | "Transform": {
75 | "Translation": {
76 | "X": 0.0,
77 | "Y": 0.0,
78 | "Z": -700.0
79 | }
80 | }
81 | },
82 | {
83 | "ID": "3b00ef00401d96f1ea00b8a5b333b705",
84 | "TypeName": "FlaxEngine.UICanvas",
85 | "ParentID": "d8ddc95040eec2d25b65a0b68c298f0e",
86 | "Name": "UICanvas",
87 | "Transform": {
88 | "Orientation": {
89 | "X": 1.0,
90 | "Y": 4.371138828673793e-8,
91 | "Z": 4.371138828673793e-8,
92 | "W": 1.910685465164705e-15
93 | }
94 | },
95 | "V": {}
96 | },
97 | {
98 | "ID": "9527ae3042f8a003c95c02b135d8ecfe",
99 | "TypeName": "FlaxEngine.UIControl",
100 | "ParentID": "3b00ef00401d96f1ea00b8a5b333b705",
101 | "Name": "BlurPanel",
102 | "Transform": {
103 | "Translation": {
104 | "X": 0.0,
105 | "Y": 0.0,
106 | "Z": -0.000006556707376148552
107 | },
108 | "Orientation": {
109 | "X": -1.0,
110 | "Y": -4.371138828673793e-8,
111 | "Z": -4.371138828673793e-8,
112 | "W": 1.910685465164705e-15
113 | }
114 | },
115 | "Control": "FlaxEngine.GUI.BlurPanel",
116 | "Data": {
117 | "BlurStrength": 3.0,
118 | "ClipChildren": true,
119 | "CullChildren": true,
120 | "AnchorMin": {
121 | "X": 0.0,
122 | "Y": 0.0
123 | },
124 | "AnchorMax": {
125 | "X": 1.0,
126 | "Y": 1.0
127 | },
128 | "Offsets": {
129 | "Left": 0.0,
130 | "Right": 0.0,
131 | "Top": 0.0,
132 | "Bottom": 0.0
133 | },
134 | "Scale": {
135 | "X": 1.0,
136 | "Y": 1.0
137 | },
138 | "Pivot": {
139 | "X": 0.5,
140 | "Y": 0.5
141 | },
142 | "Shear": {
143 | "X": 0.0,
144 | "Y": 0.0
145 | },
146 | "Rotation": 0.0,
147 | "BackgroundColor": {
148 | "R": 0.0,
149 | "G": 0.0,
150 | "B": 0.0,
151 | "A": 0.0
152 | },
153 | "Enabled": true,
154 | "Visible": true
155 | }
156 | },
157 | {
158 | "ID": "89128d9d4c101ec1c8773aa86ea0126a",
159 | "TypeName": "FlaxEngine.UIControl",
160 | "ParentID": "3b00ef00401d96f1ea00b8a5b333b705",
161 | "Name": "HorizontalPanel",
162 | "Transform": {
163 | "Translation": {
164 | "X": 404.5,
165 | "Y": 278.5,
166 | "Z": 0.0
167 | }
168 | },
169 | "Control": "FlaxEngine.GUI.HorizontalPanel",
170 | "Data": {
171 | "Spacing": 5.0,
172 | "Offset": {
173 | "X": 0.0,
174 | "Y": 0.0
175 | },
176 | "AutoSize": false,
177 | "Margin": {
178 | "Left": 2.0,
179 | "Right": 2.0,
180 | "Top": 2.0,
181 | "Bottom": 2.0
182 | },
183 | "ClipChildren": false,
184 | "CullChildren": true,
185 | "AnchorMin": {
186 | "X": 0.5,
187 | "Y": 0.5
188 | },
189 | "AnchorMax": {
190 | "X": 0.5,
191 | "Y": 0.5
192 | },
193 | "Offsets": {
194 | "Left": -252.5,
195 | "Right": 505.0,
196 | "Top": -125.0,
197 | "Bottom": 250.0
198 | },
199 | "Scale": {
200 | "X": 1.0,
201 | "Y": 1.0
202 | },
203 | "Pivot": {
204 | "X": 0.5,
205 | "Y": 0.5
206 | },
207 | "Shear": {
208 | "X": 0.0,
209 | "Y": 0.0
210 | },
211 | "Rotation": 0.0,
212 | "BackgroundColor": {
213 | "R": 0.0,
214 | "G": 0.0,
215 | "B": 0.0,
216 | "A": 0.0
217 | },
218 | "Enabled": true,
219 | "Visible": true
220 | }
221 | },
222 | {
223 | "ID": "6834ad4043c09c5ae130baa5f35fdeb5",
224 | "TypeName": "FlaxEngine.UIControl",
225 | "ParentID": "89128d9d4c101ec1c8773aa86ea0126a",
226 | "Name": "Panel 0",
227 | "Transform": {
228 | "Translation": {
229 | "X": 2.0,
230 | "Y": 2.0,
231 | "Z": -0.000006556707376148552
232 | },
233 | "Orientation": {
234 | "X": -1.0,
235 | "Y": -4.371138828673793e-8,
236 | "Z": -4.371138828673793e-8,
237 | "W": 1.910685465164705e-15
238 | }
239 | },
240 | "Control": "FlaxEngine.GUI.Panel",
241 | "Data": {
242 | "ScrollBars": 0,
243 | "AlwaysShowScrollbars": false,
244 | "ScrollMargin": {
245 | "Left": 0.0,
246 | "Right": 0.0,
247 | "Top": 0.0,
248 | "Bottom": 0.0
249 | },
250 | "ClipChildren": true,
251 | "CullChildren": true,
252 | "AnchorMin": {
253 | "X": 0.0,
254 | "Y": 0.5
255 | },
256 | "AnchorMax": {
257 | "X": 0.0,
258 | "Y": 0.5
259 | },
260 | "Offsets": {
261 | "Left": 2.0,
262 | "Right": 150.0,
263 | "Top": -123.0,
264 | "Bottom": 246.0
265 | },
266 | "Scale": {
267 | "X": 1.0,
268 | "Y": 1.0
269 | },
270 | "Pivot": {
271 | "X": 0.5,
272 | "Y": 0.5
273 | },
274 | "Shear": {
275 | "X": 0.0,
276 | "Y": 0.0
277 | },
278 | "Rotation": 0.0,
279 | "BackgroundColor": {
280 | "R": 0.0,
281 | "G": 0.0,
282 | "B": 0.0,
283 | "A": 0.0
284 | },
285 | "Enabled": true,
286 | "Visible": true
287 | }
288 | },
289 | {
290 | "ID": "b70a775f4a408cfd505d57859670407d",
291 | "TypeName": "FlaxEngine.UIControl",
292 | "ParentID": "6834ad4043c09c5ae130baa5f35fdeb5",
293 | "Name": "HostConnectScreen",
294 | "Transform": {
295 | "Translation": {
296 | "X": 0.0,
297 | "Y": -0.5,
298 | "Z": 0.0
299 | }
300 | },
301 | "Control": "FlaxEngine.GUI.VerticalPanel",
302 | "Data": {
303 | "Spacing": 5.0,
304 | "Offset": {
305 | "X": 0.0,
306 | "Y": 0.0
307 | },
308 | "AutoSize": false,
309 | "Margin": {
310 | "Left": 10.0,
311 | "Right": 10.0,
312 | "Top": 10.0,
313 | "Bottom": 10.0
314 | },
315 | "ClipChildren": true,
316 | "CullChildren": true,
317 | "AnchorMin": {
318 | "X": 0.5,
319 | "Y": 0.0
320 | },
321 | "AnchorMax": {
322 | "X": 0.5,
323 | "Y": 0.0
324 | },
325 | "Offsets": {
326 | "Left": -75.0,
327 | "Right": 150.0,
328 | "Top": -0.5,
329 | "Bottom": 145.0
330 | },
331 | "Scale": {
332 | "X": 1.0,
333 | "Y": 1.0
334 | },
335 | "Pivot": {
336 | "X": 0.5,
337 | "Y": 0.5
338 | },
339 | "Shear": {
340 | "X": 0.0,
341 | "Y": 0.0
342 | },
343 | "Rotation": 0.0,
344 | "BackgroundColor": {
345 | "R": 0.0,
346 | "G": 0.0,
347 | "B": 0.0,
348 | "A": 0.18889
349 | },
350 | "Enabled": true,
351 | "Visible": true
352 | }
353 | },
354 | {
355 | "ID": "298a2a804125421d95bef0b09ac5d4a9",
356 | "TypeName": "Game.HostConnectScreenScript",
357 | "ParentID": "b70a775f4a408cfd505d57859670407d",
358 | "V": {
359 | "UsernameTextBox": "ec9b03b74d33974994e1c28f16685fe7",
360 | "AddressTextBox": "2f0db94e40b9cdb7737744b9b7e7a6ef",
361 | "ConnectButton": "d9bba6074d44b4a57a048fb17ffd7896",
362 | "PortTextBox": "fb5af0154a3f82191d2a5589eb539540",
363 | "HostButton": "b5993fc54b8b6702aef6b6a57143e619",
364 | "GameScene": "74a68a984824b4510d12589f199ad68f"
365 | }
366 | },
367 | {
368 | "ID": "ec9b03b74d33974994e1c28f16685fe7",
369 | "TypeName": "FlaxEngine.UIControl",
370 | "ParentID": "b70a775f4a408cfd505d57859670407d",
371 | "Name": "Username",
372 | "Transform": {
373 | "Translation": {
374 | "X": 10.0,
375 | "Y": 10.0,
376 | "Z": 0.0
377 | }
378 | },
379 | "Control": "FlaxEngine.GUI.TextBox",
380 | "Data": {
381 | "WatermarkText": "Username",
382 | "Wrapping": 0,
383 | "Font": {
384 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
385 | "Size": 9
386 | },
387 | "TextColor": {
388 | "R": 1.0,
389 | "G": 1.0,
390 | "B": 1.0,
391 | "A": 1.0
392 | },
393 | "WatermarkTextColor": {
394 | "R": 0.470588237,
395 | "G": 0.470588237,
396 | "B": 0.5137255,
397 | "A": 1.0
398 | },
399 | "SelectionColor": {
400 | "R": 0.0,
401 | "G": 0.478431374,
402 | "B": 0.8,
403 | "A": 1.0
404 | },
405 | "IsMultiline": false,
406 | "MaxLength": 2147483646,
407 | "IsReadOnly": false,
408 | "BackgroundSelectedColor": {
409 | "R": 0.247058824,
410 | "G": 0.247058824,
411 | "B": 0.274509817,
412 | "A": 1.0
413 | },
414 | "CaretColor": {
415 | "R": 1.0,
416 | "G": 1.0,
417 | "B": 1.0,
418 | "A": 1.0
419 | },
420 | "CaretFlashSpeed": 6.0,
421 | "BackgroundSelectedFlashSpeed": 6.0,
422 | "BorderColor": {
423 | "R": 0.0,
424 | "G": 0.0,
425 | "B": 0.0,
426 | "A": 0.0
427 | },
428 | "BorderSelectedColor": {
429 | "R": 0.0,
430 | "G": 0.478431374,
431 | "B": 0.8,
432 | "A": 1.0
433 | },
434 | "Text": "FlaxPlayer",
435 | "SelectionRange": {
436 | "StartIndex": -1,
437 | "EndIndex": -1
438 | },
439 | "ClipChildren": true,
440 | "CullChildren": true,
441 | "AnchorMin": {
442 | "X": 0.0,
443 | "Y": 0.0
444 | },
445 | "AnchorMax": {
446 | "X": 0.0,
447 | "Y": 0.0
448 | },
449 | "Offsets": {
450 | "Left": 10.0,
451 | "Right": 130.0,
452 | "Top": 10.0,
453 | "Bottom": 18.0
454 | },
455 | "Scale": {
456 | "X": 1.0,
457 | "Y": 1.0
458 | },
459 | "Pivot": {
460 | "X": 0.5,
461 | "Y": 0.5
462 | },
463 | "Shear": {
464 | "X": 0.0,
465 | "Y": 0.0
466 | },
467 | "Rotation": 0.0,
468 | "BackgroundColor": {
469 | "R": 0.2,
470 | "G": 0.2,
471 | "B": 0.215686277,
472 | "A": 1.0
473 | },
474 | "Enabled": true,
475 | "Visible": true
476 | }
477 | },
478 | {
479 | "ID": "2f0db94e40b9cdb7737744b9b7e7a6ef",
480 | "TypeName": "FlaxEngine.UIControl",
481 | "ParentID": "b70a775f4a408cfd505d57859670407d",
482 | "Name": "Address",
483 | "Transform": {
484 | "Translation": {
485 | "X": 10.0,
486 | "Y": 33.0,
487 | "Z": 0.0
488 | }
489 | },
490 | "Control": "FlaxEngine.GUI.TextBox",
491 | "Data": {
492 | "WatermarkText": "Address",
493 | "Wrapping": 0,
494 | "Font": {
495 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
496 | "Size": 9
497 | },
498 | "TextColor": {
499 | "R": 1.0,
500 | "G": 1.0,
501 | "B": 1.0,
502 | "A": 1.0
503 | },
504 | "WatermarkTextColor": {
505 | "R": 0.470588237,
506 | "G": 0.470588237,
507 | "B": 0.5137255,
508 | "A": 1.0
509 | },
510 | "SelectionColor": {
511 | "R": 0.0,
512 | "G": 0.478431374,
513 | "B": 0.8,
514 | "A": 1.0
515 | },
516 | "IsMultiline": false,
517 | "MaxLength": 2147483646,
518 | "IsReadOnly": false,
519 | "BackgroundSelectedColor": {
520 | "R": 0.247058824,
521 | "G": 0.247058824,
522 | "B": 0.274509817,
523 | "A": 1.0
524 | },
525 | "CaretColor": {
526 | "R": 1.0,
527 | "G": 1.0,
528 | "B": 1.0,
529 | "A": 1.0
530 | },
531 | "CaretFlashSpeed": 6.0,
532 | "BackgroundSelectedFlashSpeed": 6.0,
533 | "BorderColor": {
534 | "R": 0.0,
535 | "G": 0.0,
536 | "B": 0.0,
537 | "A": 0.0
538 | },
539 | "BorderSelectedColor": {
540 | "R": 0.0,
541 | "G": 0.478431374,
542 | "B": 0.8,
543 | "A": 1.0
544 | },
545 | "Text": "127.0.0.1",
546 | "SelectionRange": {
547 | "StartIndex": -1,
548 | "EndIndex": -1
549 | },
550 | "ClipChildren": true,
551 | "CullChildren": true,
552 | "AnchorMin": {
553 | "X": 0.0,
554 | "Y": 0.0
555 | },
556 | "AnchorMax": {
557 | "X": 0.0,
558 | "Y": 0.0
559 | },
560 | "Offsets": {
561 | "Left": 10.0,
562 | "Right": 130.0,
563 | "Top": 33.0,
564 | "Bottom": 18.0
565 | },
566 | "Scale": {
567 | "X": 1.0,
568 | "Y": 1.0
569 | },
570 | "Pivot": {
571 | "X": 0.5,
572 | "Y": 0.5
573 | },
574 | "Shear": {
575 | "X": 0.0,
576 | "Y": 0.0
577 | },
578 | "Rotation": 0.0,
579 | "BackgroundColor": {
580 | "R": 0.2,
581 | "G": 0.2,
582 | "B": 0.215686277,
583 | "A": 1.0
584 | },
585 | "Enabled": true,
586 | "Visible": true
587 | }
588 | },
589 | {
590 | "ID": "fb5af0154a3f82191d2a5589eb539540",
591 | "TypeName": "FlaxEngine.UIControl",
592 | "ParentID": "b70a775f4a408cfd505d57859670407d",
593 | "Name": "Port",
594 | "Transform": {
595 | "Translation": {
596 | "X": 10.0,
597 | "Y": 56.0,
598 | "Z": 0.0
599 | }
600 | },
601 | "Control": "FlaxEngine.GUI.TextBox",
602 | "Data": {
603 | "WatermarkText": "Port",
604 | "Wrapping": 0,
605 | "Font": {
606 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
607 | "Size": 9
608 | },
609 | "TextColor": {
610 | "R": 1.0,
611 | "G": 1.0,
612 | "B": 1.0,
613 | "A": 1.0
614 | },
615 | "WatermarkTextColor": {
616 | "R": 0.470588237,
617 | "G": 0.470588237,
618 | "B": 0.5137255,
619 | "A": 1.0
620 | },
621 | "SelectionColor": {
622 | "R": 0.0,
623 | "G": 0.478431374,
624 | "B": 0.8,
625 | "A": 1.0
626 | },
627 | "IsMultiline": false,
628 | "MaxLength": 2147483646,
629 | "IsReadOnly": false,
630 | "BackgroundSelectedColor": {
631 | "R": 0.247058824,
632 | "G": 0.247058824,
633 | "B": 0.274509817,
634 | "A": 1.0
635 | },
636 | "CaretColor": {
637 | "R": 1.0,
638 | "G": 1.0,
639 | "B": 1.0,
640 | "A": 1.0
641 | },
642 | "CaretFlashSpeed": 6.0,
643 | "BackgroundSelectedFlashSpeed": 6.0,
644 | "BorderColor": {
645 | "R": 0.0,
646 | "G": 0.0,
647 | "B": 0.0,
648 | "A": 0.0
649 | },
650 | "BorderSelectedColor": {
651 | "R": 0.0,
652 | "G": 0.478431374,
653 | "B": 0.8,
654 | "A": 1.0
655 | },
656 | "Text": "7767",
657 | "SelectionRange": {
658 | "StartIndex": -1,
659 | "EndIndex": -1
660 | },
661 | "ClipChildren": true,
662 | "CullChildren": true,
663 | "AnchorMin": {
664 | "X": 0.0,
665 | "Y": 0.0
666 | },
667 | "AnchorMax": {
668 | "X": 0.0,
669 | "Y": 0.0
670 | },
671 | "Offsets": {
672 | "Left": 10.0,
673 | "Right": 130.0,
674 | "Top": 56.0,
675 | "Bottom": 18.0
676 | },
677 | "Scale": {
678 | "X": 1.0,
679 | "Y": 1.0
680 | },
681 | "Pivot": {
682 | "X": 0.5,
683 | "Y": 0.5
684 | },
685 | "Shear": {
686 | "X": 0.0,
687 | "Y": 0.0
688 | },
689 | "Rotation": 0.0,
690 | "BackgroundColor": {
691 | "R": 0.2,
692 | "G": 0.2,
693 | "B": 0.215686277,
694 | "A": 1.0
695 | },
696 | "Enabled": true,
697 | "Visible": true
698 | }
699 | },
700 | {
701 | "ID": "d9bba6074d44b4a57a048fb17ffd7896",
702 | "TypeName": "FlaxEngine.UIControl",
703 | "ParentID": "b70a775f4a408cfd505d57859670407d",
704 | "Name": "Connect",
705 | "Transform": {
706 | "Translation": {
707 | "X": 10.0,
708 | "Y": 79.0,
709 | "Z": 0.0
710 | }
711 | },
712 | "Control": "FlaxEngine.GUI.Button",
713 | "Data": {
714 | "TextColor": {
715 | "R": 1.0,
716 | "G": 1.0,
717 | "B": 1.0,
718 | "A": 1.0
719 | },
720 | "Text": "Connect",
721 | "Font": {
722 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
723 | "Size": 9
724 | },
725 | "BorderColor": {
726 | "R": 0.329411775,
727 | "G": 0.329411775,
728 | "B": 0.360784322,
729 | "A": 1.0
730 | },
731 | "BackgroundColorSelected": {
732 | "R": 0.0,
733 | "G": 0.478431374,
734 | "B": 0.8,
735 | "A": 1.0
736 | },
737 | "BorderColorSelected": {
738 | "R": 0.109803922,
739 | "G": 0.5921569,
740 | "B": 0.917647064,
741 | "A": 1.0
742 | },
743 | "BackgroundColorHighlighted": {
744 | "R": 0.329411775,
745 | "G": 0.329411775,
746 | "B": 0.360784322,
747 | "A": 1.0
748 | },
749 | "BorderColorHighlighted": {
750 | "R": 0.41568628,
751 | "G": 0.41568628,
752 | "B": 0.458823532,
753 | "A": 1.0
754 | },
755 | "ClipChildren": true,
756 | "CullChildren": true,
757 | "AnchorMin": {
758 | "X": 0.0,
759 | "Y": 0.0
760 | },
761 | "AnchorMax": {
762 | "X": 0.0,
763 | "Y": 0.0
764 | },
765 | "Offsets": {
766 | "Left": 10.0,
767 | "Right": 130.0,
768 | "Top": 79.0,
769 | "Bottom": 24.0
770 | },
771 | "Scale": {
772 | "X": 1.0,
773 | "Y": 1.0
774 | },
775 | "Pivot": {
776 | "X": 0.5,
777 | "Y": 0.5
778 | },
779 | "Shear": {
780 | "X": 0.0,
781 | "Y": 0.0
782 | },
783 | "Rotation": 0.0,
784 | "BackgroundColor": {
785 | "R": 0.247058824,
786 | "G": 0.247058824,
787 | "B": 0.274509817,
788 | "A": 1.0
789 | },
790 | "Enabled": true,
791 | "Visible": true
792 | }
793 | },
794 | {
795 | "ID": "b5993fc54b8b6702aef6b6a57143e619",
796 | "TypeName": "FlaxEngine.UIControl",
797 | "ParentID": "b70a775f4a408cfd505d57859670407d",
798 | "Name": "Host",
799 | "Transform": {
800 | "Translation": {
801 | "X": 10.0,
802 | "Y": 108.0,
803 | "Z": 0.0
804 | }
805 | },
806 | "Control": "FlaxEngine.GUI.Button",
807 | "Data": {
808 | "TextColor": {
809 | "R": 1.0,
810 | "G": 1.0,
811 | "B": 1.0,
812 | "A": 1.0
813 | },
814 | "Text": "Host",
815 | "Font": {
816 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
817 | "Size": 9
818 | },
819 | "BorderColor": {
820 | "R": 0.329411775,
821 | "G": 0.329411775,
822 | "B": 0.360784322,
823 | "A": 1.0
824 | },
825 | "BackgroundColorSelected": {
826 | "R": 0.0,
827 | "G": 0.478431374,
828 | "B": 0.8,
829 | "A": 1.0
830 | },
831 | "BorderColorSelected": {
832 | "R": 0.109803922,
833 | "G": 0.5921569,
834 | "B": 0.917647064,
835 | "A": 1.0
836 | },
837 | "BackgroundColorHighlighted": {
838 | "R": 0.329411775,
839 | "G": 0.329411775,
840 | "B": 0.360784322,
841 | "A": 1.0
842 | },
843 | "BorderColorHighlighted": {
844 | "R": 0.41568628,
845 | "G": 0.41568628,
846 | "B": 0.458823532,
847 | "A": 1.0
848 | },
849 | "ClipChildren": true,
850 | "CullChildren": true,
851 | "AnchorMin": {
852 | "X": 0.0,
853 | "Y": 0.0
854 | },
855 | "AnchorMax": {
856 | "X": 0.0,
857 | "Y": 0.0
858 | },
859 | "Offsets": {
860 | "Left": 10.0,
861 | "Right": 130.0,
862 | "Top": 108.0,
863 | "Bottom": 24.0
864 | },
865 | "Scale": {
866 | "X": 1.0,
867 | "Y": 1.0
868 | },
869 | "Pivot": {
870 | "X": 0.5,
871 | "Y": 0.5
872 | },
873 | "Shear": {
874 | "X": 0.0,
875 | "Y": 0.0
876 | },
877 | "Rotation": 0.0,
878 | "BackgroundColor": {
879 | "R": 0.247058824,
880 | "G": 0.247058824,
881 | "B": 0.274509817,
882 | "A": 1.0
883 | },
884 | "Enabled": true,
885 | "Visible": true
886 | }
887 | },
888 | {
889 | "ID": "d636388b416b7800b8099c928ad10cfa",
890 | "TypeName": "FlaxEngine.UIControl",
891 | "ParentID": "89128d9d4c101ec1c8773aa86ea0126a",
892 | "Name": "VerticalPanel",
893 | "Transform": {
894 | "Translation": {
895 | "X": 157.0,
896 | "Y": 2.0,
897 | "Z": 0.0
898 | }
899 | },
900 | "Control": "FlaxEngine.GUI.VerticalPanel",
901 | "Data": {
902 | "Spacing": 2.0,
903 | "Offset": {
904 | "X": 0.0,
905 | "Y": 0.0
906 | },
907 | "AutoSize": true,
908 | "Margin": {
909 | "Left": 2.0,
910 | "Right": 2.0,
911 | "Top": 0.0,
912 | "Bottom": 2.0
913 | },
914 | "ClipChildren": false,
915 | "CullChildren": true,
916 | "AnchorMin": {
917 | "X": 0.0,
918 | "Y": 0.0
919 | },
920 | "AnchorMax": {
921 | "X": 0.0,
922 | "Y": 0.0
923 | },
924 | "Offsets": {
925 | "Left": 157.0,
926 | "Right": 350.0,
927 | "Top": 2.0,
928 | "Bottom": 246.0
929 | },
930 | "Scale": {
931 | "X": 1.0,
932 | "Y": 1.0
933 | },
934 | "Pivot": {
935 | "X": 0.5,
936 | "Y": 0.5
937 | },
938 | "Shear": {
939 | "X": 0.0,
940 | "Y": 0.0
941 | },
942 | "Rotation": 0.0,
943 | "BackgroundColor": {
944 | "R": 0.0,
945 | "G": 0.0,
946 | "B": 0.0,
947 | "A": 0.0
948 | },
949 | "Enabled": true,
950 | "Visible": true
951 | }
952 | },
953 | {
954 | "ID": "5f9ec1ee4aa9e805981b969b7d7aa4e5",
955 | "TypeName": "FlaxEngine.UIControl",
956 | "ParentID": "d636388b416b7800b8099c928ad10cfa",
957 | "Name": "Panel",
958 | "Transform": {
959 | "Translation": {
960 | "X": 2.0,
961 | "Y": 0.0,
962 | "Z": 0.0
963 | }
964 | },
965 | "Control": "FlaxEngine.GUI.Panel",
966 | "Data": {
967 | "ScrollBars": 0,
968 | "AlwaysShowScrollbars": false,
969 | "ScrollMargin": {
970 | "Left": 0.0,
971 | "Right": 0.0,
972 | "Top": 0.0,
973 | "Bottom": 0.0
974 | },
975 | "ClipChildren": true,
976 | "CullChildren": true,
977 | "AnchorMin": {
978 | "X": 0.0,
979 | "Y": 0.0
980 | },
981 | "AnchorMax": {
982 | "X": 0.0,
983 | "Y": 0.0
984 | },
985 | "Offsets": {
986 | "Left": 2.0,
987 | "Right": 346.0,
988 | "Top": 0.0,
989 | "Bottom": 35.0
990 | },
991 | "Scale": {
992 | "X": 1.0,
993 | "Y": 1.0
994 | },
995 | "Pivot": {
996 | "X": 0.5,
997 | "Y": 0.5
998 | },
999 | "Shear": {
1000 | "X": 0.0,
1001 | "Y": 0.0
1002 | },
1003 | "Rotation": 0.0,
1004 | "BackgroundColor": {
1005 | "R": 0.0,
1006 | "G": 0.0,
1007 | "B": 0.0,
1008 | "A": 0.3
1009 | },
1010 | "Enabled": true,
1011 | "Visible": true
1012 | }
1013 | },
1014 | {
1015 | "ID": "d37a926d4c3fbe0c420730b24e181601",
1016 | "TypeName": "FlaxEngine.UIControl",
1017 | "ParentID": "5f9ec1ee4aa9e805981b969b7d7aa4e5",
1018 | "Name": "Label",
1019 | "Transform": {
1020 | "Translation": {
1021 | "X": 98.0,
1022 | "Y": 5.0,
1023 | "Z": 0.0
1024 | }
1025 | },
1026 | "Control": "FlaxEngine.GUI.Label",
1027 | "Data": {
1028 | "Text": "Network Sample\n",
1029 | "TextColor": {
1030 | "R": 1.0,
1031 | "G": 1.0,
1032 | "B": 1.0,
1033 | "A": 1.0
1034 | },
1035 | "TextColorHighlighted": {
1036 | "R": 1.0,
1037 | "G": 1.0,
1038 | "B": 1.0,
1039 | "A": 1.0
1040 | },
1041 | "HorizontalAlignment": 1,
1042 | "VerticalAlignment": 1,
1043 | "Wrapping": 0,
1044 | "Font": {
1045 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
1046 | "Size": 16
1047 | },
1048 | "Margin": {
1049 | "Left": 0.0,
1050 | "Right": 0.0,
1051 | "Top": 0.0,
1052 | "Bottom": 0.0
1053 | },
1054 | "ClipText": false,
1055 | "AutoWidth": true,
1056 | "AutoHeight": true,
1057 | "AutoFitText": false,
1058 | "AutoFitTextRange": {
1059 | "X": 0.1,
1060 | "Y": 100.0
1061 | },
1062 | "ClipChildren": true,
1063 | "CullChildren": true,
1064 | "AnchorMin": {
1065 | "X": 0.5,
1066 | "Y": 0.0
1067 | },
1068 | "AnchorMax": {
1069 | "X": 0.5,
1070 | "Y": 0.0
1071 | },
1072 | "Offsets": {
1073 | "Left": -75.0,
1074 | "Right": 153.0,
1075 | "Top": 5.0,
1076 | "Bottom": 50.0
1077 | },
1078 | "Scale": {
1079 | "X": 1.0,
1080 | "Y": 1.0
1081 | },
1082 | "Pivot": {
1083 | "X": 0.5,
1084 | "Y": 0.5
1085 | },
1086 | "Shear": {
1087 | "X": 0.0,
1088 | "Y": 0.0
1089 | },
1090 | "Rotation": 0.0,
1091 | "BackgroundColor": {
1092 | "R": 0.0,
1093 | "G": 0.0,
1094 | "B": 0.0,
1095 | "A": 0.0
1096 | },
1097 | "Enabled": true,
1098 | "Visible": true
1099 | }
1100 | },
1101 | {
1102 | "ID": "966083b543c39cca29d881bc894a660d",
1103 | "TypeName": "FlaxEngine.UIControl",
1104 | "ParentID": "d636388b416b7800b8099c928ad10cfa",
1105 | "Name": "Panel 0",
1106 | "Transform": {
1107 | "Translation": {
1108 | "X": 2.0,
1109 | "Y": 37.0,
1110 | "Z": 0.0
1111 | }
1112 | },
1113 | "Control": "FlaxEngine.GUI.Panel",
1114 | "Data": {
1115 | "ScrollBars": 0,
1116 | "AlwaysShowScrollbars": false,
1117 | "ScrollMargin": {
1118 | "Left": 0.0,
1119 | "Right": 0.0,
1120 | "Top": 0.0,
1121 | "Bottom": 0.0
1122 | },
1123 | "ClipChildren": true,
1124 | "CullChildren": true,
1125 | "AnchorMin": {
1126 | "X": 0.0,
1127 | "Y": 0.0
1128 | },
1129 | "AnchorMax": {
1130 | "X": 0.0,
1131 | "Y": 0.0
1132 | },
1133 | "Offsets": {
1134 | "Left": 2.0,
1135 | "Right": 346.0,
1136 | "Top": 37.0,
1137 | "Bottom": 130.0
1138 | },
1139 | "Scale": {
1140 | "X": 1.0,
1141 | "Y": 1.0
1142 | },
1143 | "Pivot": {
1144 | "X": 0.5,
1145 | "Y": 0.5
1146 | },
1147 | "Shear": {
1148 | "X": 0.0,
1149 | "Y": 0.0
1150 | },
1151 | "Rotation": 0.0,
1152 | "BackgroundColor": {
1153 | "R": 0.0,
1154 | "G": 0.0,
1155 | "B": 0.0,
1156 | "A": 0.3
1157 | },
1158 | "Enabled": true,
1159 | "Visible": true
1160 | }
1161 | },
1162 | {
1163 | "ID": "e278bff7483589e8fea7708068aee241",
1164 | "TypeName": "FlaxEngine.UIControl",
1165 | "ParentID": "966083b543c39cca29d881bc894a660d",
1166 | "Name": "Label",
1167 | "Control": "FlaxEngine.GUI.Label",
1168 | "Data": {
1169 | "Text": "This project shows how to use the low level networking api, we use a client / server model. States like players transforms, messages and players list are synced.\n\nThis is a very simple implementation of a multiplayer game.\n\n",
1170 | "TextColor": {
1171 | "R": 1.0,
1172 | "G": 1.0,
1173 | "B": 1.0,
1174 | "A": 1.0
1175 | },
1176 | "TextColorHighlighted": {
1177 | "R": 1.0,
1178 | "G": 1.0,
1179 | "B": 1.0,
1180 | "A": 1.0
1181 | },
1182 | "HorizontalAlignment": 1,
1183 | "VerticalAlignment": 0,
1184 | "Wrapping": 1,
1185 | "Font": {
1186 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
1187 | "Size": 11
1188 | },
1189 | "Margin": {
1190 | "Left": 5.0,
1191 | "Right": 5.0,
1192 | "Top": 5.0,
1193 | "Bottom": 5.0
1194 | },
1195 | "ClipText": false,
1196 | "AutoWidth": false,
1197 | "AutoHeight": false,
1198 | "AutoFitText": false,
1199 | "AutoFitTextRange": {
1200 | "X": 0.1,
1201 | "Y": 100.0
1202 | },
1203 | "ClipChildren": true,
1204 | "CullChildren": true,
1205 | "AnchorMin": {
1206 | "X": 0.0,
1207 | "Y": 0.0
1208 | },
1209 | "AnchorMax": {
1210 | "X": 0.0,
1211 | "Y": 0.0
1212 | },
1213 | "Offsets": {
1214 | "Left": 0.0,
1215 | "Right": 346.0,
1216 | "Top": 0.0,
1217 | "Bottom": 120.0
1218 | },
1219 | "Scale": {
1220 | "X": 1.0,
1221 | "Y": 1.0
1222 | },
1223 | "Pivot": {
1224 | "X": 0.5,
1225 | "Y": 0.5
1226 | },
1227 | "Shear": {
1228 | "X": 0.0,
1229 | "Y": 0.0
1230 | },
1231 | "Rotation": 0.0,
1232 | "BackgroundColor": {
1233 | "R": 0.0,
1234 | "G": 0.0,
1235 | "B": 0.0,
1236 | "A": 0.0
1237 | },
1238 | "Enabled": true,
1239 | "Visible": true
1240 | }
1241 | },
1242 | {
1243 | "ID": "782768dc48e160a14cd853b2121a9a93",
1244 | "TypeName": "FlaxEngine.UIControl",
1245 | "ParentID": "d636388b416b7800b8099c928ad10cfa",
1246 | "Name": "VerticalPanel 0",
1247 | "Transform": {
1248 | "Translation": {
1249 | "X": 2.0,
1250 | "Y": 169.0,
1251 | "Z": 0.0
1252 | }
1253 | },
1254 | "Control": "FlaxEngine.GUI.VerticalPanel",
1255 | "Data": {
1256 | "Spacing": 0.0,
1257 | "Offset": {
1258 | "X": 0.0,
1259 | "Y": 0.0
1260 | },
1261 | "AutoSize": true,
1262 | "Margin": {
1263 | "Left": 10.0,
1264 | "Right": 2.0,
1265 | "Top": 2.0,
1266 | "Bottom": 2.0
1267 | },
1268 | "ClipChildren": true,
1269 | "CullChildren": true,
1270 | "AnchorMin": {
1271 | "X": 0.0,
1272 | "Y": 0.0
1273 | },
1274 | "AnchorMax": {
1275 | "X": 0.0,
1276 | "Y": 0.0
1277 | },
1278 | "Offsets": {
1279 | "Left": 2.0,
1280 | "Right": 346.0,
1281 | "Top": 169.0,
1282 | "Bottom": 64.0
1283 | },
1284 | "Scale": {
1285 | "X": 1.0,
1286 | "Y": 1.0
1287 | },
1288 | "Pivot": {
1289 | "X": 0.5,
1290 | "Y": 0.5
1291 | },
1292 | "Shear": {
1293 | "X": 0.0,
1294 | "Y": 0.0
1295 | },
1296 | "Rotation": 0.0,
1297 | "BackgroundColor": {
1298 | "R": 0.0,
1299 | "G": 0.0,
1300 | "B": 0.0,
1301 | "A": 0.3
1302 | },
1303 | "Enabled": true,
1304 | "Visible": true
1305 | }
1306 | },
1307 | {
1308 | "ID": "307b16cc42ef8d6d0239cf901033ffcd",
1309 | "TypeName": "FlaxEngine.UIControl",
1310 | "ParentID": "782768dc48e160a14cd853b2121a9a93",
1311 | "Name": "Label",
1312 | "Transform": {
1313 | "Translation": {
1314 | "X": 10.0,
1315 | "Y": 2.0,
1316 | "Z": 0.0
1317 | }
1318 | },
1319 | "Control": "FlaxEngine.GUI.Label",
1320 | "Data": {
1321 | "Text": "- Use WSAD for moving.",
1322 | "TextColor": {
1323 | "R": 1.0,
1324 | "G": 1.0,
1325 | "B": 1.0,
1326 | "A": 1.0
1327 | },
1328 | "TextColorHighlighted": {
1329 | "R": 1.0,
1330 | "G": 1.0,
1331 | "B": 1.0,
1332 | "A": 1.0
1333 | },
1334 | "HorizontalAlignment": 0,
1335 | "VerticalAlignment": 1,
1336 | "Wrapping": 0,
1337 | "Font": {
1338 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
1339 | "Size": 10
1340 | },
1341 | "Margin": {
1342 | "Left": 0.0,
1343 | "Right": 0.0,
1344 | "Top": 0.0,
1345 | "Bottom": 0.0
1346 | },
1347 | "ClipText": false,
1348 | "AutoWidth": false,
1349 | "AutoHeight": false,
1350 | "AutoFitText": false,
1351 | "AutoFitTextRange": {
1352 | "X": 0.1,
1353 | "Y": 100.0
1354 | },
1355 | "ClipChildren": true,
1356 | "CullChildren": true,
1357 | "AnchorMin": {
1358 | "X": 0.0,
1359 | "Y": 0.0
1360 | },
1361 | "AnchorMax": {
1362 | "X": 0.0,
1363 | "Y": 0.0
1364 | },
1365 | "Offsets": {
1366 | "Left": 10.0,
1367 | "Right": 334.0,
1368 | "Top": 2.0,
1369 | "Bottom": 20.0
1370 | },
1371 | "Scale": {
1372 | "X": 1.0,
1373 | "Y": 1.0
1374 | },
1375 | "Pivot": {
1376 | "X": 0.5,
1377 | "Y": 0.5
1378 | },
1379 | "Shear": {
1380 | "X": 0.0,
1381 | "Y": 0.0
1382 | },
1383 | "Rotation": 0.0,
1384 | "BackgroundColor": {
1385 | "R": 0.0,
1386 | "G": 0.0,
1387 | "B": 0.0,
1388 | "A": 0.0
1389 | },
1390 | "Enabled": true,
1391 | "Visible": true
1392 | }
1393 | },
1394 | {
1395 | "ID": "56f8b9444fc643ba54fb3abaf4bf446e",
1396 | "TypeName": "FlaxEngine.UIControl",
1397 | "ParentID": "782768dc48e160a14cd853b2121a9a93",
1398 | "Name": "Label 0",
1399 | "Transform": {
1400 | "Translation": {
1401 | "X": 10.0,
1402 | "Y": 22.0,
1403 | "Z": 1.3073986337985843e-12
1404 | }
1405 | },
1406 | "Control": "FlaxEngine.GUI.Label",
1407 | "Data": {
1408 | "Text": "- Press ENTER to open the chat.",
1409 | "TextColor": {
1410 | "R": 1.0,
1411 | "G": 1.0,
1412 | "B": 1.0,
1413 | "A": 1.0
1414 | },
1415 | "TextColorHighlighted": {
1416 | "R": 1.0,
1417 | "G": 1.0,
1418 | "B": 1.0,
1419 | "A": 1.0
1420 | },
1421 | "HorizontalAlignment": 0,
1422 | "VerticalAlignment": 1,
1423 | "Wrapping": 0,
1424 | "Font": {
1425 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
1426 | "Size": 10
1427 | },
1428 | "Margin": {
1429 | "Left": 0.0,
1430 | "Right": 0.0,
1431 | "Top": 0.0,
1432 | "Bottom": 0.0
1433 | },
1434 | "ClipText": false,
1435 | "AutoWidth": false,
1436 | "AutoHeight": false,
1437 | "AutoFitText": false,
1438 | "AutoFitTextRange": {
1439 | "X": 0.1,
1440 | "Y": 100.0
1441 | },
1442 | "ClipChildren": true,
1443 | "CullChildren": true,
1444 | "AnchorMin": {
1445 | "X": 0.0,
1446 | "Y": 0.0
1447 | },
1448 | "AnchorMax": {
1449 | "X": 0.0,
1450 | "Y": 0.0
1451 | },
1452 | "Offsets": {
1453 | "Left": 10.0,
1454 | "Right": 334.0,
1455 | "Top": 22.0,
1456 | "Bottom": 20.0
1457 | },
1458 | "Scale": {
1459 | "X": 1.0,
1460 | "Y": 1.0
1461 | },
1462 | "Pivot": {
1463 | "X": 0.5,
1464 | "Y": 0.5
1465 | },
1466 | "Shear": {
1467 | "X": 0.0,
1468 | "Y": 0.0
1469 | },
1470 | "Rotation": 0.0,
1471 | "BackgroundColor": {
1472 | "R": 0.0,
1473 | "G": 0.0,
1474 | "B": 0.0,
1475 | "A": 0.0
1476 | },
1477 | "Enabled": true,
1478 | "Visible": true
1479 | }
1480 | },
1481 | {
1482 | "ID": "d0e8d3ae46b13ccf7f1be0837203326e",
1483 | "TypeName": "FlaxEngine.UIControl",
1484 | "ParentID": "782768dc48e160a14cd853b2121a9a93",
1485 | "Name": "Label 1",
1486 | "Transform": {
1487 | "Translation": {
1488 | "X": 10.0,
1489 | "Y": 42.0,
1490 | "Z": 1.3073986337985843e-12
1491 | }
1492 | },
1493 | "Control": "FlaxEngine.GUI.Label",
1494 | "Data": {
1495 | "Text": "- Hold TAB to see players list.",
1496 | "TextColor": {
1497 | "R": 1.0,
1498 | "G": 1.0,
1499 | "B": 1.0,
1500 | "A": 1.0
1501 | },
1502 | "TextColorHighlighted": {
1503 | "R": 1.0,
1504 | "G": 1.0,
1505 | "B": 1.0,
1506 | "A": 1.0
1507 | },
1508 | "HorizontalAlignment": 0,
1509 | "VerticalAlignment": 1,
1510 | "Wrapping": 0,
1511 | "Font": {
1512 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
1513 | "Size": 10
1514 | },
1515 | "Margin": {
1516 | "Left": 0.0,
1517 | "Right": 0.0,
1518 | "Top": 0.0,
1519 | "Bottom": 0.0
1520 | },
1521 | "ClipText": false,
1522 | "AutoWidth": false,
1523 | "AutoHeight": false,
1524 | "AutoFitText": false,
1525 | "AutoFitTextRange": {
1526 | "X": 0.1,
1527 | "Y": 100.0
1528 | },
1529 | "ClipChildren": true,
1530 | "CullChildren": true,
1531 | "AnchorMin": {
1532 | "X": 0.0,
1533 | "Y": 0.0
1534 | },
1535 | "AnchorMax": {
1536 | "X": 0.0,
1537 | "Y": 0.0
1538 | },
1539 | "Offsets": {
1540 | "Left": 10.0,
1541 | "Right": 334.0,
1542 | "Top": 42.0,
1543 | "Bottom": 20.0
1544 | },
1545 | "Scale": {
1546 | "X": 1.0,
1547 | "Y": 1.0
1548 | },
1549 | "Pivot": {
1550 | "X": 0.5,
1551 | "Y": 0.5
1552 | },
1553 | "Shear": {
1554 | "X": 0.0,
1555 | "Y": 0.0
1556 | },
1557 | "Rotation": 0.0,
1558 | "BackgroundColor": {
1559 | "R": 0.0,
1560 | "G": 0.0,
1561 | "B": 0.0,
1562 | "A": 0.0
1563 | },
1564 | "Enabled": true,
1565 | "Visible": true
1566 | }
1567 | }
1568 | ]
1569 | }
--------------------------------------------------------------------------------
/Content/Players/PFB_LocalPlayer.prefab:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "3c0da8cf4469a986341366b3d951e4ce",
3 | "TypeName": "FlaxEngine.Prefab",
4 | "EngineBuild": 6221,
5 | "Data": [
6 | {
7 | "ID": "1440aef34913715de95133a71d610652",
8 | "TypeName": "FlaxEngine.CharacterController",
9 | "Name": "CharacterController",
10 | "Height": 110.0
11 | },
12 | {
13 | "ID": "9e98ab71443952414432c1bd6affcdd5",
14 | "TypeName": "LocalPlayerScript",
15 | "ParentID": "1440aef34913715de95133a71d610652",
16 | "V": {
17 | "PlayerController": "1440aef34913715de95133a71d610652",
18 | "Camera": "8b0603c44c52faa46629598d36559644"
19 | }
20 | },
21 | {
22 | "ID": "8b0603c44c52faa46629598d36559644",
23 | "TypeName": "FlaxEngine.Camera",
24 | "ParentID": "1440aef34913715de95133a71d610652",
25 | "Name": "Camera",
26 | "Transform": {
27 | "Translation": {
28 | "X": 0.0,
29 | "Y": 69.61174011230469,
30 | "Z": 0.0
31 | }
32 | }
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/Content/Players/PFB_NetworkPlayer.prefab:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "fa0ddf034c718af8fbf893836d3c7283",
3 | "TypeName": "FlaxEngine.Prefab",
4 | "EngineBuild": 6221,
5 | "Data": [
6 | {
7 | "ID": "1440aef34913715de95133a71d610652",
8 | "TypeName": "FlaxEngine.CharacterController",
9 | "Name": "CharacterController",
10 | "Height": 110.0
11 | },
12 | {
13 | "ID": "80e8f9d44a4b5ff5e11d38970337a946",
14 | "TypeName": "Game.NetworkPlayerScript",
15 | "ParentID": "1440aef34913715de95133a71d610652",
16 | "V": {}
17 | },
18 | {
19 | "ID": "f2ee4e5444c586d8798d9a99b2ebddcf",
20 | "TypeName": "FlaxEngine.UICanvas",
21 | "ParentID": "1440aef34913715de95133a71d610652",
22 | "Name": "UICanvas",
23 | "Transform": {
24 | "Translation": {
25 | "X": 0.0,
26 | "Y": 145.6456756591797,
27 | "Z": 0.0
28 | },
29 | "Orientation": {
30 | "X": 1.0,
31 | "Y": 4.371138828673793e-8,
32 | "Z": 4.371138828673793e-8,
33 | "W": 1.910685465164705e-15
34 | }
35 | },
36 | "V": {
37 | "RenderMode": 3,
38 | "IgnoreDepth": true,
39 | "Size": {
40 | "X": 500.0,
41 | "Y": 500.0
42 | }
43 | }
44 | },
45 | {
46 | "ID": "794700cf4093df3b63f164b55f4b3019",
47 | "TypeName": "FlaxEngine.UIControl",
48 | "ParentID": "f2ee4e5444c586d8798d9a99b2ebddcf",
49 | "Name": "Username",
50 | "Transform": {
51 | "Translation": {
52 | "X": 250.0,
53 | "Y": 250.0,
54 | "Z": 0.0
55 | },
56 | "Orientation": {
57 | "X": 1.0,
58 | "Y": 4.371138828673793e-8,
59 | "Z": 4.371138828673793e-8,
60 | "W": 1.910685465164705e-15
61 | }
62 | },
63 | "Control": "FlaxEngine.GUI.Label",
64 | "Data": {
65 | "Text": "Username",
66 | "TextColor": {
67 | "R": 1.0,
68 | "G": 1.0,
69 | "B": 1.0,
70 | "A": 1.0
71 | },
72 | "TextColorHighlighted": {
73 | "R": 1.0,
74 | "G": 1.0,
75 | "B": 1.0,
76 | "A": 1.0
77 | },
78 | "HorizontalAlignment": 1,
79 | "VerticalAlignment": 1,
80 | "Wrapping": 0,
81 | "Font": {
82 | "Font": "4508d98f4aa1f0bd59362b81d47e38f4",
83 | "Size": 20
84 | },
85 | "Margin": {
86 | "Left": 0.0,
87 | "Right": 0.0,
88 | "Top": 0.0,
89 | "Bottom": 0.0
90 | },
91 | "ClipText": false,
92 | "AutoWidth": false,
93 | "AutoHeight": false,
94 | "AutoFitText": false,
95 | "AutoFitTextRange": {
96 | "X": 0.1,
97 | "Y": 100.0
98 | },
99 | "ClipChildren": true,
100 | "CullChildren": true,
101 | "AnchorMin": {
102 | "X": 0.0,
103 | "Y": 0.0
104 | },
105 | "AnchorMax": {
106 | "X": 1.0,
107 | "Y": 1.0
108 | },
109 | "Offsets": {
110 | "Left": 250.0,
111 | "Right": 250.0,
112 | "Top": 250.0,
113 | "Bottom": 250.0
114 | },
115 | "Scale": {
116 | "X": 1.0,
117 | "Y": 1.0
118 | },
119 | "Pivot": {
120 | "X": 0.5,
121 | "Y": 0.5
122 | },
123 | "Shear": {
124 | "X": 0.0,
125 | "Y": 0.0
126 | },
127 | "Rotation": 0.0,
128 | "BackgroundColor": {
129 | "R": 0.00100004673,
130 | "G": 0.00100004673,
131 | "B": 0.00100004673,
132 | "A": 1.0
133 | },
134 | "Enabled": true,
135 | "Visible": true
136 | }
137 | },
138 | {
139 | "ID": "3bf8d8c647a41cdb2822a389498668f0",
140 | "TypeName": "FlaxEngine.EmptyActor",
141 | "ParentID": "1440aef34913715de95133a71d610652",
142 | "Name": "Model",
143 | "Transform": {
144 | "Translation": {
145 | "X": 0.0,
146 | "Y": -27.723974227905275,
147 | "Z": 0.0
148 | }
149 | }
150 | },
151 | {
152 | "ID": "cde40cb848281949794e2183489cb86a",
153 | "TypeName": "FlaxEngine.StaticModel",
154 | "ParentID": "3bf8d8c647a41cdb2822a389498668f0",
155 | "Name": "Head",
156 | "Transform": {
157 | "Translation": {
158 | "X": 0.0,
159 | "Y": 97.930419921875,
160 | "Z": 0.0
161 | },
162 | "Scale": {
163 | "X": 0.44999998807907107,
164 | "Y": 0.44999998807907107,
165 | "Z": 0.44999998807907107
166 | }
167 | },
168 | "Model": "b43f0f8f4aaba3f3156896a5a22ba493",
169 | "Buffer": {
170 | "Entries": [
171 | {
172 | "Material": "28cac01246c37a932ab9e0b92a838cc2",
173 | "ShadowsMode": 3,
174 | "Visible": true,
175 | "ReceiveDecals": true
176 | }
177 | ]
178 | }
179 | },
180 | {
181 | "ID": "506b70924c674c3fd0c31b8de1bec93f",
182 | "TypeName": "FlaxEngine.StaticModel",
183 | "ParentID": "3bf8d8c647a41cdb2822a389498668f0",
184 | "Name": "Body",
185 | "Transform": {
186 | "Translation": {
187 | "X": 0.0,
188 | "Y": 0.7227592468261719,
189 | "Z": 0.0
190 | },
191 | "Scale": {
192 | "X": 0.699999988079071,
193 | "Y": 1.5,
194 | "Z": 0.699999988079071
195 | }
196 | },
197 | "Model": "b43f0f8f4aaba3f3156896a5a22ba493",
198 | "Buffer": {
199 | "Entries": [
200 | {
201 | "Material": "28cac01246c37a932ab9e0b92a838cc2",
202 | "ShadowsMode": 3,
203 | "Visible": true,
204 | "ReceiveDecals": true
205 | }
206 | ]
207 | }
208 | }
209 | ]
210 | }
--------------------------------------------------------------------------------
/Content/SceneData/DemoScene/CSG_Collision.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/DemoScene/CSG_Collision.flax
--------------------------------------------------------------------------------
/Content/SceneData/DemoScene/CSG_Data.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/DemoScene/CSG_Data.flax
--------------------------------------------------------------------------------
/Content/SceneData/DemoScene/CSG_Mesh.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/DemoScene/CSG_Mesh.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/CSG_Collision.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/CSG_Collision.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/CSG_Data.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/CSG_Data.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/CSG_Mesh.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/CSG_Mesh.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/EnvProbes/da5e1c454a56377517d41686ebb0348f.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/EnvProbes/da5e1c454a56377517d41686ebb0348f.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/Lightmaps/Lightmap00-0.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/Lightmaps/Lightmap00-0.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/Lightmaps/Lightmap00-1.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/Lightmaps/Lightmap00-1.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/Lightmaps/Lightmap00-2.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/Lightmaps/Lightmap00-2.flax
--------------------------------------------------------------------------------
/Content/SceneData/Scene/SkyLights/eb18e84d41670d6314174b89a1d5ffea.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/SceneData/Scene/SkyLights/eb18e84d41670d6314174b89a1d5ffea.flax
--------------------------------------------------------------------------------
/Content/Settings/Android Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "9ac06a884463f4ae9435e2b03c866259",
3 | "TypeName": "FlaxEditor.Content.Settings.AndroidPlatformSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "PackageName": "com.${COMPANY_NAME}.${PROJECT_NAME}",
7 | "OverrideIcon": "00000000-0000-0000-0000-000000000000"
8 | }
9 | }
--------------------------------------------------------------------------------
/Content/Settings/Audio Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "fc8ef1bb474956920c5505b7ea7ea9ff",
3 | "TypeName": "FlaxEditor.Content.Settings.AudioSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "DisableAudio": false,
7 | "DopplerFactor": 1.0,
8 | "MuteOnFocusLoss": true
9 | }
10 | }
--------------------------------------------------------------------------------
/Content/Settings/Build Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "2364031e4e327637c1ad88b415fa756e",
3 | "TypeName": "FlaxEditor.Content.Settings.BuildSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "MaxAssetsPerPackage": 4096,
7 | "MaxPackageSizeMB": 1024,
8 | "ContentKey": 0,
9 | "ForDistribution": false,
10 | "SkipPackaging": false,
11 | "AdditionalAssets": [],
12 | "AdditionalAssetFolders": [
13 | "Content"
14 | ],
15 | "ShadersNoOptimize": false,
16 | "ShadersGenerateDebugData": false,
17 | "Presets": [
18 | {
19 | "Name": "Development",
20 | "Targets": [
21 | {
22 | "Name": "Windows 64bit",
23 | "Output": "Output\\Win64",
24 | "Platform": 2,
25 | "Mode": 1
26 | },
27 | {
28 | "Name": "Windows 32bit",
29 | "Output": "Output\\Win32",
30 | "Platform": 1,
31 | "Mode": 1
32 | }
33 | ]
34 | },
35 | {
36 | "Name": "Release",
37 | "Targets": [
38 | {
39 | "Name": "Windows 64bit",
40 | "Output": "Output\\Win64",
41 | "Platform": 2,
42 | "Mode": 0
43 | },
44 | {
45 | "Name": "Windows 32bit",
46 | "Output": "Output\\Win32",
47 | "Platform": 1,
48 | "Mode": 0
49 | },
50 | {
51 | "Name": "Xbox One",
52 | "Output": "Output\\XboxOne",
53 | "Platform": 5,
54 | "Mode": 0
55 | },
56 | {
57 | "Name": "UWP 64bit",
58 | "Output": "Output\\WinStore64",
59 | "Platform": 4,
60 | "Mode": 0
61 | }
62 | ]
63 | }
64 | ]
65 | }
66 | }
--------------------------------------------------------------------------------
/Content/Settings/Graphics Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "4eaf325e4cd72aa4cdeb6393cad05466",
3 | "TypeName": "FlaxEditor.Content.Settings.GraphicsSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "UseVSync": true,
7 | "AAQuality": 1,
8 | "SSRQuality": 1,
9 | "SSAOQuality": 1,
10 | "VolumetricFogQuality": 1,
11 | "ShadowsQuality": 1,
12 | "ShadowMapsQuality": 1,
13 | "AllowCSMBlending": false
14 | }
15 | }
--------------------------------------------------------------------------------
/Content/Settings/Input Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "f4c1c67842f6b745a6976aa8e7eff360",
3 | "TypeName": "FlaxEditor.Content.Settings.InputSettings",
4 | "EngineBuild": 6221,
5 | "Data": {
6 | "ActionMappings": [
7 | {
8 | "Name": "Fire",
9 | "Mode": 1,
10 | "Key": 0,
11 | "MouseButton": 0,
12 | "GamepadButton": 14,
13 | "Gamepad": 0
14 | },
15 | {
16 | "Name": "Jump",
17 | "Mode": 1,
18 | "Key": 32,
19 | "MouseButton": 0,
20 | "GamepadButton": 0,
21 | "Gamepad": 0
22 | }
23 | ],
24 | "AxisMappings": [
25 | {
26 | "Name": "Mouse X",
27 | "Axis": 0,
28 | "Gamepad": 0,
29 | "PositiveButton": 0,
30 | "NegativeButton": 0,
31 | "DeadZone": 0.1,
32 | "Sensitivity": 0.4,
33 | "Gravity": 1.0,
34 | "Scale": 1.0,
35 | "Snap": false
36 | },
37 | {
38 | "Name": "Mouse Y",
39 | "Axis": 1,
40 | "Gamepad": 0,
41 | "PositiveButton": 0,
42 | "NegativeButton": 0,
43 | "DeadZone": 0.1,
44 | "Sensitivity": 0.4,
45 | "Gravity": 1.0,
46 | "Scale": 1.0,
47 | "Snap": false
48 | },
49 | {
50 | "Name": "Horizontal",
51 | "Axis": 9,
52 | "Gamepad": 0,
53 | "PositiveButton": 68,
54 | "NegativeButton": 65,
55 | "DeadZone": 0.01,
56 | "Sensitivity": 5.0,
57 | "Gravity": 5.0,
58 | "Scale": 1.0,
59 | "Snap": true
60 | },
61 | {
62 | "Name": "Vertical",
63 | "Axis": 9,
64 | "Gamepad": 0,
65 | "PositiveButton": 87,
66 | "NegativeButton": 83,
67 | "DeadZone": 0.01,
68 | "Sensitivity": 5.0,
69 | "Gravity": 5.0,
70 | "Scale": 1.0,
71 | "Snap": true
72 | },
73 | {
74 | "Name": "Horizontal",
75 | "Axis": 9,
76 | "Gamepad": 0,
77 | "PositiveButton": 39,
78 | "NegativeButton": 37,
79 | "DeadZone": 0.01,
80 | "Sensitivity": 5.0,
81 | "Gravity": 5.0,
82 | "Scale": 1.0,
83 | "Snap": true
84 | },
85 | {
86 | "Name": "Vertical",
87 | "Axis": 9,
88 | "Gamepad": 0,
89 | "PositiveButton": 38,
90 | "NegativeButton": 40,
91 | "DeadZone": 0.001,
92 | "Sensitivity": 5.0,
93 | "Gravity": 5.0,
94 | "Scale": 1.0,
95 | "Snap": true
96 | },
97 | {
98 | "Name": "Horizontal",
99 | "Axis": 3,
100 | "Gamepad": 0,
101 | "PositiveButton": 0,
102 | "NegativeButton": 0,
103 | "DeadZone": 0.19,
104 | "Sensitivity": 1.0,
105 | "Gravity": 1.0,
106 | "Scale": 1.0,
107 | "Snap": false
108 | },
109 | {
110 | "Name": "Vertical",
111 | "Axis": 4,
112 | "Gamepad": 0,
113 | "PositiveButton": 0,
114 | "NegativeButton": 0,
115 | "DeadZone": 0.19,
116 | "Sensitivity": 1.0,
117 | "Gravity": 1.0,
118 | "Scale": 1.0,
119 | "Snap": false
120 | },
121 | {
122 | "Name": "Mouse X",
123 | "Axis": 5,
124 | "Gamepad": 0,
125 | "PositiveButton": 0,
126 | "NegativeButton": 0,
127 | "DeadZone": 0.19,
128 | "Sensitivity": 1.0,
129 | "Gravity": 1.0,
130 | "Scale": 4.0,
131 | "Snap": false
132 | },
133 | {
134 | "Name": "Mouse Y",
135 | "Axis": 6,
136 | "Gamepad": 0,
137 | "PositiveButton": 0,
138 | "NegativeButton": 0,
139 | "DeadZone": 0.19,
140 | "Sensitivity": 1.0,
141 | "Gravity": 1.0,
142 | "Scale": -4.0,
143 | "Snap": false
144 | }
145 | ]
146 | }
147 | }
--------------------------------------------------------------------------------
/Content/Settings/Layers And Tags Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "bb6fbecf458db0ecffa5e2a5155b2b4f",
3 | "TypeName": "FlaxEditor.Content.Settings.LayersAndTagsSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "Tags": [
7 | "Player",
8 | "Bullet"
9 | ],
10 | "Layers": [
11 | "Default",
12 | "Player",
13 | "Bullets",
14 | null,
15 | null,
16 | null,
17 | null,
18 | null,
19 | null,
20 | null,
21 | null,
22 | null,
23 | null,
24 | null,
25 | null,
26 | null,
27 | null,
28 | null,
29 | null,
30 | null,
31 | null,
32 | null,
33 | null,
34 | null,
35 | null,
36 | null,
37 | null,
38 | null,
39 | null,
40 | null,
41 | null,
42 | null
43 | ]
44 | }
45 | }
--------------------------------------------------------------------------------
/Content/Settings/Linux Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "1bf4eedd41508974d6646e8faa55420a",
3 | "TypeName": "FlaxEditor.Content.Settings.LinuxPlatformSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "WindowMode": 0,
7 | "ScreenWidth": 1280,
8 | "ScreenHeight": 720,
9 | "ResizableWindow": false,
10 | "RunInBackground": true,
11 | "ForceSingleInstance": false,
12 | "OverrideIcon": "00000000-0000-0000-0000-000000000000",
13 | "SupportVulkan": true
14 | }
15 | }
--------------------------------------------------------------------------------
/Content/Settings/Localization Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "7ce4a8c64c8116aefe23b184adcabcfb",
3 | "TypeName": "FlaxEditor.Content.Settings.LocalizationSettings",
4 | "EngineBuild": 6222,
5 | "Data": {}
6 | }
--------------------------------------------------------------------------------
/Content/Settings/Navigation Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "9d5e29604efb16eff6b815aa4a110227",
3 | "TypeName": "FlaxEditor.Content.Settings.NavigationSettings",
4 | "EngineBuild": 6704,
5 | "Data": {
6 | "AutoAddMissingNavMeshes": true,
7 | "AutoRemoveMissingNavMeshes": true,
8 | "CellHeight": 10.0,
9 | "CellSize": 30.0,
10 | "TileSize": 64,
11 | "MinRegionArea": 0,
12 | "MergeRegionArea": 20,
13 | "MaxEdgeLen": 1200.0,
14 | "MaxEdgeError": 1.2999999523162842,
15 | "DetailSamplingDist": 600.0,
16 | "MaxDetailSamplingError": 1.0,
17 | "NavMeshes": [
18 | {
19 | "Name": "Default",
20 | "Color": {
21 | "R": 0.0,
22 | "G": 0.501960813999176,
23 | "B": 0.0,
24 | "A": 1.0
25 | },
26 | "Rotation": {
27 | "X": 0.0,
28 | "Y": 0.0,
29 | "Z": 0.0,
30 | "W": 1.0
31 | },
32 | "Agent": {
33 | "Radius": 34.0,
34 | "Height": 144.0,
35 | "StepHeight": 35.0,
36 | "MaxSlopeAngle": 60.0,
37 | "MaxSpeed": 500.0,
38 | "CrowdSeparationWeight": 2.0
39 | },
40 | "DefaultQueryExtent": {
41 | "X": 50.0,
42 | "Y": 250.0,
43 | "Z": 50.0
44 | }
45 | }
46 | ],
47 | "NavAreas": [
48 | {
49 | "Name": "Null",
50 | "Color": {
51 | "R": 0.0,
52 | "G": 0.0,
53 | "B": 0.0,
54 | "A": 0.0
55 | },
56 | "Id": 0,
57 | "Cost": 3.4028234663852886e38
58 | },
59 | {
60 | "Name": "Walkable",
61 | "Color": {
62 | "R": 0.0,
63 | "G": 0.0,
64 | "B": 0.0,
65 | "A": 0.0
66 | },
67 | "Id": 63,
68 | "Cost": 1.0
69 | }
70 | ]
71 | }
72 | }
--------------------------------------------------------------------------------
/Content/Settings/Network Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "f168fe7a43c90e4f82676b86d8cb027a",
3 | "TypeName": "FlaxEditor.Content.Settings.NetworkSettings",
4 | "EngineBuild": 6337,
5 | "Data": {
6 | "MaxClients": 100,
7 | "ProtocolVersion": 1,
8 | "NetworkFPS": 60.0,
9 | "Address": "127.0.0.1",
10 | "Port": 7777,
11 | "NetworkDriver": "FlaxEngine.Networking.ENetDriver"
12 | }
13 | }
--------------------------------------------------------------------------------
/Content/Settings/Physics Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "7871f0364d398555ccd9e297acdc8983",
3 | "TypeName": "FlaxEditor.Content.Settings.PhysicsSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "DefaultGravity": {
7 | "X": 0.0,
8 | "Y": -981.0,
9 | "Z": 0.0
10 | },
11 | "QueriesHitTriggers": true,
12 | "TriangleMeshTriangleMinAreaThreshold": 5.0,
13 | "BounceThresholdVelocity": 200.0,
14 | "FrictionCombineMode": 0,
15 | "RestitutionCombineMode": 0,
16 | "DisableCCD": false,
17 | "EnableAdaptiveForce": false,
18 | "MaxDeltaTime": 0.1,
19 | "EnableSubstepping": false,
20 | "SubstepDeltaTime": 0.008333334,
21 | "MaxSubsteps": 5,
22 | "SupportCookingAtRuntime": false,
23 | "LayerMasks": [
24 | 4294967295,
25 | 4294967295,
26 | 4294967295,
27 | 4294967295,
28 | 4294967295,
29 | 4294967295,
30 | 4294967295,
31 | 4294967295,
32 | 4294967295,
33 | 4294967295,
34 | 4294967295,
35 | 4294967295,
36 | 4294967295,
37 | 4294967295,
38 | 4294967295,
39 | 4294967295,
40 | 4294967295,
41 | 4294967295,
42 | 4294967295,
43 | 4294967295,
44 | 4294967295,
45 | 4294967295,
46 | 4294967295,
47 | 4294967295,
48 | 4294967295,
49 | 4294967295,
50 | 4294967295,
51 | 4294967295,
52 | 4294967295,
53 | 4294967295,
54 | 4294967295,
55 | 4294967295
56 | ]
57 | }
58 | }
--------------------------------------------------------------------------------
/Content/Settings/Streaming Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "46f7ca204355d836ff4bf4aa43d211ac",
3 | "TypeName": "FlaxEditor.Content.Settings.StreamingSettings",
4 | "EngineBuild": 6222,
5 | "Data": {}
6 | }
--------------------------------------------------------------------------------
/Content/Settings/Time Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "9acd18b0496064d35799f390d3a2b374",
3 | "TypeName": "FlaxEditor.Content.Settings.TimeSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "UpdateFPS": 60.0,
7 | "PhysicsFPS": 60.0,
8 | "DrawFPS": 60.0,
9 | "TimeScale": 1.0,
10 | "MaxUpdateDeltaTime": 0.1
11 | }
12 | }
--------------------------------------------------------------------------------
/Content/Settings/UWP Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "8660bbf44f1ea61cb9bc4580b3631973",
3 | "TypeName": "FlaxEditor.Content.Settings.UWPPlatformSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "PreferredLaunchWindowingMode": 0,
7 | "AutoRotationPreferences": 15,
8 | "CertificateLocation": "",
9 | "SupportDX11": true,
10 | "SupportDX10": false
11 | }
12 | }
--------------------------------------------------------------------------------
/Content/Settings/Windows Settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "79ac390447f4263e30f56e9190a70dbc",
3 | "TypeName": "FlaxEditor.Content.Settings.WindowsPlatformSettings",
4 | "EngineBuild": 6222,
5 | "Data": {
6 | "WindowMode": 0,
7 | "ScreenWidth": 1280,
8 | "ScreenHeight": 720,
9 | "ResizableWindow": false,
10 | "RunInBackground": true,
11 | "ForceSingleInstance": false,
12 | "OverrideIcon": "00000000-0000-0000-0000-000000000000",
13 | "SupportDX12": false,
14 | "SupportDX11": true,
15 | "SupportDX10": false,
16 | "SupportVulkan": false
17 | }
18 | }
--------------------------------------------------------------------------------
/Content/flaxlogo/FlaxLogo.prefab:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "da337a09454bf3b7221f84aab17974a1",
3 | "TypeName": "FlaxEngine.Prefab",
4 | "EngineBuild": 6221,
5 | "Data": [
6 | {
7 | "ID": "abf6f92e44337054ea24119a6d283792",
8 | "TypeName": "FlaxEngine.RigidBody",
9 | "Name": "RigidBody",
10 | "Transform": {
11 | "Scale": {
12 | "X": 0.3709000051021576,
13 | "Y": 0.3709000051021576,
14 | "Z": 0.3709000051021576
15 | }
16 | },
17 | "OverrideMass": true,
18 | "Mass": 220.0,
19 | "UseCCD": true
20 | },
21 | {
22 | "ID": "29944e0d423fa51ed6bdf081c4b6aaa1",
23 | "TypeName": "FlaxEngine.StaticModel",
24 | "ParentID": "abf6f92e44337054ea24119a6d283792",
25 | "Name": "StaticModel",
26 | "Model": "4506404b42034a70c45a6299fbd7089c",
27 | "Buffer": {
28 | "Entries": [
29 | {
30 | "Material": "00000000000000000000000000000000",
31 | "ShadowsMode": 3,
32 | "Visible": true,
33 | "ReceiveDecals": true
34 | }
35 | ]
36 | }
37 | },
38 | {
39 | "ID": "c6d5f5a24a7ad364addc7da0adf8e397",
40 | "TypeName": "FlaxEngine.MeshCollider",
41 | "ParentID": "abf6f92e44337054ea24119a6d283792",
42 | "Name": "MeshCollider",
43 | "Material": "1126eb1f43a8e12e734c86a0da2981c8",
44 | "CollisionData": "71c455764d49e3c04b5c5aa15e1ae056"
45 | },
46 | {
47 | "ID": "377f405b4096b5789d2deeaaccbcd243",
48 | "TypeName": "FlaxEngine.EmptyActor",
49 | "ParentID": "abf6f92e44337054ea24119a6d283792",
50 | "Name": "Root"
51 | }
52 | ]
53 | }
--------------------------------------------------------------------------------
/Content/flaxlogo/FlaxLogoCollisionData.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/flaxlogo/FlaxLogoCollisionData.flax
--------------------------------------------------------------------------------
/Content/flaxlogo/Material.001.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/flaxlogo/Material.001.flax
--------------------------------------------------------------------------------
/Content/flaxlogo/Physical Material 0.json:
--------------------------------------------------------------------------------
1 | {
2 | "ID": "1126eb1f43a8e12e734c86a0da2981c8",
3 | "TypeName": "FlaxEngine.PhysicalMaterial",
4 | "EngineBuild": 6221,
5 | "Data": {
6 | "Friction": 0.7,
7 | "FrictionCombineMode": 0,
8 | "OverrideFrictionCombineMode": false,
9 | "Restitution": 0.2,
10 | "RestitutionCombineMode": 0,
11 | "OverrideRestitutionCombineMode": false
12 | }
13 | }
--------------------------------------------------------------------------------
/Content/flaxlogo/flaxlogo.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/flaxlogo/flaxlogo.flax
--------------------------------------------------------------------------------
/Content/flaxlogo/flaxlogocollider.flax:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/flaxlogo/flaxlogocollider.flax
--------------------------------------------------------------------------------
/Content/network-sample-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/network-sample-menu.png
--------------------------------------------------------------------------------
/Content/network-sample-players-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/network-sample-players-list.png
--------------------------------------------------------------------------------
/Content/network-sample-players.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlaxEngine/NetworkSample/4e992642663595ddb61a429340b3ffa80f1a946d/Content/network-sample-players.jpg
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Flax Engine
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NetworkingSample.flaxproj:
--------------------------------------------------------------------------------
1 | {
2 | "Name": "NetworkingSample",
3 | "Version": "1.0",
4 | "Company": "My Company",
5 | "Copyright": "",
6 | "GameTarget": "GameTarget",
7 | "EditorTarget": "GameEditorTarget",
8 | "References": [
9 | {
10 | "Name": "$(EnginePath)/Flax.flaxproj"
11 | }
12 | ],
13 | "DefaultScene": "74a68a984824b4510d12589f199ad68f",
14 | "DefaultSceneSpawn": {
15 | "Position": {
16 | "X": 189.3866,
17 | "Y": 109.910706,
18 | "Z": 132.960159
19 | },
20 | "Direction": {
21 | "X": -0.7114976,
22 | "Y": -0.299497128,
23 | "Z": -0.635666847
24 | }
25 | },
26 | "MinEngineVersion": "0.0.6194"
27 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Network Sample
2 |
3 | 
4 |
5 | [Network Sample](https://github.com/FlaxEngine/NetworkSample) is an open-source sample project that contains multiplayer game lobby implementation with player synchronization and chat. It can be used as a foundation for multiplayer projects using Flax low-level networking transportation layer.
6 |
7 | Minimum supported Flax version: `1.2`.
8 |
9 | ## Guide
10 |
11 | 1. Download project from [Github](https://github.com/FlaxEngine/NetworkSample) (as Zip or clone with Git)
12 | 2. Open project
13 | 3. Open `Menu` scene and Play!
14 | 4. In the main menu, you can specify the player nickname, server IP, and port
15 | 5. Start a server with Host button or use Connect button to connect running server
16 |
17 | You can also use Game Cooker to build game into a standalone application to run multiple instances of clients and a server.
18 |
19 | ## Screenshots
20 |
21 | 
22 |
23 | 
24 |
25 | ## Overview
26 |
27 | Main types overview:
28 | * **Player** - player information container (Name, ID, Actor, etc.)
29 | * **GameSession** - game service with players list including local player
30 | * **NetworkSession** - game service with packets and network connections handling
31 | * **Game/Network/Packets...** - various types of network packets used by the sample (implementations of `NetworkPacket`)
32 |
33 | ## License
34 |
35 | Project is released under **MIT License**.
36 |
--------------------------------------------------------------------------------
/Source/Game/Game.Build.cs:
--------------------------------------------------------------------------------
1 | using Flax.Build;
2 | using Flax.Build.NativeCpp;
3 |
4 | public class Game : GameModule
5 | {
6 | ///
7 | public override void Init()
8 | {
9 | base.Init();
10 |
11 | // C#-only scripting
12 | BuildNativeCode = false;
13 | }
14 |
15 | ///
16 | public override void Setup(BuildOptions options)
17 | {
18 | base.Setup(options);
19 |
20 | options.ScriptingAPI.IgnoreMissingDocumentationWarnings = true;
21 |
22 | // Here you can modify the build options for your game module
23 | // To reference another module use: options.PublicDependencies.Add("Audio");
24 | // To add C++ define use: options.PublicDefinitions.Add("COMPILE_WITH_FLAX");
25 | // To learn more see scripting documentation.
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Source/Game/GameSession.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FlaxEngine;
4 |
5 | public struct ChatMessage
6 | {
7 | public Guid Sender;
8 | public string Message;
9 | }
10 |
11 | ///
12 | /// Game service with players list including local player.
13 | ///
14 | public class GameSession : GamePlugin
15 | {
16 | public delegate void OnPlayerAddedHandler(Player player);
17 |
18 | public event OnPlayerAddedHandler OnPlayerAdded;
19 |
20 | public delegate void OnPlayerRemovedHandler(Player player);
21 |
22 | public event OnPlayerRemovedHandler OnPlayerRemoved;
23 |
24 | public List Players = new List();
25 | public List ChatMessages = new List();
26 |
27 | public Player LocalPlayer;
28 |
29 | public override void Initialize()
30 | {
31 | base.Initialize();
32 | Players.Clear();
33 | LocalPlayer = new Player();
34 | }
35 |
36 | public override void Deinitialize()
37 | {
38 | if (_instance == this)
39 | _instance = null;
40 | base.Deinitialize();
41 | }
42 |
43 | public Player AddPlayer()
44 | {
45 | var p = new Player() {ID = Guid.NewGuid()};
46 | AddPlayer(p);
47 | return p;
48 | }
49 |
50 | public Player AddPlayer(ref Guid guid, string name)
51 | {
52 | var p = new Player() {ID = guid, Name = name};
53 | AddPlayer(p);
54 | return p;
55 | }
56 |
57 | public void AddPlayer(Player player)
58 | {
59 | Players.Add(player);
60 | OnPlayerAdded?.Invoke(player);
61 | }
62 |
63 | public bool RemovePlayer(ref Guid id)
64 | {
65 | for (var i = Players.Count - 1; i >= 0; i--)
66 | {
67 | if (Players[i].ID == id)
68 | {
69 | var p = Players[i];
70 | Players.RemoveAt(i);
71 | OnPlayerRemoved?.Invoke(p);
72 | return true;
73 | }
74 | }
75 |
76 | return false;
77 | }
78 |
79 | public void AddChatMessage(Guid sender, string message)
80 | {
81 | ChatMessages.Add(new ChatMessage() {Sender = sender, Message = message});
82 | }
83 |
84 | public Player GetPlayer(Guid guid)
85 | {
86 | if (LocalPlayer.ID == guid)
87 | return LocalPlayer;
88 | for (var i = 0; i < Players.Count; i++)
89 | {
90 | if (Players[i].ID == guid)
91 | return Players[i];
92 | }
93 |
94 | return null;
95 | }
96 |
97 | private static GameSession _instance;
98 |
99 | public static GameSession Instance
100 | {
101 | get
102 | {
103 | if (_instance == null)
104 | _instance = PluginManager.GetPlugin();
105 | return _instance;
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/Source/Game/Network/ConnectionRegistry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using FlaxEngine.Networking;
5 |
6 | public class ConnectionRegistry
7 | {
8 | private Dictionary _idByCon = new Dictionary();
9 | private Dictionary _conById = new Dictionary();
10 |
11 | public void Add(ref NetworkConnection conn, Player player)
12 | {
13 | _idByCon.Add(conn, player.ID);
14 | _conById.Add(player.ID, conn);
15 | }
16 |
17 | public void Remove(ref NetworkConnection conn)
18 | {
19 | var guid = _idByCon[conn];
20 | _conById.Remove(guid);
21 | _idByCon.Remove(conn);
22 | }
23 |
24 | public void Remove(ref Guid guid)
25 | {
26 | var conn = _conById[guid];
27 | _idByCon.Remove(conn);
28 | _conById.Remove(guid);
29 | }
30 |
31 | public void Clear()
32 | {
33 | _idByCon.Clear();
34 | _conById.Clear();
35 | }
36 |
37 |
38 | public Guid GuidByConn(ref NetworkConnection conn)
39 | {
40 | return _idByCon.ContainsKey(conn) ? _idByCon[conn] : default;
41 | }
42 |
43 | public NetworkConnection ConnByGuid(ref Guid guid)
44 | {
45 | return _conById.ContainsKey(guid) ? _conById[guid] : default;
46 | }
47 |
48 | public List ToList()
49 | {
50 | return _conById.Values.ToList();
51 | }
52 |
53 | public NetworkConnection[] ToArray()
54 | {
55 | return _conById.Values.ToArray();
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Source/Game/Network/NetworkSession.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine;
3 | using FlaxEngine.Networking;
4 |
5 | ///
6 | /// Game service with packets and network connections handling
7 | ///
8 | public class NetworkSession : GamePlugin
9 | {
10 | private PacketRegistry _packetRegistry;
11 | private ConnectionRegistry _connRegistry;
12 | private NetworkPeer _peer;
13 | private bool _isServer;
14 | private bool _isConnected;
15 |
16 | public bool IsServer => _isServer;
17 |
18 | public bool IsConnected => _isConnected;
19 |
20 | public NetworkSession()
21 | {
22 | _description = new PluginDescription
23 | {
24 | Name = "NetworkPlugin",
25 | Description = "Network logic"
26 | };
27 | }
28 |
29 | public override void Initialize()
30 | {
31 | base.Initialize();
32 | _isConnected = false;
33 | _packetRegistry = new PacketRegistry();
34 |
35 | _packetRegistry.Register();
36 | _packetRegistry.Register();
37 | _packetRegistry.Register();
38 | _packetRegistry.Register();
39 | _packetRegistry.Register();
40 | _packetRegistry.Register();
41 | _packetRegistry.Register();
42 | _packetRegistry.Register();
43 |
44 | _connRegistry = new ConnectionRegistry();
45 | Scripting.Update += Update;
46 | }
47 |
48 | public override void Deinitialize()
49 | {
50 | base.Deinitialize();
51 | Scripting.Update -= Update;
52 | Disconnect();
53 | _isConnected = false;
54 | _isServer = false;
55 | if (_instance == this)
56 | _instance = null;
57 | }
58 |
59 | public void Update()
60 | {
61 | if (!_isConnected)
62 | return;
63 |
64 | if (_isServer)
65 | {
66 | while (_peer.PopEvent(out var eventData))
67 | {
68 | if (eventData.EventType == NetworkEventType.Message)
69 | {
70 | //Debug.Log($"Sender={eventData.Sender.ConnectionId} is sending a packet !");
71 | _packetRegistry.Receive(ref eventData, _isServer);
72 | _peer.RecycleMessage(eventData.Message);
73 | }
74 | else if (eventData.EventType == NetworkEventType.Connected)
75 | {
76 | Debug.Log($"Sender={eventData.Sender.ConnectionId} is connected !");
77 | _connRegistry.Add(ref eventData.Sender, GameSession.Instance.AddPlayer());
78 | }
79 | else if (eventData.EventType == NetworkEventType.Disconnected ||
80 | eventData.EventType == NetworkEventType.Timeout)
81 | {
82 | Debug.Log($"Sender={eventData.Sender.ConnectionId} is disconnected !");
83 | var g = GuidByConn(ref eventData.Sender);
84 | GameSession.Instance.RemovePlayer(ref g);
85 | _connRegistry.Remove(ref eventData.Sender);
86 | }
87 | }
88 | }
89 | else
90 | {
91 | while (_peer.PopEvent(out var eventData))
92 | {
93 | if (eventData.EventType == NetworkEventType.Message)
94 | {
95 | _packetRegistry.Receive(ref eventData, _isServer);
96 | _peer.RecycleMessage(eventData.Message);
97 | }
98 | else if (eventData.EventType == NetworkEventType.Disconnected ||
99 | eventData.EventType == NetworkEventType.Timeout)
100 | {
101 | Debug.Log($"Sender={eventData.Sender.ConnectionId} is disconnected !");
102 | NetworkPeer.ShutdownPeer(_peer);
103 | var g = GuidByConn(ref eventData.Sender);
104 | GameSession.Instance.RemovePlayer(ref g);
105 | _isConnected = false;
106 | _isServer = false;
107 | }
108 | else if (eventData.EventType == NetworkEventType.Connected)
109 | {
110 | Send(new ConnectionRequestPacket() { Username = GameSession.Instance.LocalPlayer.Name }, NetworkChannelType.ReliableOrdered);
111 | }
112 | }
113 | }
114 | }
115 |
116 | public bool Host(string username, ushort port)
117 | {
118 | if (_isConnected)
119 | Disconnect();
120 |
121 | _connRegistry.Clear();
122 | GameSession.Instance.LocalPlayer.Name = username;
123 | GameSession.Instance.LocalPlayer.ID = Guid.NewGuid();
124 | _peer = NetworkPeer.CreatePeer(new NetworkConfig
125 | {
126 | NetworkDriver = new ENetDriver(),
127 | ConnectionsLimit = 32,
128 | MessagePoolSize = 256,
129 | MessageSize = 1400,
130 | Address = "any",
131 | Port = port
132 | });
133 | if (!_peer.Listen())
134 | return true;
135 | _isConnected = true;
136 | _isServer = true;
137 | return false;
138 | }
139 |
140 | public bool Connect(string username, string address, ushort port)
141 | {
142 | if (_isConnected)
143 | Disconnect();
144 |
145 | _connRegistry.Clear();
146 | _isServer = false;
147 | _peer = NetworkPeer.CreatePeer(new NetworkConfig
148 | {
149 | NetworkDriver = new ENetDriver(),
150 | ConnectionsLimit = 32,
151 | MessagePoolSize = 256,
152 | MessageSize = 1400,
153 | Address = address,
154 | Port = port
155 | });
156 | GameSession.Instance.LocalPlayer.Name = username;
157 | if (!_peer.Connect())
158 | return true;
159 | _isConnected = true;
160 | _isServer = false;
161 | return false;
162 | }
163 |
164 | public void Disconnect()
165 | {
166 | if (_isConnected)
167 | {
168 | if (!_isServer)
169 | _peer.Disconnect();
170 | NetworkPeer.ShutdownPeer(_peer);
171 | }
172 |
173 | _isConnected = false;
174 | _isServer = false;
175 | }
176 |
177 | public void Send(NetworkPacket packet, NetworkChannelType type)
178 | {
179 | if (!_isConnected)
180 | return;
181 | var msg = _peer.BeginSendMessage();
182 | _packetRegistry.Send(packet, ref msg);
183 | if (_isServer)
184 | _peer.EndSendMessage(type, msg, _connRegistry.ToArray());
185 | else
186 | _peer.EndSendMessage(type, msg);
187 | }
188 |
189 | public void Send(NetworkPacket packet, NetworkChannelType type, ref NetworkConnection conn)
190 | {
191 | if (!_isServer || !_isConnected)
192 | return;
193 | var msg = _peer.BeginSendMessage();
194 | _packetRegistry.Send(packet, ref msg);
195 | _peer.EndSendMessage(type, msg, conn);
196 | }
197 |
198 | public void SendAll(NetworkPacket packet, NetworkChannelType type)
199 | {
200 | if (!_isServer || !_isConnected)
201 | return;
202 | var msg = _peer.BeginSendMessage();
203 | _packetRegistry.Send(packet, ref msg);
204 | _peer.EndSendMessage(type, msg, _connRegistry.ToArray());
205 | }
206 |
207 | public Guid GuidByConn(ref NetworkConnection conn)
208 | {
209 | return _connRegistry.GuidByConn(ref conn);
210 | }
211 |
212 | public void DisconnectPlayer(Player player)
213 | {
214 | DisconnectPlayer(ref player.ID);
215 | }
216 |
217 | public void DisconnectPlayer(ref Guid guid)
218 | {
219 | if (!_isServer || !_isConnected)
220 | return;
221 | PlayerDisconnectedPacket pdp = new PlayerDisconnectedPacket();
222 | pdp.ID = guid;
223 | SendAll(pdp, NetworkChannelType.ReliableOrdered);
224 | _peer.Disconnect(_connRegistry.ConnByGuid(ref guid));
225 | _connRegistry.Remove(ref guid);
226 | GameSession.Instance.RemovePlayer(ref guid);
227 | }
228 |
229 | public void RemovePlayer(Player player)
230 | {
231 | RemovePlayer(ref player.ID);
232 | }
233 |
234 | public void RemovePlayer(ref Guid guid)
235 | {
236 | if (!_isServer || !_isConnected)
237 | return;
238 | _peer.Disconnect(_connRegistry.ConnByGuid(ref guid));
239 | _connRegistry.Remove(ref guid);
240 | }
241 |
242 | private static NetworkSession _instance;
243 |
244 | public static NetworkSession Instance
245 | {
246 | get
247 | {
248 | if (_instance == null)
249 | _instance = PluginManager.GetPlugin();
250 | return _instance;
251 | }
252 | }
253 | }
254 |
--------------------------------------------------------------------------------
/Source/Game/Network/PacketRegistry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FlaxEngine;
4 | using FlaxEngine.Networking;
5 |
6 | public class PacketRegistry
7 | {
8 | private Dictionary _packets = new Dictionary();
9 |
10 | public void Register() where T : NetworkPacket
11 | {
12 | // if it's already registered
13 | _packets.Remove(typeof(T).Name.GetDeterministicHashCode());
14 | _packets.Add(typeof(T).Name.GetDeterministicHashCode(), typeof(T));
15 | }
16 |
17 | public void Receive(ref NetworkEvent eventData, bool isServer = false)
18 | {
19 | int t = eventData.Message.ReadInt32();
20 | if (!_packets.ContainsKey(t))
21 | {
22 | Debug.LogWarning($"Packet not registered, Type=" + t);
23 | return;
24 | }
25 |
26 | var type = _packets[t];
27 | var p = (NetworkPacket)Activator.CreateInstance(type);
28 | p.Sender = eventData.Sender;
29 | //Debug.Log($"Message Sender={eventData.Sender.ConnectionId} Type={type.Name}");
30 | p.Deserialize(ref eventData.Message);
31 | if (isServer)
32 | p.ServerHandler(ref eventData.Sender);
33 | else
34 | p.ClientHandler();
35 | }
36 |
37 | public void Send(NetworkPacket packet, ref NetworkMessage msg)
38 | {
39 | msg.WriteInt32(packet.GetType().Name.GetDeterministicHashCode());
40 | packet.Serialize(ref msg);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/ChatMessagePacket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine.Networking;
3 |
4 | public class ChatMessagePacket : NetworkPacket
5 | {
6 | public string Message = string.Empty;
7 | public Guid SenderID = Guid.Empty;
8 |
9 | public override void Serialize(ref NetworkMessage msg)
10 | {
11 | msg.WriteString(Message);
12 | var hasSender = SenderID != Guid.Empty;
13 | msg.WriteBoolean(hasSender);
14 | if (hasSender)
15 | msg.WriteGuid(SenderID);
16 | }
17 |
18 | public override void Deserialize(ref NetworkMessage msg)
19 | {
20 | Message = msg.ReadString();
21 | SenderID = msg.ReadBoolean() ? msg.ReadGuid() : Guid.Empty;
22 | }
23 |
24 | public override void ServerHandler(ref NetworkConnection sender)
25 | {
26 | SenderID = NetworkSession.Instance.GuidByConn(ref sender);
27 | GameSession.Instance.AddChatMessage(SenderID, Message);
28 | NetworkSession.Instance.SendAll(this, NetworkChannelType.ReliableOrdered);
29 | }
30 |
31 | public override void ClientHandler()
32 | {
33 | if (GameSession.Instance.LocalPlayer.ID == SenderID)
34 | return;
35 | GameSession.Instance.AddChatMessage(SenderID, Message);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/ConnectionRequestPacket.cs:
--------------------------------------------------------------------------------
1 | using FlaxEngine.Networking;
2 |
3 | public class ConnectionRequestPacket : NetworkPacket
4 | {
5 | public string Username = string.Empty;
6 |
7 | public override void Serialize(ref NetworkMessage msg)
8 | {
9 | msg.WriteString(Username);
10 | }
11 |
12 | public override void Deserialize(ref NetworkMessage msg)
13 | {
14 | Username = msg.ReadString();
15 | }
16 |
17 | public override void ServerHandler(ref NetworkConnection sender)
18 | {
19 | ConnectionResponsePacket cr = new ConnectionResponsePacket();
20 | cr.ID = NetworkSession.Instance.GuidByConn(ref sender);
21 | NetworkSession.Instance.Send(cr, NetworkChannelType.ReliableOrdered, ref sender);
22 |
23 | GameSession.Instance.GetPlayer(cr.ID).Name = Username;
24 |
25 | PlayerListPacket plp = new PlayerListPacket();
26 | plp.Players = GameSession.Instance.Players;
27 | NetworkSession.Instance.Send(plp, NetworkChannelType.Reliable, ref sender);
28 |
29 | PlayerConnectedPacket pcp = new PlayerConnectedPacket();
30 | pcp.ID = cr.ID;
31 | pcp.Username = Username;
32 | NetworkSession.Instance.SendAll(pcp, NetworkChannelType.Reliable);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/ConnectionResponsePacket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine;
3 | using FlaxEngine.Json;
4 | using FlaxEngine.Networking;
5 |
6 | public class ConnectionResponsePacket : NetworkPacket
7 | {
8 | public enum ConnectionState : byte
9 | {
10 | Accepted,
11 | Rejected,
12 | }
13 |
14 | public ConnectionState State;
15 | public Guid ID = Guid.Empty;
16 |
17 | public override void Serialize(ref NetworkMessage msg)
18 | {
19 | msg.WriteByte((byte)State);
20 | var bytes = ID.ToByteArray();
21 | msg.WriteInt32(bytes.Length);
22 | msg.WriteBytes(bytes, bytes.Length);
23 | }
24 |
25 | public override void Deserialize(ref NetworkMessage msg)
26 | {
27 | State = (ConnectionState)msg.ReadByte();
28 | var length = msg.ReadInt32();
29 | byte[] bytes = new byte[length];
30 | msg.ReadBytes(bytes, length);
31 | ID = new Guid(bytes);
32 | }
33 |
34 | public override void ClientHandler()
35 | {
36 | if (State == ConnectionState.Accepted)
37 | {
38 | GameSession.Instance.LocalPlayer.ID = ID;
39 | JsonSerializer.ParseID("74a68a984824b4510d12589f199ad68f", out var guid);
40 | Debug.Log("Connection accepted !");
41 | Level.ChangeSceneAsync(guid);
42 | }
43 | else
44 | {
45 | Debug.Log("Connection rejected !");
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/NetworkPacket.cs:
--------------------------------------------------------------------------------
1 | using FlaxEngine.Networking;
2 |
3 | public abstract class NetworkPacket
4 | {
5 | public NetworkConnection Sender;
6 |
7 | public abstract void Serialize(ref NetworkMessage msg);
8 |
9 | public abstract void Deserialize(ref NetworkMessage msg);
10 |
11 | public virtual void ServerHandler(ref NetworkConnection sender)
12 | {
13 | }
14 |
15 | public virtual void ClientHandler()
16 | {
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/PlayerConnectedPacket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine.Networking;
3 |
4 | public class PlayerConnectedPacket : NetworkPacket
5 | {
6 | public Guid ID;
7 | public string Username;
8 |
9 | public override void Serialize(ref NetworkMessage msg)
10 | {
11 | msg.WriteGuid(ID);
12 | msg.WriteString(Username);
13 | }
14 |
15 | public override void Deserialize(ref NetworkMessage msg)
16 | {
17 | ID = msg.ReadGuid();
18 | Username = msg.ReadString();
19 | }
20 |
21 | public override void ClientHandler()
22 | {
23 | if (ID == GameSession.Instance.LocalPlayer.ID)
24 | return;
25 | GameSession.Instance.AddPlayer(ref ID, Username);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/PlayerDisconnectedPacket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine.Networking;
3 |
4 | public class PlayerDisconnectedPacket : NetworkPacket
5 | {
6 | public Guid ID;
7 |
8 | public override void Serialize(ref NetworkMessage msg)
9 | {
10 | msg.WriteGuid(ID);
11 | }
12 |
13 | public override void Deserialize(ref NetworkMessage msg)
14 | {
15 | ID = msg.ReadGuid();
16 | }
17 |
18 | public override void ClientHandler()
19 | {
20 | if (ID == GameSession.Instance.LocalPlayer.ID)
21 | return;
22 | NetworkSession.Instance.RemovePlayer(ref ID);
23 | GameSession.Instance.RemovePlayer(ref ID);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/PlayerListPacket.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using FlaxEngine.Networking;
3 |
4 | public class PlayerListPacket : NetworkPacket
5 | {
6 | public List Players = new List();
7 |
8 | public override void Serialize(ref NetworkMessage msg)
9 | {
10 | msg.WriteInt32(Players.Count + 1);
11 | for (var i = 0; i < Players.Count; i++)
12 | {
13 | msg.WriteString(Players[i].Name);
14 | msg.WriteGuid(Players[i].ID);
15 | }
16 |
17 | msg.WriteString(GameSession.Instance.LocalPlayer.Name);
18 | msg.WriteGuid(GameSession.Instance.LocalPlayer.ID);
19 | }
20 |
21 | public override void Deserialize(ref NetworkMessage msg)
22 | {
23 | var count = msg.ReadInt32();
24 | Players = new List();
25 | for (int i = 0; i < count; i++)
26 | {
27 | Player p = new Player();
28 | p.Name = msg.ReadString();
29 | p.ID = msg.ReadGuid();
30 | Players.Add(p);
31 | }
32 | }
33 |
34 | public override void ClientHandler()
35 | {
36 | for (var i = 0; i < Players.Count; i++)
37 | {
38 | if (GameSession.Instance.GetPlayer(Players[i].ID) == null &&
39 | Players[i].ID != GameSession.Instance.LocalPlayer.ID)
40 | {
41 | GameSession.Instance.AddPlayer(Players[i]);
42 | }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/PlayerTransformPacket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine;
3 | using FlaxEngine.Networking;
4 |
5 | public class PlayerTransformPacket : NetworkPacket
6 | {
7 | public Vector3 Position;
8 | public Quaternion Rotation;
9 |
10 | public override void Serialize(ref NetworkMessage msg)
11 | {
12 | msg.WriteVector3(Position);
13 | msg.WriteQuaternion(Rotation);
14 | }
15 |
16 | public override void Deserialize(ref NetworkMessage msg)
17 | {
18 | Position = msg.ReadVector3();
19 | Rotation = msg.ReadQuaternion();
20 | }
21 |
22 | public override void ServerHandler(ref NetworkConnection sender)
23 | {
24 | Guid guid = NetworkSession.Instance.GuidByConn(ref sender);
25 | var player = GameSession.Instance.GetPlayer(guid);
26 | player.Position = Position;
27 | player.Rotation = Rotation;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Source/Game/Network/Packets/PlayersTransformPacket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FlaxEngine;
4 | using FlaxEngine.Networking;
5 |
6 | public class PlayersTransformPacket : NetworkPacket
7 | {
8 | public struct TransformEntry
9 | {
10 | public Guid Guid;
11 | public Vector3 Position;
12 | public Quaternion Rotation;
13 | }
14 |
15 | public List Transforms = new List();
16 |
17 | public override void Serialize(ref NetworkMessage msg)
18 | {
19 | msg.WriteInt32(Transforms.Count);
20 | for (var i = 0; i < Transforms.Count; i++)
21 | {
22 | msg.WriteGuid(Transforms[i].Guid);
23 | msg.WriteVector3(Transforms[i].Position);
24 | msg.WriteQuaternion(Transforms[i].Rotation);
25 | }
26 | }
27 |
28 | public override void Deserialize(ref NetworkMessage msg)
29 | {
30 | Transforms.Clear();
31 | var count = msg.ReadInt32();
32 | for (int i = 0; i < count; i++)
33 | {
34 | TransformEntry te = new TransformEntry();
35 | te.Guid = msg.ReadGuid();
36 | te.Position = msg.ReadVector3();
37 | te.Rotation = msg.ReadQuaternion();
38 | Transforms.Add(te);
39 | }
40 | }
41 |
42 | public override void ClientHandler()
43 | {
44 | for (var i = 0; i < Transforms.Count; i++)
45 | {
46 | if (GameSession.Instance.LocalPlayer.ID == Transforms[i].Guid)
47 | continue;
48 | var player = GameSession.Instance.GetPlayer(Transforms[i].Guid);
49 | player.Position = Transforms[i].Position;
50 | player.Rotation = Transforms[i].Rotation;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Source/Game/Player.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FlaxEngine;
3 |
4 | ///
5 | /// Player information container (Name, ID, Actor, etc.)
6 | ///
7 | public class Player
8 | {
9 | public Guid ID = Guid.Empty;
10 | public string Name = string.Empty;
11 | public Vector3 Position = Vector3.Zero;
12 | public Quaternion Rotation = Quaternion.Zero;
13 |
14 | public Actor Actor = null;
15 | }
16 |
--------------------------------------------------------------------------------
/Source/Game/Scripts/ChatScript.cs:
--------------------------------------------------------------------------------
1 | using FlaxEditor;
2 | using FlaxEngine;
3 | using FlaxEngine.GUI;
4 | using FlaxEngine.Networking;
5 |
6 | public class ChatScript : Script
7 | {
8 | public ControlReference MessageBox;
9 | public ControlReference Panel;
10 | public ControlReference VertPanel;
11 |
12 | public FontReference ChatFont;
13 |
14 | private bool _isWriting;
15 | private int _chatIndex;
16 |
17 | public bool IsWriting
18 | {
19 | get => _isWriting;
20 | }
21 |
22 | ///
23 | public override void OnEnable()
24 | {
25 | _isWriting = false;
26 | MessageBox.Control.Clear();
27 | VertPanel.Control.DisposeChildren();
28 | MessageBox.UIControl.IsActive = false;
29 | _chatIndex = 0;
30 | }
31 |
32 | public override void OnDisable()
33 | {
34 | VertPanel.Control.DisposeChildren();
35 | }
36 |
37 | ///
38 | public override void OnUpdate()
39 | {
40 | var chatMessages = GameSession.Instance.ChatMessages;
41 | if (chatMessages.Count - 1 >= _chatIndex)
42 | {
43 | VertPanel.Control.BackgroundColor = new Color(0, 0, 0, 0.28f);
44 | while (_chatIndex < chatMessages.Count)
45 | {
46 | var l = VertPanel.Control.AddChild