Пример #1
0
	private static void HandleOnFacebookPostResult (SA.Common.Models.Result res) {
		if(res.IsSucceeded) {
			SocialAction(ISN_SoomlaEvent.FINISHED, ISN_SoomlaAction.UPDATE_STORY, ISN_SoomlaProvider.FACEBOOK);
		} else {
			SocialAction(ISN_SoomlaEvent.CANCELLED, ISN_SoomlaAction.UPDATE_STORY, ISN_SoomlaProvider.FACEBOOK);
		}
	}
Пример #2
0
    private void PlusShareCallback(SA.Common.Models.Result result)
    {
        OnPlusShareResult(result);
        GameObject.Destroy(listenerObject);

        Debug.Log("AN_PlusShareListener was destroyed object reference equals " + listenerObject);
    }
Пример #3
0
	private static void HandleOnInstagramPostResult (SA.Common.Models.Result res) {
		if(res.IsSucceeded) {
			SocialAction(ISN_SoomlaEvent.FINISHED, ISN_SoomlaAction.UPDATE_STORY, ISN_SoomlaProvider.INSTAGRAM);
		} else {
			SocialAction(ISN_SoomlaEvent.FAILED, ISN_SoomlaAction.UPDATE_STORY, ISN_SoomlaProvider.INSTAGRAM);
		}
	}
Пример #4
0
    void OnLeaderboardSetsInfoLoaded(SA.Common.Models.Result res)
    {
        ISN_Logger.Log("OnLeaderboardSetsInfoLoaded");
        GameCenterManager.OnLeaderboardSetsInfoLoaded -= OnLeaderboardSetsInfoLoaded;
        if (res.IsSucceeded)
        {
            foreach (GK_LeaderboardSet s in GameCenterManager.LeaderboardSets)
            {
                ISN_Logger.Log(s.Title);
                ISN_Logger.Log(s.Identifier);
                ISN_Logger.Log(s.GroupIdentifier);
            }
        }


        if (GameCenterManager.LeaderboardSets.Count == 0)
        {
            return;
        }

        GK_LeaderboardSet LeaderboardSet = GameCenterManager.LeaderboardSets[0];

        LeaderboardSet.OnLoaderboardsInfoLoaded += OnLoaderboardsInfoLoaded;
        LeaderboardSet.LoadLeaderBoardsInfo();
    }
Пример #5
0
    //--------------------------------------
    //  PRIVATE METHODS
    //--------------------------------------

    private void FireSuccessInitEvent()
    {
        _IsStoreLoaded       = true;
        _IsWaitingLoadResult = false;
        SA.Common.Models.Result r = new SA.Common.Models.Result();
        OnStoreKitInitComplete(r);
    }
Пример #6
0
 void HandleOnAuthFinished(SA.Common.Models.Result r)
 {
     if (r.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Player Authenticated", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName);
     }
 }
    private void IOS_OnStoreKitInitComplete(SA.Common.Models.Result res)
    {
        UM_BillingConnectionResult r = new UM_BillingConnectionResult();

        _IsConnected = res.IsSucceeded;
        r.isSuccess  = res.IsSucceeded;
        if (res.IsSucceeded)
        {
            r.message = "Inited";

            foreach (UM_InAppProduct product in UltimateMobileSettings.Instance.InAppProducts)
            {
                Product tpl = PaymentManager.Instance.GetProductById(product.IOSId);
                if (tpl != null)
                {
                    product.SetTemplate(tpl);
                }
            }

            SendServiceConnectedEvent(r);
        }
        else
        {
            if (res.Error != null)
            {
                r.message = res.Error.Message;
            }

            SendServiceConnectedEvent(r);
        }
    }
 private void OnGameCenterServiceDataLoaded(SA.Common.Models.Result e)
 {
     _CurrentEventsCount++;
     if (_CurrentEventsCount == _DataEventsCount)
     {
         OnAllLoaded();
     }
 }
Пример #9
0
	private static void HandleOnTwitterPostResult (SA.Common.Models.Result res) {
		if(res.IsSucceeded) {
			SocialAction(ISN_SoomlaEvent.FINISHED, ISN_SoomlaAction.UPDATE_STORY, ISN_SoomlaProvider.TWITTER);
		} else {
			SocialAction(ISN_SoomlaEvent.FAILED, ISN_SoomlaAction.UPDATE_STORY, ISN_SoomlaProvider.TWITTER);
		}
		
	}
Пример #10
0
    private void OnInstaPostFailed(string data)
    {
        int code = System.Convert.ToInt32(data);

        SA.Common.Models.Error  error  = new SA.Common.Models.Error(code, "Posting Failed");
        SA.Common.Models.Result result = new SA.Common.Models.Result(error);
        OnInstagramPostResult(result);
    }
 private void OnFriendsListLoaded(SA.Common.Models.Result result)
 {
     GameCenterManager.OnFriendsListLoaded -= OnFriendsListLoaded;
     if (result.IsSucceeded)
     {
         renderFriendsList = true;
     }
 }
Пример #12
0
    void HandleActionPlayerQuitForMatch(GK_TBM_Match match)
    {
        Debug.Log("GK_TBM_Controller::HandleActionPlayerQuitForMatch");

        SA.Common.Models.Result r = new SA.Common.Models.Result();

        SendMatchUpdateEvent(r, match);
    }
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    void OnAuthFinished(SA.Common.Models.Result res)
    {
        if (res.IsSucceeded)
        {
            IOSNativePopUpManager.showMessage("Player Authed ", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName);
            cleanUpScene();
        }
    }
Пример #14
0
    public UM_Result(SA.Common.Models.Result result)
    {
        _IsSucceeded = result.IsSucceeded;

        if (!_IsSucceeded)
        {
            _Error = new UM_Error(result.Error.Code, result.Error.Message);
        }
    }
