public void LoadCurrentPlayerLeaderboardScore(AN_LeaderboardsClient client, string leaderboardId, int span, int leaderboardCollection, Action <AN_LinkedObjectResult <AN_LeaderboardScore> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_LeaderboardScore>(new AN_LeaderboardScore()); callback.Invoke(result); }); }
public void LoadLeaderboardMetadata(AN_LeaderboardsClient client, string leaderboardId, bool forceReload, Action <AN_LeaderboardLoadResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LeaderboardLoadResult(); callback.Invoke(result); }); }
public void CommitAndClose(AN_SnapshotsClient client, AN_Snapshot snapshot, AN_SnapshotMetadataChange metadataChange, Action <AN_SnapshotMetadataResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_SnapshotMetadataResult(new AN_SnapshotMetadata()); callback.Invoke(result); }); }
public void Open(AN_SnapshotsClient client, string name, bool createIfNotFound, int conflictPolicy, Action <AN_LinkedObjectResult <AN_DataOrConflictResult> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_DataOrConflictResult>(new AN_DataOrConflictResult()); callback.Invoke(result); }); }
public void Delete(AN_SnapshotsClient client, AN_SnapshotMetadata meta, Action <AN_SnapshotsDeleteResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_SnapshotsDeleteResult(); callback.Invoke(result); }); }
public void GoogleSignInClient_SignOut(AN_GoogleSignInClient client, Action <SA_Result> callback) { SA_Coroutine.WaitForSeconds(1, () => { m_alreadySignedIn = false; callback.Invoke(new SA_Result()); }); }
//-------------------------------------- // Public Methods //-------------------------------------- public void Share(Action callback = null) { if (Application.isEditor) { SA_Coroutine.WaitForSeconds(1, () => { if (callback != null) { callback.Invoke(); } }); return; } AN_PermissionsUtility.TryToResolvePermission(new [] { AMM_ManifestPermission.WRITE_EXTERNAL_STORAGE, AMM_ManifestPermission.READ_EXTERNAL_STORAGE }, (granted) => { if (!granted) { AN_Logger.LogError("User haven't granted required sharing permissions: " + "WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE. " + "Sharing may not be fully completed."); } ShowSharingDialog(callback); }); }
public void SubmitScoreImmediate(AN_LeaderboardsClient client, string leaderboardId, long score, string scoreTag, Action <AN_LinkedObjectResult <AN_ScoreSubmissionData> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_ScoreSubmissionData>(new AN_ScoreSubmissionData()); callback.Invoke(result); }); }
public void GetCurrentPlayer(AN_PlayersClient client, Action <AN_LinkedObjectResult <AN_Player> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_Player>(new AN_Player()); callback.Invoke(result); }); }
public void Load(AN_AchievementsClient client, bool forceReload, Action <AN_AchievementsLoadResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { //TODO might me cool to get info from saved games-ids.xml callback.Invoke(new AN_AchievementsLoadResult()); }); }
public void LoadStore(ISN_SKLib.SA_PluginSettingsWindowStylesitRequest request, Action <ISN_SKInitResult> callback) { SA_Coroutine.WaitForSeconds(DelayTime, () => { ISN_SKInitResult res = new ISN_SKInitResult(ISN_Settings.Instance.InAppProducts); callback.Invoke(res); }); }
/// <summary> /// Start the dialog and display it on screen. /// </summary> public override void Show() { if (Application.isEditor) { foreach (var button in m_buttons) { if (button.m_type == POSITIVE) { SA_Coroutine.WaitForSeconds(1, () => { button.m_callback.Invoke(); }); return; } } return; } AN_AppLib.API.AlertDialogShow(this, (closeResult) => { foreach (var button in m_buttons) { if (button.m_id.Equals(closeResult.m_buttonid)) { button.m_callback.Invoke(); return; } } //looks like alert was dismissed wihtout user taping buttons //so far this is disabled, let's see if we gonna need it in guture // OnUserCanceled.Invoke(); }); }
public void Purchase(AN_VendingLib.AN_PurchaseRequest request, Action <AN_BillingPurchaseResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { AN_Purchase purchase = new AN_Purchase(request.m_product.ProductId, request.m_product.Type.ToString(), request.m_developerPayload); callback.Invoke(new AN_BillingPurchaseResult(purchase)); }); }
//-------------------------------------- // AN_SnapshotsClient //-------------------------------------- public void ShowSelectSnapshotIntent(AN_SnapshotsClient client, string title, bool allowAddButton, bool allowDelete, int maxSnapshots, Action <AN_SnapshotUIResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_SnapshotUIResult((int)AN_SnapshotUIResult.UserInteractionState.NOTHING_SELECTED); callback.Invoke(result); }); }
public void LoadTopScores(AN_LeaderboardsClient client, string leaderboardId, int span, int leaderboardCollection, int maxResults, bool forceReload, Action <AN_LinkedObjectResult <AN_LeaderboardScores> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_LeaderboardScores>(new AN_LeaderboardScores()); callback.Invoke(result); }); }
public void LoadMoreScores(AN_LeaderboardsClient client, AN_LeaderboardScoreBuffer buffer, int maxResults, int pageDirection, Action <AN_LinkedObjectResult <AN_LeaderboardScores> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_LeaderboardScores>(new AN_LeaderboardScores()); callback.Invoke(result); }); }
//-------------------------------------- // AN_GoogleSignInClient //-------------------------------------- public void GoogleSignInClient_SignIn(AN_GoogleSignInClient client, Action <AN_GoogleSignInResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { m_alreadySignedIn = true; m_canDoSilentSignedIn = true; callback.Invoke(new AN_GoogleSignInResult(new AN_GoogleSignInAccount())); }); }
public override void Test() { AN_Preloader.LockScreen("Lock Test"); SA_Coroutine.WaitForSeconds(3f, () => { AN_Preloader.UnlockScreen(); }); }
public void ResolveConflict(AN_SnapshotsClient client, string conflictId, AN_Snapshot snapshot, Action <AN_LinkedObjectResult <AN_DataOrConflictResult> > callback) { SA_Coroutine.WaitForSeconds(1, () => { var result = new AN_LinkedObjectResult <AN_DataOrConflictResult>(new AN_DataOrConflictResult()); callback.Invoke(result); }); }
public void AddPayment(string productIdentifier) { SA_Coroutine.WaitForSeconds(DelayTime, () => { var produdct = ISN_SKPaymentQueue.GetProductById(productIdentifier); var tranasaction = new ISN_SKPaymentTransaction(produdct, ISN_SKPaymentTransactionState.Purchased); m_transactionUpdated.Invoke(tranasaction); }); }
/// <summary> /// Launch an activity for which you would like a result when it finished. /// When this activity exits, your callback will be called. /// </summary> /// <param name="intent">The intent to start.</param> /// <param name="callback">Activity result callback</param> public bool StartActivityForResult(AN_Intent intent, Action <AN_ActivityResult> callback) { if (Application.isEditor) { SA_Coroutine.WaitForSeconds(1, () => { callback.Invoke(new AN_ActivityResult()); }); return(true); } return(AN_Java.Bridge.CallStaticWithCallback <bool, AN_ActivityResult>(ANDROID_CLASS, "StartActivityForResult", callback, this, intent)); }
public void Retrieve(Action <UM_ContactsResult> callback) { SA_Coroutine.WaitForSeconds(2f, () => { List <UM_iContact> contacts = new List <UM_iContact>(); foreach (var contact in UM_Settings.Instance.EditorTestingContacts) { contacts.Add(contact.Clone()); } var loadResult = new UM_ContactsResult(contacts); callback.Invoke(loadResult); }); }
public void RestoreCompletedTransactions() { SA_Coroutine.WaitForSeconds(DelayTime, () => { foreach (var product in ISN_SKPaymentQueue.Products) { if (product.Type == ISN_SKProductType.NonConsumable) { var tranasaction = new ISN_SKPaymentTransaction(product, ISN_SKPaymentTransactionState.Restored); m_transactionUpdated.Invoke(tranasaction); } } m_restoreTransactionsComplete.Invoke(new SA_Result()); }); }
public static void PickImageFromGallery(int maxSize, AN_GalleryChooseType type, bool allowMultiSelect, Action <AN_GalleryPickResult> callback) { if (Application.isEditor) { SA_Coroutine.WaitForSeconds(1, () => { var error = new SA_Error(100, "Gallery does not available on current device"); callback.Invoke(new AN_GalleryPickResult(error)); }); return; } int chooserType = (int)type; AN_Java.Bridge.CallStaticWithCallback(ANDROID_CLASS, "PickImageFromGallery", callback, maxSize, chooserType, allowMultiSelect); }
public void GoogleSignInClient_SilentSignIn(AN_GoogleSignInClient client, Action <AN_GoogleSignInResult> callback) { SA_Coroutine.WaitForSeconds(1, () => { if (m_canDoSilentSignedIn) { m_alreadySignedIn = true; callback.Invoke(new AN_GoogleSignInResult(new AN_GoogleSignInAccount())); } else { var error = new SA_Error((int)AN_CommonStatusCodes.SIGN_IN_REQUIRED, "SIGN_IN_REQUIRED"); callback.Invoke(new AN_GoogleSignInResult(error)); } }); }
public void Delete(UM_iSavedGameMetadata game, Action <SA_Result> callback) { var editorGamesList = LoadSavesList(); var editorGame = editorGamesList.GetByName(game.Name); if (editorGame != null) { editorGamesList.Saves.Remove(editorGame); EditorSaveGames(editorGamesList); } SA_Coroutine.WaitForSeconds(1.5f, () => { callback.Invoke(new SA_Result()); }); }
public void FetchSavedGames(Action <UM_SavedGamesMetadataResult> callback) { var loadResult = new UM_SavedGamesMetadataResult(); var editorGamesList = LoadSavesList(); foreach (EditorSavedGame game in editorGamesList.Saves) { loadResult.AddMetadata(game); } SA_Coroutine.WaitForSeconds(1.5f, () => { callback.Invoke(loadResult); }); }
private void Message() { var title = "Congrats"; var message = "Your account has been verified"; var builder = new UM_NativeDialogBuilder(title, message); builder.SetPositiveButton("Okay", () => { Debug.Log("Okay button pressed"); }); var dialog = builder.Build(); dialog.Show(); SA_Coroutine.WaitForSeconds(2f, dialog.Hide); }
public static void SaveImageToGallery(Texture2D image, string name, string appDirectory, AN_GalleryFormat format, Action <AN_GallerySaveResult> callback) { string base64 = image.ToBase64String(); int saveFormat = (int)format; if (Application.isEditor) { SA_Coroutine.WaitForSeconds(1, () => { var error = new SA_Error(100, "Gallery does not avaliable on current device"); callback.Invoke(new AN_GallerySaveResult(error)); }); return; } AN_Java.Bridge.CallStaticWithCallback(ANDROID_CLASS, "SaveImageToGallery", callback, base64, appDirectory, name, saveFormat); }
public void Execute() { m_test = (SA_BaseTest)Activator.CreateInstance(m_testConfig.TestReference.Type); OnTestStart.Invoke(); OnTestStart = delegate { }; m_test.OnResult += TestResultHandler; if (!m_test.RequireUserInteraction) { // m_timeoutCoroutine = SA_Coroutine.WaitForSeconds(TIMEOUT, OnTimeOut); SA_Coroutine.WaitForSeconds(TIMEOUT, OnTimeOut); } try { m_test.Test(); } catch (Exception e) { ClearListener(); FireResult(SA_TestResult.WithError("Failed with Exception " + e.GetBaseException().Message)); } }