public static ServerEcommerce GetEcommerce()
        {
            if (AccelByteServerPlugin.ecommerce == null)
            {
                AccelByteServerPlugin.ecommerce = new ServerEcommerce(
                    new ServerEcommerceApi(
                        AccelByteServerPlugin.config.PlatformServerUrl,
                        AccelByteServerPlugin.httpWorker),
                    AccelByteServerPlugin.session,
                    AccelByteServerPlugin.config.Namespace,
                    AccelByteServerPlugin.coroutineRunner);
            }

            return(AccelByteServerPlugin.ecommerce);
        }
Esempio n. 2
0
        public static ServerEcommerce GetEcommerce()
        {
            if (AccelByteServerPlugin.ecommerce != null)
            {
                return(AccelByteServerPlugin.ecommerce);
            }

            AccelByteServerPlugin.CheckPlugin();
            AccelByteServerPlugin.ecommerce = new ServerEcommerce(
                new ServerEcommerceApi(
                    AccelByteServerPlugin.config.PlatformServerUrl,
                    AccelByteServerPlugin.httpClient),
                AccelByteServerPlugin.session,
                AccelByteServerPlugin.config.Namespace,
                AccelByteServerPlugin.coroutineRunner);

            return(AccelByteServerPlugin.ecommerce);
        }
        static AccelByteServerPlugin()
        {
#if UNITY_EDITOR // Handle an unexpected behaviour if Domain Reload (experimental) is disabled
            EditorApplication.playModeStateChanged += state =>
            {
                if (state == PlayModeStateChange.ExitingEditMode)
                {
                    hasBeenInitialized = false;

                    accessToken            = null;
                    server                 = null;
                    dedicatedServerManager = null;
                    ecommerce              = null;
                    statistic              = null;
                    qos           = null;
                    gameTelemetry = null;
                    achievement   = null;
                    lobby         = null;
                    cloudSave     = null;
                }
            };
        }
Esempio n. 4
0
        static AccelByteServerPlugin()
        {
#if UNITY_EDITOR // Handle an unexpected behaviour if Domain Reload (experimental) is disabled
            EditorApplication.playModeStateChanged += state =>
            {
                if (state != PlayModeStateChange.ExitingEditMode)
                {
                    return;
                }

                AccelByteServerPlugin.hasBeenInitialized     = false;
                AccelByteServerPlugin.accessToken            = null;
                AccelByteServerPlugin.server                 = null;
                AccelByteServerPlugin.dedicatedServerManager = null;
                AccelByteServerPlugin.ecommerce              = null;
                AccelByteServerPlugin.statistic              = null;
                AccelByteServerPlugin.qos           = null;
                AccelByteServerPlugin.gameTelemetry = null;
                AccelByteServerPlugin.achievement   = null;
                AccelByteServerPlugin.lobby         = null;
                AccelByteServerPlugin.cloudSave     = null;
                AccelByteServerPlugin.seasonPass    = null;
            };
        }