Пример #15
0
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    void HandleOnAchievementsLoaded(SA.Common.Models.Result res)
    {
        ISN_Logger.Log("Achievements loaded from iOS Game Center");

        foreach (GK_AchievementTemplate tpl in GameCenterManager.Achievements)
        {
            ISN_Logger.Log(tpl.Id + ":  " + tpl.Progress);
        }
    }
Пример #16
0
 void HandleOnFacebookPostResult(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Posting example", "Post Success!");
     }
     else
     {
         IOSNativePopUpManager.showMessage("Posting example", "Post Failed :(");
     }
 }
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

    //--------------------------------------
    //  EVENTS
    //--------------------------------------



    private void OnCloundInitAction(SA.Common.Models.Result result)
    {
        if (result.IsSucceeded)
        {
            IOSNativePopUpManager.showMessage("iCloud", "Initialization Success!");
        }
        else
        {
            IOSNativePopUpManager.showMessage("iCloud", "Initialization Failed!");
        }
    }
 void HandleOnAuthFinished(SA.Common.Models.Result result)
 {
     if (result.IsSucceeded)
     {
         ISN_Logger.Log("Player Authed");
     }
     else
     {
         IOSNativePopUpManager.showMessage("Game Center ", "Player authentication failed");
     }
 }
 private void OnAuthFinished(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Player Authed ", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName);
     }
     else
     {
         IOSNativePopUpManager.showMessage("Game Center ", "Player authentication failed");
     }
 }
Пример #20
0
 private void OnMailResult(SA.Common.Models.Result result)
 {
     if (result.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Posting example", "Mail Sent");
     }
     else
     {
         IOSNativePopUpManager.showMessage("Posting example", "Mail Failed :(");
     }
 }
Пример #21
0
 private void OnImageSaved(SA.Common.Models.Result result)
 {
     IOSCamera.OnImageSaved -= OnImageSaved;
     if (result.IsSucceeded)
     {
         IOSMessage.Create("Success", "Image Successfully saved to Camera Roll");
     }
     else
     {
         IOSMessage.Create("ERROR", "Image Save Failed");
     }
 }
Пример #22
0
 void OnReceiptRefreshComplete(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         IOSDialog dialog = IOSDialog.Create("Success", "Receipt Refreshed, would you like to check it again?");
         dialog.OnComplete += Dialog_RetrieveLocalReceipt;
     }
     else
     {
         IOSNativePopUpManager.showMessage("Fail", "Receipt Refresh Failed");
     }
 }
 private void OnScoresListLoaded(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         loadedLeaderboard = GameCenterManager.GetLeaderboard(leaderboardId_1);
         IOSMessage.Create("Success", "Scores loaded");
     }
     else
     {
         IOSMessage.Create("Fail", "Failed to load scores");
     }
 }
Пример #24
0
 void OnAuthFinished(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Player Authed ", "ID: " + GameCenterManager.Player.Id + "\n" + "Alias: " + GameCenterManager.Player.Alias);
         GameCenterManager.LoadLeaderboardInfo(TEST_LEADERBOARD_1);
     }
     else
     {
         IOSNativePopUpManager.showMessage("Game Center ", "Player authentication failed");
     }
 }
    //--------------------------------------
    // IOS Events
    //--------------------------------------



    private void OnAuthFinished(SA.Common.Models.Result res)
    {
        if (res.IsSucceeded)
        {
            OnServiceConnected();
        }
        else
        {
            SetConnectionState(UM_ConnectionState.DISCONNECTED);
            OnPlayerDisconnected();
        }
    }
 void HandleActionRecordStarted(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Success", "Record was successfully started!");
     }
     else
     {
         ISN_Logger.Log("Record start failed: " + res.Error.Message);
         IOSNativePopUpManager.showMessage("Fail", "Error: " + res.Error.Message);
     }
     ISN_ReplayKit.ActionRecordStarted -= HandleActionRecordStarted;
 }
Пример #27
0
    //--------------------------------------
    // Private Methods
    //--------------------------------------


    public void SendMatchUpdateEvent(SA.Common.Models.Result res, GK_TBM_Match match)
    {
        UM_TBM_MatchResult result = new UM_TBM_MatchResult(res);

        if (match != null)
        {
            UM_TBM_Match m = new UM_TBM_Match(match);
            result.SetMatch(m);
            UpdateMatchData(m);
        }

        MatchUpdatedEvent(result);
    }
Пример #28
0
    private void OnScoreSubmitted(SA.Common.Models.Result result)
    {
        GameCenterManager.OnScoreSubmitted -= OnScoreSubmitted;

        if (result.IsSucceeded)
        {
            ISN_Logger.Log("Score Submitted");
        }
        else
        {
            ISN_Logger.Log("Score Submit Failed");
        }
    }
 void HandleActionRecordStoped(SA.Common.Models.Result res)
 {
     if (res.IsSucceeded)
     {
         //the record is stopped, we can now show the sharing dialog.
         //you do not hae to show sharing dialog right after video was stopped
         //you can do this when user press "Share Replay" button in your game UI.
         ISN_ReplayKit.Instance.ShowVideoShareDialog();
     }
     else
     {
         IOSNativePopUpManager.showMessage("Fail", "Error: " + res.Error.Message);
     }
 }
Пример #30
0
    private void Event_ReceiptRefreshRequestReceived(string data)
    {
        SA.Common.Models.Result result;
        if (data.Equals("1"))
        {
            result = new SA.Common.Models.Result();
        }
        else
        {
            result = new SA.Common.Models.Result(new SA.Common.Models.Error());
        }

        OnReceiptRefreshComplete(result);
    }