2016-08-16 1 views

답변

1

소셜 인터페이스를 사용하십시오.

그런 다음 경우

Social.localUser 

using UnityEngine; 
class c { 
    void foo() { 
     Social.localUser.Authenticate (success => { 
     if (success) { 
      Debug.Log ("Authentication successful"); 
      string userInfo = "Username: " + Social.localUser.userName + 
       "\nUser ID: " + Social.localUser.id + 
       "\nIsUnderage: " + Social.localUser.underage; 
      Debug.Log (userInfo); 
     } 
     else 
      Debug.Log ("Authentication failed"); 
    }); 
    } 
} 

아래 https://docs.unity3d.com/ScriptReference/Social-localUser.html의 예를 참조하여 모든 사용자 정보에 액세스 할 수 있습니다

Social.localUser.Authenticate(callback); 

인증 플레이어에 대한 정보를 당신 필요는 사용할 수 없지만 (네이티브 gamecenter API를 통해) 소셜 인터페이스와 함께 사용하기 위해 다른 플랫폼 플러그인을 다운로드해야 할 수도 있습니다. (Android의 경우처럼)

+0

사과 게임 키트 설명서를 확인한 결과 전자 메일, 이름 및 성을 허용하지 않습니다. https : //developer.apple.com/library/ios/documentation/GameKit/Reference/GKPlayer_Ref/index.html#//apple_ref/occ/instp/GKPlayer/playerID – GNChishti

+0

내가 틀렸다면 고쳐주세요 ... 감사합니다. – GNChishti

+0

에 따르면 링크를 사용하려면 'alias' (플레이어가 다른 플레이어를 식별하기 위해 선택한 문자열) 및'displayName' (플레이어에 표시 할 문자열)을 사용할 수 있습니다. 나는 두 번째 것이 특정 형식의 이름 - 이름 인 것으로 생각했다. IOS (나는 그것이 안드로이드에서 사용 가능하다는 것을 알고있다)에 관한 이메일에 관해 아무것도 발견하지 못했다. –