NetworkManagerComponent struct in Thread
One per scene that players play in. It says what a player is and where they appear. The host spawns PlayerPrefab for every player who has loaded the scene: itself, each player who joins, and once when playing alone. A single-player game and a co-op one are therefore the same scene. When a player leaves, their character goes with them.
Properties
| PlayerPrefab | std::string | The character prefab (asset reference). Give its root a Net Identity. |
| SpawnSpacing | float | Players appear side by side along this entity's X axis, this far apart (metres). Default 2. |
Do not also place a player in the scene. The spawned one is
yours. Scripts find it with
LocalPlayer(), and any player's with
NetReplication::PlayerOf(peer).NetworkManagerComponent struct w Thread
Jeden na scenę, w której się gra. Mówi, czym jest gracz i gdzie się pojawia. Host spawnuje PlayerPrefab każdemu graczowi, który wczytał scenę: sobie, każdemu dołączającemu i raz przy grze solo. Gra jednoosobowa i co-op to więc ta sama scena. Gdy gracz wychodzi, jego postać znika razem z nim.
Właściwości
| PlayerPrefab | std::string | Prefab postaci (referencja do assetu). Na jego korzeń dodaj Net Identity. |
| SpawnSpacing | float | Gracze pojawiają się obok siebie wzdłuż osi X tej encji, w takim odstępie (w metrach). Domyślnie 2. |
Nie wstawiaj dodatkowo gracza do sceny. Twoja postać to ta
zespawnowana. Skrypty znajdują ją przez
LocalPlayer(), a postać dowolnego gracza przez
NetReplication::PlayerOf(peer).