Skip to main content
Folder: Assets/_MolcaSDK/Code/Scripts/Auth/
Namespace: MolcaSDK.Auth

Code

Inspector-driven: AuthUI assigns TMP_InputField, error texts, SharedString nextSceneName, and guest panel buttons. On start it await RuntimeManager.WaitForInitialization(), registers AuthEvents.LoggedIn, and loads nextSceneName.value after a successful login. Programmatic login (same as OnLoginClicked):
Guest path (matches OnGuestClicked — confirmation modal then GuestLogin):
VR OTP / member flows stay on ScenarioSessionManager — see Session authentication.

Troubleshooting

  • Scene does not load after loginAuthEvents.LoggedIn must fire; SharedString nextSceneName must match a registered scene. Check SceneLoadManager / build settings.
  • Login always fails — Verify AuthManager subsystem, backend URL/auth config in your project, and that LoginAsync errors surface (UI sets a generic invalid-credentials message on usernameErrorText only for the main path).
  • Guest panel stuckguestPanel Show/Hide is manual from buttons; ensure guestLoginCancelButton clears the panel.
  • Start raceAuthUI awaits WaitForInitialization; do not call LoginAsync from Awake on the same object before that completes.

Unity Editor

Auth Ui Inspector

AuthUI Inspector