Skip to content

ananthxr/ARTH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARTH

V1.6 Update — Firebase Realtime Database (Unity)

This version adds a read-only integration with Firebase Realtime Database (RTDB) and wires it into the existing treasure hunt flow.

What changed

  • Unity no longer writes to Firebase. Data is populated from your website to RTDB.
  • FirebaseRTDBFetcher uses UnityWebRequest to fetch team data by UID and hand it to TreasureHuntManager.
  • Clear UX: invalid UID messaging and registration panel is hidden when verification appears.

Data model (RTDB)

Path: <RTDB_BASE>/<UID>.json

Example:

{
  "teamNumber": 7,
  "teamName": "DragonHunters",
  "uid": "26SIG",
  "player1": "John",
  "player2": "Jane",
  "email": "team@example.com",
  "score": 0
}

End-to-end flow

  1. User enters UID and clicks Fetch.
  2. FirebaseRTDBFetcher builds URL <base>/<UID>.json[?auth=TOKEN] and GETs via UnityWebRequest.
  3. If not found: shows "UID not found" near the input; no UI state changes.
  4. If found: populates the verification panel (team name, number, players, email, UID), hides the registration panel.
  5. User clicks "I verified":
    • FirebaseRTDBFetcher converts JSON to the shared TeamData model
    • Calls TreasureHuntManager.ReceiveExternalTeamData(team)
    • Triggers TreasureHuntManager.OnVerifyTeam()
  6. TreasureHuntManager calculates wave, clue index, delay, transitions UI, and starts the hunt.

Scene wiring (quick)

  • FirebaseRTDBFetcher:
    • Realtime Database Base Url: e.g. https://arth2-169a4-default-rtdb.firebaseio.com
    • Optional Auth Token if your rules require it
    • Uid Input, Fetch Button, Uid Status Text
    • Verification Panel, Verification Text, I Verified Button
    • TreasureHuntManager (drag the existing manager)

Notes

  • 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.

About

This is ARTH For Curiospark

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published