Ejemplo n.º 1
0
    private void Init()
    {
        _IsInitedCalled = true;

        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            dataEventsCount = UltimateMobileSettings.Instance.Leaderboards.Count + 1;


            foreach (UM_Achievement achievment in UltimateMobileSettings.Instance.Achievements)
            {
                GameCenterManager.RegisterAchievement(achievment.IOSId);
            }
            break;

        case RuntimePlatform.Android:
            dataEventsCount = 2;
            break;
        }



        GooglePlayConnection.instance.addEventListener(GooglePlayConnection.PLAYER_CONNECTED, OnAndroidPlayerConnected);
        GooglePlayConnection.instance.addEventListener(GooglePlayConnection.PLAYER_DISCONNECTED, OnAndroidPlayerDisconnected);
        GooglePlayManager.instance.addEventListener(GooglePlayManager.ACHIEVEMENTS_LOADED, OnServiceDataLoaded);
        GooglePlayManager.instance.addEventListener(GooglePlayManager.LEADERBOARDS_LOADED, OnServiceDataLoaded);



        GameCenterManager.OnAuthFinished += OnAuthFinished;

        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_ACHIEVEMENTS_LOADED, OnServiceDataLoaded);
        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_LEADERBOARD_SCORE_LOADED, OnServiceDataLoaded);
    }
Ejemplo n.º 2
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------



    void Awake()
    {
        if (!IsInitialized)
        {
            //Achievement registration. If you skip this step GameCenterManager.achievements array will contain only achievements with reported progress
            GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID);
            GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID);


            //Listen for the Game Center events
            GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress;
            GameCenterManager.OnAchievementsReset    += HandleOnAchievementsReset;
            GameCenterManager.OnAchievementsLoaded   += OnAchievementsLoaded;


            GameCenterManager.OnScoreSubmitted       += OnScoreSubmitted;
            GameCenterManager.OnLeadrboardInfoLoaded += OnLeadrboardInfoLoaded;



            GameCenterManager.OnAuthFinished += OnAuthFinished;


            //Initializing Game Center class. This action will trigger authentication flow
            GameCenterManager.Init();
            IsInitialized = true;
        }
    }
Ejemplo n.º 3
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------



    void Awake()
    {
        if (!IsInitialized)
        {
            //Achievement registration. If you skip this step GameCenterManager.achievements array will contain only achievements with reported progress
            GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID);
            GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID);


            //Listen for the Game Center events
            GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_ACHIEVEMENT_PROGRESS, OnAchievementProgress);
            GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_ACHIEVEMENTS_RESET, OnAchievementsReset);


            GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_LEADERBOARD_SCORE_LOADED, OnLeaderboardScoreLoaded);



            //actions use example
            GameCenterManager.OnPlayerScoreLoaded += OnPlayerScoreLoaded;
            GameCenterManager.OnAuthFinished      += OnAuthFinished;

            GameCenterManager.OnAchievementsLoaded += OnAchievementsLoaded;


            //Initializing Game Center class. This action will trigger authentication flow
            GameCenterManager.init();
            IsInitialized = true;
        }
    }
    private void Init()
    {
        _IsInitedCalled = true;

        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            dataEventsCount = UltimateMobileSettings.Instance.Leaderboards.Count + 1;


            foreach (UM_Achievement achievment in UltimateMobileSettings.Instance.Achievements)
            {
                GameCenterManager.RegisterAchievement(achievment.IOSId);
            }

            break;

        case RuntimePlatform.Android:
            dataEventsCount = 2;
            break;
        }



        GooglePlayConnection.ActionPlayerConnected    += OnAndroidPlayerConnected;
        GooglePlayConnection.ActionPlayerDisconnected += OnAndroidPlayerDisconnected;
        GooglePlayManager.ActionAchievementsLoaded    += OnGooglePlayServiceDataLoaded;
        GooglePlayManager.ActionLeaderboardsLoaded    += OnGooglePlayServiceDataLoaded;



        GameCenterManager.OnAuthFinished       += OnAuthFinished;
        GameCenterManager.OnAchievementsLoaded += OnGameCenterServiceDataLoaded;
        GameCenterManager.OnPlayerScoreLoaded  += OnGameCenterServiceDataLoaded;
    }
    void Start()
    {
        GameCenterManager.OnAuthFinished   += OnAuthFinished;
        GameCenterManager.OnScoreSubmitted += OnScoreSubmitted;

        GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress;
        GameCenterManager.OnAchievementsReset    += HandleOnAchievementsReset;
        GameCenterManager.OnAchievementsLoaded   += OnAchievementsLoaded;

        //Achievement registration. If you skip this step GameCenterManager.achievements array will contain only achievements with reported progress
        GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID);
        GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID);

        GameCenterManager.OnGameCenterViewDismissed += GameCenterManager_OnGameCenterViewDismissed;



        //Initializing Game Center class. This action will trigger authentication flow
        GameCenterManager.Init();
    }
