コード例 #1
0
        void CreateClient()
        {
            string id = GamerPlatformSettings.Instance.PlayerId;

            var builder = new GoogleApiClientBuilder(AppMain.Activity, this, this);

            builder.AddApi(Android.Gms.Games.GamesClass.Api);
            builder.AddScope(Android.Gms.Games.GamesClass.ScopeGames);
            builder.SetGravityForPopups((int)GravityForPopups);

            builder.SetViewForPopups(AppMain.Current.RootView);

            if (!string.IsNullOrEmpty(id))
            {
                builder.SetAccountName(id);
            }

            _client = builder.Build();
        }
コード例 #2
0
ファイル: GameHelper.Android.cs プロジェクト: prepare/Sitana
        private void CreateClient()
        {
            // did we log in with a player id already? If so we don't want to ask which account to use
            var settings = this.activity.GetSharedPreferences("googleplayservicessettings", FileCreationMode.Private);
            var id       = settings.GetString("playerid", String.Empty);

            var builder = new GoogleApiClientBuilder(activity, this, this);

            builder.AddApi(Android.Gms.Games.GamesClass.Api);
            builder.AddScope(Android.Gms.Games.GamesClass.ScopeGames);
            builder.SetGravityForPopups((int)GravityForPopups);
            if (ViewForPopups != null)
            {
                builder.SetViewForPopups(ViewForPopups);
            }
            if (!string.IsNullOrEmpty(id))
            {
                builder.SetAccountName(id);
            }
            client = builder.Build();
        }
コード例 #3
0
		private void CreateClient() {

			// did we log in with a player id already? If so we don't want to ask which account to use
			var settings = this.activity.GetSharedPreferences ("googleplayservicessettings", FileCreationMode.Private);
			var id = settings.GetString ("playerid", String.Empty);

			var builder = new GoogleApiClientBuilder (activity, this, this);
			builder.AddApi (Android.Gms.Games.GamesClass.Api);
			builder.AddScope (Android.Gms.Games.GamesClass.ScopeGames);
			builder.SetGravityForPopups ((int)GravityForPopups);
			if (ViewForPopups != null)
				builder.SetViewForPopups (ViewForPopups);
			if (!string.IsNullOrEmpty (id)) {
				builder.SetAccountName (id);
			}
			client = builder.Build ();
		}