How cyan8041/spacewars works
SpaceWars is a Unity 1:1 online, turn-based strategy game. A player authenticates, enters a lobby for records, rankings, and room matching, joins a waiting room to chat and choose a map, then plays a synchronized tile-grid battle; the result updates Firebase records. The graph follows the README’s documented script roles and workflow. Source excerpts were unavailable, so internal call-level relationships and unmentioned implementation details are not inferred.
Main entry points: WaitLobbyManager.cs Lobby profile · InGameManager.cs Turns and AP · GameResult.cs Game result · FirebaseAuthManager.cs Authentication
Components 17
Identity and records
- Authentication
Assets/Scripts/FirebaseAuthManager.cs - Player records
Assets/Scripts/FirebaseAuthManager.cs - Lobby profile
Assets/Scripts/WaitLobbyManager.cs - Rankings
Assets/Scripts/LeaderBoardManager.cs
Lobby and matchmaking
- Room matching
Assets/Scripts/PhotonManager.cs - Room data
Assets/Scripts/RoomData.cs - Waiting room
Assets/Scripts/LobbyManager.cs
Turn-based battle
- Map and units
Assets/RedBjorn/ProtoTiles/Examples/Scripts/ExampleStart.cs - Turns and AP
Assets/Scripts/InGameManager.cs - Unit combat
Assets/RedBjorn/ProtoTiles/Examples/Scripts/UnitMove.cs - Unit movement
Assets/RedBjorn/ProtoTiles/Examples/Scripts/UnitMove2.cs - Base health
Assets/Scripts/Base.cs - Battle camera
Assets/RedBjorn/ProtoTiles/Examples/Scripts/CameraController.cs - Game result
Assets/Scripts/GameResult.cs
External services
- Photon PUN
- Firebase
Other components
- Player
Connections 24
- Player → Authentication: signs in
- Authentication → Firebase: authenticates
- Authentication → Player records: initializes records
- Player → Lobby profile: enters lobby
- Lobby profile → Player records: reads records
- Lobby profile → Rankings: opens rankings
- Rankings → Firebase: queries records
- Lobby profile → Room matching: opens rooms
- Room matching → Room data: updates room list
- Room matching → Photon PUN: matches players
- Player → Waiting room: joins room
- Waiting room → Photon PUN: syncs chat and room
- Waiting room → Map and units: starts selected map
- Map and units → Turns and AP: sets up battle
- Turns and AP → Unit combat: enables actions
- Turns and AP → Unit movement: enables actions
- Unit combat → Photon PUN: syncs combat
- Unit movement → Photon PUN: syncs combat
- Unit combat → Base health: attacks base
- Turns and AP → Game result: checks victory
- Game result → Photon PUN: sends result RPC
- Game result → Firebase: updates records
- Game result → Lobby profile: returns to lobby
- Player → Battle camera: controls view