Exemplo n.º 1
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    //--------------------------------------
    //  GET/SET
    //--------------------------------------

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

    private void OnCloudInit()
    {
        ISN_Result res = new ISN_Result(true);

        OnCloundInitAction(res);
        dispatch(CLOUD_INITIALIZED);
    }
Exemplo n.º 2
0
    private void OnCloudInitFail()
    {
        ISN_Result res = new ISN_Result(false);

        OnCloundInitAction(res);
        dispatch(CLOUD_INITIALIZE_FAILED);
    }
Exemplo n.º 3
0
    void OnLeaderboardSetsInfoLoaded(ISN_Result res)
    {
        Debug.Log("OnLeaderboardSetsInfoLoaded");
        GameCenterManager.OnLeaderboardSetsInfoLoaded -= OnLeaderboardSetsInfoLoaded;
        if (res.IsSucceeded)
        {
            foreach (GK_LeaderboardSet s in GameCenterManager.LeaderboardSets)
            {
                Debug.Log(s.Title);
                Debug.Log(s.Identifier);
                Debug.Log(s.GroupIdentifier);
            }
        }


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

        GK_LeaderboardSet LeaderboardSet = GameCenterManager.LeaderboardSets[0];

        LeaderboardSet.OnLoaderboardsInfoLoaded += OnLoaderboardsInfoLoaded;
        LeaderboardSet.LoadLeaderBoardsInfo();
    }
Exemplo n.º 4
0
    void OnIOSImageSaved(ISN_Result res)
    {
        UM_ImageSaveResult result = new UM_ImageSaveResult(string.Empty, res.IsSucceeded);

        OnImageSaved(result);
        dispatch(IMAGE_SAVED, result);
    }
Exemplo n.º 5
0
    private void onFriendListFailedToLoad(string data)
    {
        ISN_Result result = new ISN_Result(false);

        OnFriendsListLoaded(result);
        dispatcher.dispatch(GAME_CENTER_FRIEND_LIST_LOADED, result);
    }
Exemplo n.º 6
0
    private void OnImageSaveFailed()
    {
        ISN_Result result = new ISN_Result(false);

        dispatch(IMAGE_SAVED, result);
        OnImageSaved(result);
    }
Exemplo n.º 7
0
    //public Action<IOSStoreKitResult> OnTransactionComplete = delegate{};
    //public Action<ISN_Result> OnStoreKitInitComplete = delegate{};


    private static void OnStoreKitInitComplete(ISN_Result result)
    {
        IOSInAppPurchaseManager.OnStoreKitInitComplete -= OnStoreKitInitComplete;

        if (result.IsSucceeded)
        {
            Debug.Log("Inited successfully, Available products count: " + IOSInAppPurchaseManager.Instance.Products.Count.ToString());
            foreach (IOSProductTemplate tpl in IOSInAppPurchaseManager.Instance.Products)
            {
                Debug.Log(string.Format("id:{0} title:{1} description:{2} price:{3} localizedPrice:{4} currencySymbol:{5} currencyCode:{6}",
                                        tpl.Id,
                                        tpl.Title,
                                        tpl.Description,
                                        tpl.Price,
                                        tpl.LocalizedPrice,
                                        tpl.CurrencySymbol,
                                        tpl.CurrencyCode));
                Debug.Log("-------------");
            }
        }
        else
        {
            Debug.LogError("StoreKit Init Failed.  Error code: " + result.Error.Code + "\n" + "Error description:" + result.Error.Description);
        }
    }
Exemplo n.º 8
0
    private void onAchievementsLoaded(string array)
    {
        ISN_Result result = new ISN_Result(false);

        if (array.Equals(string.Empty))
        {
            OnAchievementsLoaded(result);
            dispatcher.dispatch(GAME_CENTER_ACHIEVEMENTS_LOADED, result);
            return;
        }

        string[] data;
        data = array.Split("," [0]);


        for (int i = 0; i < data.Length; i += 2)
        {
            AchievementTemplate tpl = new AchievementTemplate();
            tpl.id       = data[i];
            tpl.progress = System.Convert.ToSingle(data[i + 1]);
            submitAchievement(tpl);
        }

        _IsAchievmentInfoLoaded = true;
        OnAchievementsLoaded(result);
        dispatcher.dispatch(GAME_CENTER_ACHIEVEMENTS_LOADED, result);
    }
    private void OnStoreKitInitFailed(string data)
    {
        string[] storeData;
        storeData = data.Split("|" [0]);
        ISN_Error e = new ISN_Error();

        e.code        = System.Convert.ToInt32(storeData[0]);
        e.description = storeData[1];


        _IsStoreLoaded       = false;
        _IsWaitingLoadResult = false;


        ISN_Result res = new ISN_Result(false);

        res.error = e;
        dispatch(STORE_KIT_INITI_FAILED, res);
        OnStoreKitInitComplete(res);


        if (!IOSNativeSettings.Instance.DisablePluginLogs)
        {
            Debug.Log("STORE_KIT_INIT_FAILED Error: " + e.description);
        }
    }
