//-------------------------------------- // PUBLIC METHODS //-------------------------------------- //-------------------------------------- // GET/SET //-------------------------------------- //-------------------------------------- // EVENTS //-------------------------------------- private void OnCloudInit() { ISN_Result res = new ISN_Result(true); OnCloundInitAction(res); dispatch(CLOUD_INITIALIZED); }
private void OnCloudInitFail() { ISN_Result res = new ISN_Result(false); OnCloundInitAction(res); dispatch(CLOUD_INITIALIZE_FAILED); }
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(); }
void OnIOSImageSaved(ISN_Result res) { UM_ImageSaveResult result = new UM_ImageSaveResult(string.Empty, res.IsSucceeded); OnImageSaved(result); dispatch(IMAGE_SAVED, result); }
private void onFriendListFailedToLoad(string data) { ISN_Result result = new ISN_Result(false); OnFriendsListLoaded(result); dispatcher.dispatch(GAME_CENTER_FRIEND_LIST_LOADED, result); }
private void OnImageSaveFailed() { ISN_Result result = new ISN_Result(false); dispatch(IMAGE_SAVED, result); OnImageSaved(result); }
//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); } }
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); } }
private void onAchievementsLoadedFailed() { ISN_Result result = new ISN_Result(false); OnAchievementsLoaded(result); dispatcher.dispatch(GAME_CENTER_ACHIEVEMENTS_LOADED, result); }
private void onLeaderBoardScoreListLoadFailed(string array) { ISN_Result result = new ISN_Result(false); OnScoresListLoaded(result); dispatcher.dispatch(GAME_CENTER_LEADER_BOARD_SCORE_LIST_LOADED, result); }
public void onScoreSubmitedFailed(string data) { ISN_Result result = new ISN_Result(false); OnScoreSubmited(result); dispatcher.dispatch(SCORE_SUMBITED, result); }
private void OnImageSaveSuccess() { ISN_Result result = new ISN_Result(true); dispatch(IMAGE_SAVED, result); OnImageSaved(result); }
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); } }
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); }
private void OnRecorStopSuccess() { _IsRecodingAvailableToShare = true; ISN_Result result = new ISN_Result(true); ActionRecordStoped(result); }
void HandleOnAuthFinished(ISN_Result r) { if (r.IsSucceeded) { IOSNativePopUpManager.showMessage("Player Authenticated", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName); } }
private void onAchievementsResetFailed(string array) { ISN_Result result = new ISN_Result(false); OnAchievementsReset(result); dispatcher.dispatch(GAME_CENTER_ACHIEVEMENTS_RESET, result); }
//-------------------------------------- // Initialize //-------------------------------------- public UM_Result(ISN_Result result) { _IsSucceeded = result.IsSucceeded; if(!_IsSucceeded) { _Error = new UM_Error(result.Error.Code, result.Error.Description); } }
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(); }
private void OnFacebookPostSuccess() { if (OnFacebookPostResult != null) { ISN_Result result = new ISN_Result(true); OnFacebookPostResult(result); } }
//-------------------------------------- // 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(); } }
private void OnMailSuccess() { if (OnMailResult != null) { ISN_Result result = new ISN_Result(true); OnMailResult(result); } }
//-------------------------------------- // Objective-C Delegates //-------------------------------------- private void OnRecorStartSuccess(string data) { _IsRecording = true; ISN_Result result = new ISN_Result(true); ActionRecordStarted(result); }
//-------------------------------------- // PRIVATE METHODS //-------------------------------------- private void FireSuccessInitEvent() { _IsStoreLoaded = true; _IsWaitingLoadResult = false; ISN_Result r = new ISN_Result(true); OnStoreKitInitComplete(r); }
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); }
private void OnTwitterPostSuccess() { if (OnTwitterPostResult != null) { ISN_Result result = new ISN_Result(true); OnTwitterPostResult(result); } }
private void OnMailFailed() { if (OnMailResult != null) { ISN_Result result = new ISN_Result(false); OnMailResult(result); } }
//-------------------------------------- // EVENTS //-------------------------------------- private void OnTwitterPostFailed() { if (OnTwitterPostResult != null) { ISN_Result result = new ISN_Result(false); OnTwitterPostResult(result); } }
private void OnFacebookPostFailed() { if (OnFacebookPostResult != null) { ISN_Result result = new ISN_Result(false); OnFacebookPostResult(result); } }
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; } }
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"); } }
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; }; }
void HandleOnAuthFinished (ISN_Result r) { if (r.IsSucceeded) { IOSNativePopUpManager.showMessage("Player Authenticated", "ID: " + GameCenterManager.Player.Id + "\n" + "Name: " + GameCenterManager.Player.DisplayName); } }
void HandleOnAchievementsReset (ISN_Result res) { ISN_Logger.Log ("All Achievements were reset"); }
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); } }
//-------------------------------------- // EVENTS //-------------------------------------- private void OnTwitterPostFailed() { dispatch(TWITTER_POST_FAILED); if(OnTwitterPostResult != null) { ISN_Result result = new ISN_Result(false); OnTwitterPostResult(result); } }
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); }
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); }
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"); } }
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); }
private void OnMailSuccess() { dispatch(MAIL_SUCCESS); if(OnMailResult != null) { ISN_Result result = new ISN_Result(true); OnMailResult(result); } }
private void OnMailFailed() { dispatch(MAIL_FAILED); if(OnMailResult != null) { ISN_Result result = new ISN_Result(false); OnMailResult(result); } }
private void OnFacebookPostSuccess() { dispatch(FACEBOOK_POST_SUCCESS); if(OnFacebookPostResult != null) { ISN_Result result = new ISN_Result(true); OnFacebookPostResult(result); } }
private void OnFacebookPostFailed() { dispatch(FACEBOOK_POST_FAILED); if(OnFacebookPostResult != null) { ISN_Result result = new ISN_Result(false); OnFacebookPostResult(result); } }
private void OnTwitterPostSuccess() { dispatch(TWITTER_POST_SUCCESS); if(OnTwitterPostResult != null) { ISN_Result result = new ISN_Result(true); OnTwitterPostResult(result); } }
//-------------------------------------- // 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); } }
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; } }
private void onAchievementsLoadedFailed(string errorData) { ISN_Result result = new ISN_Result (errorData); OnAchievementsLoaded (result); }
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); }
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); }
private void onAuthenticationFailed(string array) { _IsPlayerAuthenticated = false; ISN_Result result = new ISN_Result (_IsPlayerAuthenticated); OnAuthFinished (result); Dispatcher.dispatch (GAME_CENTER_PLAYER_AUTHENTICATED, result); }
private void OnFriendListLoadFailEvent(string errorData) { ISN_Result result = new ISN_Result (errorData); OnFriendsListLoaded (result); }
private void onFriendListFailedToLoad(string data) { ISN_Result result = new ISN_Result (false); OnFriendsListLoaded (result); Dispatcher.dispatch (GAME_CENTER_FRIEND_LIST_LOADED, result); }
private void ISN_OnLBSetsLoadFailed(string array) { ISN_Result res = new ISN_Result(false); OnLeaderboardSetsInfoLoaded(res); }
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); }