Ejemplo n.º 6
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------



    void InitGameCneter()
    {
        //Achievement registration. If you will skipt this step GameCenterManager.achievements array will contain only achievements with reported progress
        GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID);
        GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID);


        //Listen for the Game Center events
        GameCenterManager.OnAchievementsLoaded   += HandleOnAchievementsLoaded;
        GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress;
        GameCenterManager.OnAchievementsReset    += HandleOnAchievementsReset;


        GameCenterManager.OnPlayerScoreLoaded += HandleOnPlayerScoreLoaded;
        GameCenterManager.OnAuthFinished      += HandleOnAuthFinished;


        DontDestroyOnLoad(gameObject);

        GameCenterManager.Init();

        Debug.Log("InitGameCenter");
    }
Ejemplo n.º 7
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------



    void InitGameCneter()
    {
        //Achievement registration. If you will skipt this step GameCenterManager.achievements array will contain only achievements with reported progress
        GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID);
        GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID);


        //Listen for the Game Center events
        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_ACHIEVEMENTS_LOADED, OnAchievementsLoaded);
        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_ACHIEVEMENT_PROGRESS, OnAchievementProgress);
        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_ACHIEVEMENTS_RESET, OnAchievementsReset);


        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_LEADERBOARD_SCORE_LOADED, OnLeaderboardScoreLoaded);

        GameCenterManager.Dispatcher.addEventListener(GameCenterManager.GAME_CENTER_PLAYER_AUTHENTICATED, OnAuth);

        DontDestroyOnLoad(gameObject);

        GameCenterManager.init();

        Debug.Log("InitGameCenter");
    }
    private void Init()
    {
        _IsInitedCalled  = true;
        _DataEventsCount = 0;


        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:

            if (UltimateMobileSettings.Instance.AutoLoadAchievementsInfo)
            {
                _DataEventsCount += 1;
                GameCenterManager.OnAchievementsLoaded += OnGameCenterServiceDataLoaded;
            }

            if (UltimateMobileSettings.Instance.AutoLoadLeaderboardsInfo)
            {
                _DataEventsCount += UltimateMobileSettings.Instance.Leaderboards.Count;
            }
            GameCenterManager.OnLeadrboardInfoLoaded += OnGameCenterServiceLeaderDataLoaded;

            foreach (UM_Achievement achievment in UltimateMobileSettings.Instance.Achievements)
            {
                GameCenterManager.RegisterAchievement(achievment.IOSId);
            }

            GameCenterManager.OnAuthFinished += OnAuthFinished;


            GameCenterManager.OnScoreSubmitted    += IOS_HandleOnScoreSubmitted;
            GameCenterManager.OnScoresListLoaded  += IOS_HandleOnScoresListLoaded;
            GameCenterManager.OnFriendsListLoaded += IOS_OnFriendsListLoaded;

            GameCenterManager.OnAchievementsLoaded   += IOS_AchievementsDataLoaded;
            GameCenterManager.OnLeadrboardInfoLoaded += IOS_LeaderboardsDataLoaded;


            break;

        case RuntimePlatform.Android:
            if (UltimateMobileSettings.Instance.PlatformEngine == UM_PlatformDependencies.Amazon)
            {
                _DataEventsCount++;

                if (UltimateMobileSettings.Instance.AutoLoadAchievementsInfo)
                {
                    _DataEventsCount++;
                    SA_AmazonGameCircleManager.Instance.OnRequestAchievementsReceived += OnAmazonGameCircleRequestAchievementsReceived;
                }

                if (UltimateMobileSettings.Instance.AutoLoadLeaderboardsInfo)
                {
                    //Important: For every Leaderboard 3 requests will be performed + 1 request for Leaderboards Metadata Request
                    _DataEventsCount += UltimateMobileSettings.Instance.Leaderboards.Count * 3 + 1;
                    SA_AmazonGameCircleManager.Instance.OnRequestLeaderboardsReceived += OnAmazonGameCircleRequestLeaderboardsReceived;
                }

                SA_AmazonGameCircleManager.Instance.OnInitializeResult            += OnAmazonInitializeResult;
                SA_AmazonGameCircleManager.Instance.OnRequestPlayerDataReceived   += OnAmazonRequestPlayerDataReceived;
                SA_AmazonGameCircleManager.Instance.OnRequestAchievementsReceived += OnAmazonRequestAchievementsReceived;
                SA_AmazonGameCircleManager.Instance.OnRequestLeaderboardsReceived += OnAmazonRequestLeaderboardsReceived;
                SA_AmazonGameCircleManager.Instance.OnSubmitLeaderboardReceived   += OnAmazonSubmitLeaderboardReceived;
                SA_AmazonGameCircleManager.Instance.OnScoresLoaded += OnAmazonScoresLoaded;
            }
            else
            {
                if (UltimateMobileSettings.Instance.AutoLoadAchievementsInfo)
                {
                    _DataEventsCount += 1;
                    GooglePlayManager.ActionAchievementsLoaded += OnGooglePlayServiceDataLoaded;
                }

                if (UltimateMobileSettings.Instance.AutoLoadLeaderboardsInfo)
                {
                    _DataEventsCount += 1;
                }
                GooglePlayManager.ActionLeaderboardsLoaded += OnGooglePlayLeaderDataLoaded;

                GooglePlayConnection.ActionPlayerConnected    += OnAndroidPlayerConnected;
                GooglePlayConnection.ActionPlayerDisconnected += OnAndroidPlayerDisconnected;
                GooglePlayManager.ActionScoreSubmited         += Android_HandleActionScoreSubmited;
                GooglePlayManager.ActionScoresListLoaded      += Android_HandleActionScoresListLoaded;


                GooglePlayManager.ActionFriendsListLoaded  += Android_ActionFriendsListLoaded;
                GooglePlayManager.ActionAchievementsLoaded += Android_AchievementsDataLoaded;
                GooglePlayManager.ActionLeaderboardsLoaded += Android_LeaderboardsDataLoaded;
            }
            break;
        }
    }