Exemplo n.º 10
0
    private void onAchievementsLoadedFailed()
    {
        ISN_Result result = new ISN_Result(false);

        OnAchievementsLoaded(result);
        dispatcher.dispatch(GAME_CENTER_ACHIEVEMENTS_LOADED, result);
    }
Exemplo n.º 11
0
    private void onLeaderBoardScoreListLoadFailed(string array)
    {
        ISN_Result result = new ISN_Result(false);

        OnScoresListLoaded(result);
        dispatcher.dispatch(GAME_CENTER_LEADER_BOARD_SCORE_LIST_LOADED, result);
    }
Exemplo n.º 12
0
    public void onScoreSubmitedFailed(string data)
    {
        ISN_Result result = new ISN_Result(false);

        OnScoreSubmited(result);
        dispatcher.dispatch(SCORE_SUMBITED, result);
    }
Exemplo n.º 13
0
    private void OnImageSaveSuccess()
    {
        ISN_Result result = new ISN_Result(true);

        dispatch(IMAGE_SAVED, result);
        OnImageSaved(result);
    }
Exemplo n.º 14
0
    private void IOS_OnStoreKitInitComplete(ISN_Result res)
    {
        UM_BillingConnectionResult r = new UM_BillingConnectionResult();

        _IsInited = true;
        _IsPurchasingAvailable = res.IsSucceeded;
        r.isSuccess            = res.IsSucceeded;
        if (res.IsSucceeded)
        {
            r.message = "Inited";

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

            OnBillingConnectFinishedAction(r);
            dispatch(ON_BILLING_CONNECT_FINISHED, r);
        }
        else
        {
            if (res.error != null)
            {
                r.message = res.error.description;
            }

            OnBillingConnectFinishedAction(r);
            dispatch(ON_BILLING_CONNECT_FINISHED, r);
        }
    }
Exemplo n.º 15
0
    private void onAchievementsLoaded(string array)
    {
        ISN_Result result = new ISN_Result(true);

        if (array.Equals(string.Empty))
        {
            OnAchievementsLoaded(result);
            return;
        }

        string[] data;
        data = array.Split("," [0]);


        for (int i = 0; i < data.Length; i += 3)
        {
            GK_AchievementTemplate tpl = new GK_AchievementTemplate();
            tpl.Id          = data[i];
            tpl.Description = data[i + 1];
            tpl.Progress    = System.Convert.ToSingle(data[i + 2]);
            submitAchievement(tpl);
        }

        _IsAchievementsInfoLoaded = true;
        OnAchievementsLoaded(result);
    }
Exemplo n.º 16
0
    private void OnRecorStopSuccess()
    {
        _IsRecodingAvailableToShare = true;
        ISN_Result result = new ISN_Result(true);

        ActionRecordStoped(result);
    }
Exemplo n.º 17
0
 void HandleOnAuthFinished(ISN_Result r)
 {
     if (r.IsSucceeded)
     {
         IOSNativePopUpManager.showMessage("Player Authenticated", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName);
     }
 }
Exemplo n.º 18
0
    private void onAchievementsResetFailed(string array)
    {
        ISN_Result result = new ISN_Result(false);

        OnAchievementsReset(result);
        dispatcher.dispatch(GAME_CENTER_ACHIEVEMENTS_RESET, result);
    }
Exemplo n.º 19
0
	//--------------------------------------
	// Initialize
	//--------------------------------------

	public UM_Result(ISN_Result result) {
		_IsSucceeded = result.IsSucceeded;

		if(!_IsSucceeded) {
			_Error =  new UM_Error(result.Error.Code, result.Error.Description);
		}
	}
Exemplo n.º 20
0
    private void onStoreDataReceived(string data)
    {
        if (data.Equals(string.Empty))
        {
            Debug.Log("InAppPurchaseManager, no products avaiable: " + _products.Count.ToString());
            ISN_Result res = new ISN_Result(true);
            dispatch(STORE_KIT_INITIALIZED, res);
            OnStoreKitInitComplete(res);
            return;
        }


        string[] storeData;
        storeData = data.Split("|" [0]);

        for (int i = 0; i < storeData.Length; i += 7)
        {
            ProductTemplate tpl = new ProductTemplate();
            tpl.id             = storeData[i];
            tpl.title          = storeData[i + 1];
            tpl.description    = storeData[i + 2];
            tpl.localizedPrice = storeData[i + 3];
            tpl.price          = storeData[i + 4];
            tpl.currencyCode   = storeData[i + 5];
            tpl.currencySymbol = storeData[i + 6];
            _products.Add(tpl);
        }

        Debug.Log("InAppPurchaseManager, tottal products loaded: " + _products.Count.ToString());
        FireSuccsesInitEvent();
    }
