2015-02-06 2 views
1
내가 보여주는 저장된 게임 ui.Here에 다음과 같은 예외를 얻고있다

내 코드입니다 :Google Play 게임 서비스 | ShowSelectSavedGameUI 유니티 안드로이드

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() 
      .EnableSavedGames() 
       .Build(); 
     PlayGamesPlatform.InitializeInstance(config); 

     // Activate the Play Games platform. This will make it the default 
     // implementation of Social.Active 
     PlayGamesPlatform.Activate(); 

     // Sign in to Google Play Games 
     mAuthenticating = true; 
     Social.localUser.Authenticate((bool success) => { 
      mAuthenticating = false; 
      if (success) { 
       Debug.Log("Login successful!"); 
      } else { 
       // no need to show error message (error messages are shown automatically 
       // by plugin) 
       Debug.LogWarning("Failed to sign in with Google Play Games."); 
      } 
     }); 

쇼 UI 코드 :

((PlayGamesPlatform)Social.Active).SavedGame.ShowSelectSavedGameUI("Save game progress",                  1,true,false,SavedGameSelected); 

NotImplementedException : 당신은 구원을 활성화해야 게임이 할 수있는 전 사용하십시오. PlayGamesClientConfiguration.Builder.EnableSavedGames를 참조하십시오. 02-06 20 : 03 : 38.804 : I/Unity (32369) : GooglePlayGames.Native.UnsupportedSavedGamesClient.ShowSelectSavedGameUI (System.String uiTitle, UInt32 maxDisplayedSavedGames, 부울 showCreateSaveUI, 부울 showDeleteSaveUI, System.Action`2 콜백) [0x00000] 0 : 02-06 20 : 03 : 38.804 : I/Unity (32369) : GameManager.ShowSelectGame() [0x00000] in : 0

그러나 로그인 할 때마다 성공할 수 있습니다.

+0

업데이트 : 문제는 PlayGamesPlatform.Activate()에 의해 해결되었습니다. 먼저 Social.localUser.Authenticate. –

답변

0

이 문제는 두 부분으로 나누어 해결되었습니다. 게임 시작시 플랫폼 활성화를 호출합니다. 그런 다음 로그인을 요청하십시오.