Ejemplo n.º 9
0
    private void Init()
    {
        _IsInitedCalled  = true;
        _DataEventsCount = 0;


        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:

            if (UltimateMobileSettings.Instance.AutoLoadAchievementsInfo)
            {
                _DataEventsCount += 1;
                GameCenterManager.OnAchievementsLoaded += OnGameCenterServiceDataLoaded;
            }

            if (UltimateMobileSettings.Instance.AutoLoadLeaderboardsInfo)
            {
                _DataEventsCount += UltimateMobileSettings.Instance.Leaderboards.Count;
            }
            GameCenterManager.OnLeadrboardInfoLoaded += OnGameCenterServiceLeaderDataLoaded;

            foreach (UM_Achievement achievment in UltimateMobileSettings.Instance.Achievements)
            {
                GameCenterManager.RegisterAchievement(achievment.IOSId);
            }

            GameCenterManager.OnAuthFinished += OnAuthFinished;


            GameCenterManager.OnScoreSubmitted    += IOS_HandleOnScoreSubmitted;
            GameCenterManager.OnScoresListLoaded  += IOS_HandleOnScoresListLoaded;
            GameCenterManager.OnFriendsListLoaded += IOS_OnFriendsListLoaded;

            GameCenterManager.OnAchievementsLoaded   += IOS_AchievementsDataLoaded;
            GameCenterManager.OnLeadrboardInfoLoaded += IOS_LeaderboardsDataLoaded;


            break;

        case RuntimePlatform.Android:

            if (UltimateMobileSettings.Instance.AutoLoadAchievementsInfo)
            {
                _DataEventsCount += 1;
                GooglePlayManager.ActionAchievementsLoaded += OnGooglePlayServiceDataLoaded;
            }

            if (UltimateMobileSettings.Instance.AutoLoadLeaderboardsInfo)
            {
                _DataEventsCount += 1;
            }
            GooglePlayManager.ActionLeaderboardsLoaded += OnGooglePlayLeaderDataLoaded;

            GooglePlayConnection.ActionPlayerConnected    += OnAndroidPlayerConnected;
            GooglePlayConnection.ActionPlayerDisconnected += OnAndroidPlayerDisconnected;
            GooglePlayManager.ActionScoreSubmited         += Android_HandleActionScoreSubmited;
            GooglePlayManager.ActionScoresListLoaded      += Android_HandleActionScoresListLoaded;


            GooglePlayManager.ActionFriendsListLoaded  += Android_ActionFriendsListLoaded;
            GooglePlayManager.ActionAchievementsLoaded += Android_AchievementsDataLoaded;
            GooglePlayManager.ActionLeaderboardsLoaded += Android_LeaderboardsDataLoaded;

            break;
        }
    }