Exemplo n.º 21
0
 private void OnFacebookPostSuccess()
 {
     if (OnFacebookPostResult != null)
     {
         ISN_Result result = new ISN_Result(true);
         OnFacebookPostResult(result);
     }
 }
Exemplo n.º 22
0
    //--------------------------------------
    //  GET/SET
    //--------------------------------------

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

    void OnAuthFinished(ISN_Result res)
    {
        if (res.IsSucceeded)
        {
            IOSNativePopUpManager.showMessage("Player Authed ", "ID: " + GameCenterManager.Player.PlayerId + "\n" + "Name: " + GameCenterManager.Player.DisplayName);
            cleanUpScene();
        }
    }
Exemplo n.º 23
0
 private void OnMailSuccess()
 {
     if (OnMailResult != null)
     {
         ISN_Result result = new ISN_Result(true);
         OnMailResult(result);
     }
 }
Exemplo n.º 24
0
    //--------------------------------------
    // Objective-C Delegates
    //--------------------------------------

    private void OnRecorStartSuccess(string data)
    {
        _IsRecording = true;

        ISN_Result result = new ISN_Result(true);

        ActionRecordStarted(result);
    }
Exemplo n.º 25
0
    //--------------------------------------
    //  PRIVATE METHODS
    //--------------------------------------

    private void FireSuccessInitEvent()
    {
        _IsStoreLoaded       = true;
        _IsWaitingLoadResult = false;
        ISN_Result r = new ISN_Result(true);

        OnStoreKitInitComplete(r);
    }
Exemplo n.º 26
0
    private void OnFriendListLoadFailEvent(string errorData)
    {
        ISN_Result result = new ISN_Result(false);

        result.SetErrorData(errorData);
        OnFriendsListLoaded(result);
        Dispatcher.dispatch(GAME_CENTER_FRIEND_LIST_LOADED, result);
    }
Exemplo n.º 27
0
 private void OnTwitterPostSuccess()
 {
     if (OnTwitterPostResult != null)
     {
         ISN_Result result = new ISN_Result(true);
         OnTwitterPostResult(result);
     }
 }
Exemplo n.º 28
0
 private void OnMailFailed()
 {
     if (OnMailResult != null)
     {
         ISN_Result result = new ISN_Result(false);
         OnMailResult(result);
     }
 }
Exemplo n.º 29
0
    //--------------------------------------
    //  EVENTS
    //--------------------------------------

    private void OnTwitterPostFailed()
    {
        if (OnTwitterPostResult != null)
        {
            ISN_Result result = new ISN_Result(false);
            OnTwitterPostResult(result);
        }
    }
Exemplo n.º 30
0
 private void OnFacebookPostFailed()
 {
     if (OnFacebookPostResult != null)
     {
         ISN_Result result = new ISN_Result(false);
         OnFacebookPostResult(result);
     }
 }
Exemplo n.º 31
0
 void OnAuthFinished(ISN_Result res)
 {
     if (res.IsSucceeded) {
         GlobalData.GameCenterActive = true;
     } else {
         GlobalData.GameCenterActive = false;
     }
 }
 private void OnFriendsListLoaded(ISN_Result result)
 {
     GameCenterManager.OnFriendsListLoaded -= OnFriendsListLoaded;
     if (result.IsSucceeded)
     {
         renderFriendsList = true;
     }
 }
Exemplo n.º 33
0
 private void GameCenterManager_OnAuthFinished(ISN_Result obj)
 {
     if (obj.IsSucceeded)
     {
         //IOSNativePopUpManager.showMessage("Player Authored ", "ID: " + GameCenterManager.Id + "\n" + "Alias: " + GameCenterManager.Player.Alias);
     }
     else {
         IOSNativePopUpManager.showMessage("Game Center ", "Player auth failed");
     }
 }
