Esempio n. 1
0
        public PlatformConfiguration CreatePlatformConfiguration(PlayGamesClientConfiguration clientConfig)
        {
            AndroidPlatformConfiguration androidPlatformConfiguration = AndroidPlatformConfiguration.Create();
            AndroidJavaObject            activity = AndroidTokenClient.GetActivity();

            try
            {
                androidPlatformConfiguration.SetActivity(activity.GetRawObject());
                androidPlatformConfiguration.SetOptionalIntentHandlerForUI(delegate(IntPtr intent)
                {
                    IntPtr intentRef = AndroidJNI.NewGlobalRef(intent);
                    PlayGamesHelperObject.RunOnGameThread(delegate
                    {
                        try
                        {
                            LaunchBridgeIntent(intentRef);
                        }
                        finally
                        {
                            AndroidJNI.DeleteGlobalRef(intentRef);
                        }
                    });
                });
                if (!clientConfig.IsHidingPopups)
                {
                    return(androidPlatformConfiguration);
                }
                androidPlatformConfiguration.SetOptionalViewForPopups(CreateHiddenView(activity.GetRawObject()));
                return(androidPlatformConfiguration);
            }
            finally
            {
                ((IDisposable)activity)?.Dispose();
            }
        }
Esempio n. 2
0
        public PlatformConfiguration CreatePlatformConfiguration()
        {
            AndroidPlatformConfiguration platformConfiguration = AndroidPlatformConfiguration.Create();

            platformConfiguration.EnableAppState();
            using (AndroidJavaObject activity = AndroidTokenClient.GetActivity())
            {
                platformConfiguration.SetActivity(activity.GetRawObject());
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: reference to a compiler-generated method
                platformConfiguration.SetOptionalIntentHandlerForUI((Action <IntPtr>)(intent => PlayGamesHelperObject.RunOnGameThread(new Action(new AndroidClient.\u003CCreatePlatformConfiguration\u003Ec__AnonStorey100()
                {
                    intentRef = AndroidJNI.NewGlobalRef(intent)
                }.\u003C\u003Em__D))));
            }
            return((PlatformConfiguration)platformConfiguration);
        }