public static ServerAchievement GetAchievement()
        {
            if (AccelByteServerPlugin.achievement == null)
            {
                CheckPlugin();
                AccelByteServerPlugin.achievement = new ServerAchievement(
                    new ServerAchievementApi(
                        AccelByteServerPlugin.config.AchievementServerUrl,
                        AccelByteServerPlugin.httpWorker),
                    AccelByteServerPlugin.session,
                    AccelByteServerPlugin.config.Namespace,
                    AccelByteServerPlugin.coroutineRunner);
            }

            return(AccelByteServerPlugin.achievement);
        }
        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;
                }
            };
        }
Пример #3
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;
            };
        }