Login Scene

The Login scene is the entry point of BulletHell Elemental Template. It handles account creation / sign‑in and prepares every global system before the player reaches the Home screen.

1. Scene Hierarchy (Key Objects)

Login
 ├─ Main Camera
 ├─ Directional Light
 ├─ EventSystem
 ├─ Canvas
 │   └─ AuthManagerUI (includes login & register forms)
 ├─ Game Managers
 │   ├─ GameInstance
 │   ├─ LanguageManager
 │   ├─ AudioManager
 │   └─ MapRewardManager
 ├─ Backend Settings
 │   ├─ BackendBootstrap
 │   ├─ BackendManager
 │   └─ ExportDataJson (WebSocket only)
 ├─ Networking
 │   └─ PhotonFusionNetworkManager
 ├─ Loading Manager
 │   └─ LoadingManager
 └─ Local Scene Audio
     └─ LoginAmbientAudio

2. Component Reference

GameObject / Component

Purpose

AuthManager (on Canvas)

Orchestrates login / registration UI and forwards credentials to BackendManager.

LanguageManager

Stores all text translations and switches fonts or uppercase rules at runtime.

AudioManager

Central audio hub: groups by tag, enforces max voices, exposes volume sliders.

MapRewardManager

Grants one‑time rewards when a map is cleared for the first time.

GameInstance

Singleton. Holds every static dataset: characters, icons, frames, maps, currencies, balance caps, etc. Used by nearly all other systems.

BackendBootstrap

Injects the selected backend implementation (Offline, Firebase, WebSocket) at scene start.

BackendManager

Handles sign‑in flow, data load / save, remote validation and daily quest timers.

ExportDataJson

Editor‑only helper that exports local JSON files needed by the WebSocket + SQL backend. Click Export All Game Data while the game is running in the Login scene.

PhotonFusionNetworkManager

Hosts / joins lobbies for Co‑op and PvP modes using Fusion 2.

LoadingManager

Displays the animated loading screen, enforces a minimum display time and plays scene‑transition SFX.

LoginAmbientAudio

Looping ambience dedicated to the Login scene, routed through AudioManager.


3. Typical Flow

  1. BackendBootstrap reads BackendSettings.asset and instantiates the correct backend service.

  2. AuthManager shows the login UI. Creating an account (guest or email/password) triggers BackendManager to fetch or create player data.

  3. GameInstance caches the data for global access.

  4. On successful login, LoadingManager transitions to the Home scene.


4. Tips & Best Practices

  • Do not delete GameInstance. Many scripts assume it exists in every gameplay scene.

  • When using the WebSocket backend, always export fresh JSON with ExportDataJson after you edit any GameData.

  • Keep LanguageManager near the top of the execution order if you plan to swap languages early.

  • For custom SFX, add new tags in AudioManager rather than hard‑coding audio sources.


5. Extending the Scene

  • Add new managers inside the Game Managers group to keep the hierarchy tidy.

  • If you replace the login system, keep its public events (OnLoginSuccess, OnLoginFailed) so other components remain compatible.

  • For additional ambient tracks, duplicate LoginAmbientAudio and assign a unique AudioMixer group.


Need help? Join the community: https://discord.com/invite/EGGj77g3eQ

Last updated