Exemplo n.º 34
0
	void HandleActionRecordStoped (ISN_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.Description);
		}

	}
	void OnAuthFinished (ISN_Result res) {
		_IsUILocked = true;

		IOSMessage msg = null;
		if (res.IsSucceeded) {
			
			msg = IOSMessage.Create("Player Authed ", "ID: " + GameCenterManager.Player.Id + "\n" + "Alias: " + GameCenterManager.Player.Alias);
			GameCenterManager.LoadLeaderboardInfo(TEST_LEADERBOARD_1);
		} else {
			msg = IOSMessage.Create("Game Center ", "Player authentication failed");
		}

		msg.OnComplete += delegate {
			_IsUILocked = false;
		};
	}
Exemplo n.º 36
0
	void HandleOnAuthFinished (ISN_Result r) {
		if (r.IsSucceeded) {
			IOSNativePopUpManager.showMessage("Player Authenticated", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName);
		}
	}
Exemplo n.º 37
0
	void HandleOnAchievementsReset (ISN_Result res) {
		ISN_Logger.Log ("All Achievements were reset");
	}
Exemplo n.º 38
0
	private static void OnStoreKitInitComplete(ISN_Result result) {

		if(result.IsSucceeded) {

			int avaliableProductsCount = 0;
			foreach(IOSProductTemplate tpl in IOSInAppPurchaseManager.instance.Products) {
				if(tpl.IsAvaliable) {
					avaliableProductsCount++;
				}
			}

			IOSNativePopUpManager.showMessage("StoreKit Init Succeeded", "Available products count: " + avaliableProductsCount);
			Debug.Log("StoreKit Init Succeeded Available products count: " + avaliableProductsCount);
		} else {
			IOSNativePopUpManager.showMessage("StoreKit Init Failed",  "Error code: " + result.Error.Code + "\n" + "Error description:" + result.Error.Description);
		}
	}
Exemplo n.º 39
0
	//--------------------------------------
	//  EVENTS
	//--------------------------------------

	private void OnTwitterPostFailed() {
		dispatch(TWITTER_POST_FAILED);

		if(OnTwitterPostResult != null) {
			ISN_Result result = new ISN_Result(false);
			OnTwitterPostResult(result);
		}
	}
Exemplo n.º 40
0
	private void OnFriendListLoadedEvent(string data) {


		string[] fl;
		fl = data.Split(IOSNative.DATA_SPLITTER);

		for(int i = 0; i < fl.Length; i++) {
			_friendsList.Add(fl[i]);
		}

		if(!IOSNativeSettings.Instance.DisablePluginLogs) 
			Debug.Log("Friends list loaded, total friends: " + _friendsList.Count);


		ISN_Result result = new ISN_Result (true);
		OnFriendsListLoaded (result);

	}
Exemplo n.º 41
0
	private void onAuthenticateLocalPlayer(string  array) {
		string[] data = array.Split(IOSNative.DATA_SPLITTER);

		_player = new GK_Player (data[0], data [1], data [2]);


		ISN_CacheManager.SendAchievementCachedRequest();

		_IsPlayerAuthenticated = true;


		ISN_Result result = new ISN_Result (_IsPlayerAuthenticated);
		OnAuthFinished (result);
	}
Exemplo n.º 42
0
	private void onAchievementsLoaded(string array) {

		ISN_Result result = new ISN_Result (true);
		if(array.Equals(string.Empty)) {
			OnAchievementsLoaded (result);
			return;
		}

		string[] data = array.Split(IOSNative.DATA_SPLITTER);


		for(int i = 0; i < data.Length; i+=3) {
			GK_AchievementTemplate tpl =  GetAchievement(data[i]);
			tpl.Description 	= data[i + 1];
			tpl.Progress 		= System.Convert.ToSingle(data[i + 2]);
			SaveLocalProgress (tpl);
		}

		_IsAchievementsInfoLoaded = true;
		OnAchievementsLoaded (result);
	}
	void HandleOnAuthFinished (ISN_Result result){
		if (result.IsSucceeded) {
			Debug.Log("Player Authed");
		} else {
			IOSNativePopUpManager.showMessage("Game Center ", "Player authentication failed");
		}
	}
Exemplo n.º 44
0
	private void onFriendListLoaded(string data) {


		string[] fl;
		fl = data.Split("|" [0]);

		for(int i = 0; i < fl.Length; i++) {
			_friendsList.Add(fl[i]);
		}

		if(!IOSNativeSettings.Instance.DisablePluginLogs) 
			Debug.Log("Friends list loaded, total friends: " + _friendsList.Count);


		ISN_Result result = new ISN_Result (true);
		OnFriendsListLoaded (result);
		Dispatcher.dispatch (GAME_CENTER_FRIEND_LIST_LOADED, result);

	}
Exemplo n.º 45
0
	private void OnMailSuccess() {
		dispatch(MAIL_SUCCESS);

		if(OnMailResult != null) {
			ISN_Result result = new ISN_Result(true);
			OnMailResult(result);
		}
	}
