gpt-4.1-mini-2025-04-14· OpenAI
LMArena Human Preference 140K
unity , firebase , 인증 using System.Threading.Tasks; using UnityEngine; using…
- User
unity , firebase , 인증
using System.Threading.Tasks; using UnityEngine; using Firebase.Auth; using Firebase;
public class FireAuth : MonoBehaviour { FirebaseAuth auth; bool isFirebaseInitialized = false;
public string UserId; private async void Start() { await InitializeFirebaseAsync(); await SignInAnonymouslyAsync(); } // Firebase 제대로 설치되어 있는지 확인하고, 필요하다면 자동으로 업데이트(또는 설치)를 시도 private async Task InitializeFirebaseAsync() { var dependencyStatus = await FirebaseApp.CheckAndFixDependenciesAsync(); if (dependencyStatus == DependencyStatus.Available) { auth = FirebaseAuth.DefaultInstance; isFirebaseInitialized = true; } else { Debug.LogError($"Firebase Initialize FAILED : {dependencyStatus}"); } } // 익명 인증 public async Task SignInAnonymouslyAsync() { if (!isFirebaseInitialized || auth == null) { Debug.LogError("Firebase is not initialized yet"); return; } try { AuthResult result = await auth.SignInAnonymouslyAsync(); UserId = result.User.UserId; Debug.Log($"익명 로그인 성공: {result.User.DisplayName} ({UserId})"); } catch (System.OperationCanceledException) { Debug.LogError("SignInAnonymouslyAsync가 취소되었습니다."); } catch (System.Exception ex) { Debug.LogError("SignInAnonymouslyAsync에서 오류 발생: " + ex); } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.