Example #1
0
    public static void InitializeInstance(PlayGamesClientConfiguration configuration) {
        if (sInstance != null) {
            Logger.w("PlayGamesPlatform already initialized. Ignoring this call.");
            return;
        }

        sInstance = new PlayGamesPlatform(configuration);
    }
    internal static IPlayGamesClient GetPlatformPlayGamesClient(
        PlayGamesClientConfiguration config) {
        if (Application.isEditor) {
            Logger.d("Creating IPlayGamesClient in editor, using DummyClient.");
            return new GooglePlayGames.BasicApi.DummyClient();
        }
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))
        Logger.d("Creating real IPlayGamesClient");
        return new GooglePlayGames.Native.NativeClient(config);
#else
            Logger.d("Cannot create IPlayGamesClient for unknown platform, returning DummyClient");
            return new GooglePlayGames.BasicApi.DummyClient();
#endif
    }
    void Start() {
        instance = this;
        config = new PlayGamesClientConfiguration.Builder().Build();
        PlayGamesPlatform.Activate();

        if (!Social.localUser.authenticated)
        {
            Social.localUser.Authenticate((bool success) =>
            {
                if (success) { }
                else { }

            });
        }
	}
 internal static IPlayGamesClient GetPlatformPlayGamesClient(
     PlayGamesClientConfiguration config)
 {
     if (Application.isEditor)
     {
         GooglePlayGames.OurUtils.Logger.d("Creating IPlayGamesClient in editor, using DummyClient.");
         return new GooglePlayGames.BasicApi.DummyClient();
     }
     #if UNITY_ANDROID
         GooglePlayGames.OurUtils.Logger.d("Creating Android IPlayGamesClient Client");
         return new GooglePlayGames.Native.NativeClient(config,
             new GooglePlayGames.Android.AndroidClient());
     #elif (UNITY_IPHONE && !NO_GPGS)
         Logger.d("Creating IOS IPlayGamesClient");
         return new GooglePlayGames.Native.NativeClient(config,
     new GooglePlayGames.IOS.IOSClient());
     #else
     GooglePlayGames.OurUtils.Logger.d("Cannot create IPlayGamesClient for unknown platform, returning DummyClient");
         return new GooglePlayGames.BasicApi.DummyClient();
     #endif
 }
	private void Init ()
	{
		#if UNITY_ANDROID
		GPGConfig = new PlayGamesClientConfiguration.Builder ().EnableSavedGames ().Build ();
		PlayGamesPlatform.InitializeInstance (GPGConfig);
		PlayGamesPlatform.DebugLogEnabled = true;
		PlayGamesPlatform.Activate ();

        print("Init GooglePlay");
		#endif


		Social.localUser.Authenticate (
			(bool success) => {
				print (" - Social:SignIn = " + success);

				if (success) {
					this.m_login = true;
				} else {
					this.m_login = false;
				}
			} 
		);
	}
 private PlayGamesPlatform(PlayGamesClientConfiguration configuration)
 {
     this.mLocalUser = new PlayGamesLocalUser(this);
     this.mConfiguration = configuration;
 }
 internal PlayGamesPlatform(IPlayGamesClient client)
 {
     this.mClient = Misc.CheckNotNull(client);
     this.mLocalUser = new PlayGamesLocalUser(this);
     this.mConfiguration = PlayGamesClientConfiguration.DefaultConfiguration;
 }
 public NativeClient(PlayGamesClientConfiguration configuration) {
     PlayGamesHelperObject.CreateObject();
     this.mConfiguration = Misc.CheckNotNull(configuration);
 }
Example #9
0
 static PlayGamesClientConfiguration()
 {
     DefaultConfiguration = new Builder().Build();
 }
 static PlayGamesClientConfiguration()
 {
     DefaultConfiguration = new Builder().WithPermissionRationale("Select email address to send to this game or hit cancel to not share.").Build();
 }