Exemplo n.º 46
0
	private void OnMailFailed() {
		dispatch(MAIL_FAILED);

		if(OnMailResult != null) {
			ISN_Result result = new ISN_Result(false);
			OnMailResult(result);
		}
	}
Exemplo n.º 47
0
	private void OnFacebookPostSuccess() {
		dispatch(FACEBOOK_POST_SUCCESS);

		if(OnFacebookPostResult != null) {
			ISN_Result result = new ISN_Result(true);
			OnFacebookPostResult(result);
		}
	}
Exemplo n.º 48
0
	private void OnFacebookPostFailed() {
		dispatch(FACEBOOK_POST_FAILED);

		if(OnFacebookPostResult != null) {
			ISN_Result result = new ISN_Result(false);
			OnFacebookPostResult(result);
		}
	}
Exemplo n.º 49
0
	private void OnTwitterPostSuccess() {
		dispatch(TWITTER_POST_SUCCESS);

		if(OnTwitterPostResult != null) {
			ISN_Result result = new ISN_Result(true);
			OnTwitterPostResult(result);
		}

	}
Exemplo n.º 50
0
	//--------------------------------------
	//  GET/SET
	//--------------------------------------
	
	//--------------------------------------
	//  EVENTS
	//--------------------------------------
	
	void HandleOnAchievementsLoaded (ISN_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);
		}
	}
Exemplo n.º 51
0
	private void onAchievementsReset(string array) {

		ISN_Result result = new ISN_Result (true);
		OnAchievementsReset (result);

	}
	private void OnFriendsListLoaded (ISN_Result result) {
		GameCenterManager.OnFriendsListLoaded -= OnFriendsListLoaded;
		if(result.IsSucceeded) {
			renderFriendsList = true;
		}
				
	}
Exemplo n.º 53
0
	private void onAchievementsLoadedFailed(string errorData) {
		ISN_Result result = new ISN_Result (errorData);
		OnAchievementsLoaded (result);
	}
Exemplo n.º 54
0
	private void ISN_OnLBSetsLoaded(string array) {

		string[] data = array.Split(IOSNative.DATA_SPLITTER);

		for(int i = 0; i+2  < data.Length; i+=3) {
			GK_LeaderboardSet lbSet =  new GK_LeaderboardSet();
			lbSet.Title = data[i];
			lbSet.Identifier = data[i + 1];
			lbSet.GroupIdentifier = data[i + 2];
			LeaderboardSets.Add(lbSet);
		}


		ISN_Result res =  new ISN_Result(true);
		OnLeaderboardSetsInfoLoaded(res);
	}
Exemplo n.º 55
0
	private void onAuthenticationFailed(string  errorData) {

		_IsPlayerAuthenticated = false;

		ISN_Result result;
		if(errorData.Length > 0) {
			result = new ISN_Result(errorData);
		} else {
			result	= new ISN_Result (_IsPlayerAuthenticated);
		}

			
		OnAuthFinished (result);
	}
Exemplo n.º 56
0
	private void onAuthenticationFailed(string  array) {
		_IsPlayerAuthenticated = false;


		ISN_Result result = new ISN_Result (_IsPlayerAuthenticated);
		OnAuthFinished (result);
		Dispatcher.dispatch (GAME_CENTER_PLAYER_AUTHENTICATED, result);
	}
Exemplo n.º 57
0
	private void OnFriendListLoadFailEvent(string errorData) {
		ISN_Result result = new ISN_Result (errorData);
		OnFriendsListLoaded (result);
	}
Exemplo n.º 58
0
	private void onFriendListFailedToLoad(string data) {
		ISN_Result result = new ISN_Result (false);
		OnFriendsListLoaded (result);
		Dispatcher.dispatch (GAME_CENTER_FRIEND_LIST_LOADED, result);
	}
Exemplo n.º 59
0
	private void ISN_OnLBSetsLoadFailed(string array) {
		ISN_Result res =  new ISN_Result(false);
		OnLeaderboardSetsInfoLoaded(res);
	}
Exemplo n.º 60
0
	private void onAuthenticateLocalPlayer(string  array) {
		string[] data;
		data = array.Split("," [0]);

		_player = new GameCenterPlayerTemplate (data[0], data [1], data [2]);


		ISN_CacheManager.SendAchievementCachedRequest();

		_IsPlayerAuthenticated = true;


		ISN_Result result = new ISN_Result (_IsPlayerAuthenticated);
		OnAuthFinished (result);
		Dispatcher.dispatch (GAME_CENTER_PLAYER_AUTHENTICATED, result);



	}