This version adds a read-only integration with Firebase Realtime Database (RTDB) and wires it into the existing treasure hunt flow.
- Unity no longer writes to Firebase. Data is populated from your website to RTDB.
FirebaseRTDBFetcheruses UnityWebRequest to fetch team data by UID and hand it toTreasureHuntManager.- Clear UX: invalid UID messaging and registration panel is hidden when verification appears.
Path: <RTDB_BASE>/<UID>.json
Example:
{
"teamNumber": 7,
"teamName": "DragonHunters",
"uid": "26SIG",
"player1": "John",
"player2": "Jane",
"email": "team@example.com",
"score": 0
}
- User enters UID and clicks Fetch.
FirebaseRTDBFetcherbuilds URL<base>/<UID>.json[?auth=TOKEN]and GETs via UnityWebRequest.- If not found: shows "UID not found" near the input; no UI state changes.
- If found: populates the verification panel (team name, number, players, email, UID), hides the registration panel.
- User clicks "I verified":
FirebaseRTDBFetcherconverts JSON to the sharedTeamDatamodel- Calls
TreasureHuntManager.ReceiveExternalTeamData(team) - Triggers
TreasureHuntManager.OnVerifyTeam()
TreasureHuntManagercalculates wave, clue index, delay, transitions UI, and starts the hunt.
FirebaseRTDBFetcher:Realtime Database Base Url: e.g.https://arth2-169a4-default-rtdb.firebaseio.com- Optional
Auth Tokenif your rules require it Uid Input,Fetch Button,Uid Status TextVerification Panel,Verification Text,I Verified ButtonTreasureHuntManager(drag the existing manager)
- Read-only: Unity does not push any data to Firebase in this flow.
- Firestore SDK is not required for RTDB fetches; this path uses
UnityWebRequest.