프로필 관리
Create and manage multiple player profiles on a single device to allow players to sign in with different accounts.
읽는 시간 1분최근 업데이트: 8달 전
플레이어는 프로필을 사용해 하나의 기기에서 여러 계정에 로그인할 수 있습니다. 프로필을 통해 에 저장되는 값이 분리되어 저장됩니다. 프로필은 자동으로 유지되지 않습니다. 프로필을 어떻게 관리할지는 개발자가 결정해야 합니다.
PlayerPrefs프로필 전환
플레이어가 로그아웃한 상태에서만 현재 프로필을 전환할 수 있습니다. 를 사용합니다. 프로필 이름은 영숫자 값, `-`, `_`만 지원하며 최대 길이는 30자입니다.
AuthenticationService.Instance.SwitchProfile(profileName)플레이어가 로그아웃하지 않은 상태라면 에서 에러 코드 로 이 발생합니다.
SwitchProfileAuthenticationErrorCodes.ClientInvalidUserStateAuthenticationException유효하지 않은 이름을 사용하면 에서 에러 코드 로 이 발생합니다.
SwitchProfileAuthenticationErrorCodes.ClientInvalidProfileAuthenticationException현재 프로필
현재 프로필을 확인하려면 을 사용합니다.
AuthenticationService.Instance.Profile기본 프로필
초기화 옵션에서 제공되는 프로필이 없는 경우 값이 사용됩니다.
default초기화 시 프로필 설정
UnityServicesAuthenticationServicedefaultasync Task InitializeUnityServices(){ var options = new InitializationOptions(); options.SetProfile(“test_profile”); await UnityServices.InitializeAsync(options);}