public UM_IOSTransaction(ISN_SKPaymentTransaction transaction) { m_id = transaction.TransactionIdentifier; m_productId = transaction.ProductIdentifier; m_unitxTimestamp = SA_Unix_Time.ToUnixTime(transaction.Date); switch (transaction.State) { case ISN_SKPaymentTransactionState.Deferred: m_state = UM_TransactionState.Deferred; break; case ISN_SKPaymentTransactionState.Failed: m_state = UM_TransactionState.Failed; break; case ISN_SKPaymentTransactionState.Restored: m_state = UM_TransactionState.Restored; break; case ISN_SKPaymentTransactionState.Purchased: m_state = UM_TransactionState.Purchased; break; } m_error = transaction.Error; m_iosTransaction = transaction; }
public UM_EditorTransaction(string productId, UM_TransactionState state) { m_id = SA_IdFactory.RandomString; m_productId = productId; m_unitxTimestamp = SA_Unix_Time.ToUnixTime(DateTime.Now); m_state = state; }
private void HasConflictingSavedGames(ISN_GKSavedGameFetchResult result) { ISN_GKSavedGame resultGame = null; var conflictedSavedGamesIds = new List <string>(); foreach (var game in result.SavedGames) { conflictedSavedGamesIds.Add(game.Id); if (resultGame == null) { resultGame = game; } else { var gameUnixTime = SA_Unix_Time.ToUnixTime(game.ModificationDate); var currentResultTime = SA_Unix_Time.ToUnixTime(resultGame.ModificationDate); if (gameUnixTime > currentResultTime) { resultGame = game; } } } ISN_GKLocalPlayer.LoadGameData(resultGame, (dataLoadResult) => { if (dataLoadResult.IsSucceeded) { ISN_GKLocalPlayer.ResolveConflictingSavedGames(conflictedSavedGamesIds, dataLoadResult.BytesArrayData, (resResult) => { }); } }); }
/// <summary> /// Create ISN_RecurrenceRuleRequest object. /// </summary> /// <param name="frequency"> Frequency of recurrence rule</param> /// <param name="interval"> Interval of recurrence rule</param> /// <param name="endDate"> End date of recurrence rule</param> public ISN_RecurrenceRuleRequest(ISN_RecurrenceFrequencies frequency, int interval, DateTime endDate) { m_HasRule = true; this.m_Frequency = frequency.ToString(); this.m_Interval = interval; this.m_HasEndDate = true; this.m_EndDate = SA_Unix_Time.ToUnixTime(endDate); }
public void SubmitScore(string leaderboardId, long score, int context, Action <SA_Result> callback) { UM_EditorAPIEmulator.WaitForNetwork(() => { UM_Score um_score = new UM_Score(score, 10, context, SA_Unix_Time.ToUnixTime(DateTime.Now)); UM_EditorAPIEmulator.SetString(leaderboardId, JsonUtility.ToJson(um_score)); callback.Invoke(new SA_Result()); }); }
public ISN_SKPaymentTransaction(ISN_SKProduct product, ISN_SKPaymentTransactionState state) { m_productIdentifier = product.ProductIdentifier; m_transactionIdentifier = SA_IdFactory.RandomString; m_unixDate = SA_Unix_Time.ToUnixTime(DateTime.UtcNow); m_state = state; }
/// <summary> /// Creates a location object with the specified coordinate and altitude information. /// </summary> /// <param name="coordinate">A coordinate structure containing the latitude and longitude values.</param> /// <param name="altitude">The altitude value for the location.</param> /// <param name="hAccuracy"> /// The radius of uncertainty for the geographical coordinate, measured in meters. /// Specify a negative number to indicate that the geographical coordinate is invalid. /// </param> /// <param name="vAccuracy"> /// The accuracy of the altitude value, measured in meters. /// Specify a negative number to indicate that the altitude is invalid. /// </param> /// <param name="timestamp"> /// he time to associate with the location object. /// Typically, you specify the current time. /// </param> public ISN_CLLocation(ISN_CLLocationCoordinate2D coordinate, double altitude, double hAccuracy, double vAccuracy, DateTime timestamp) { m_Coordinate = coordinate; m_Altitude = altitude; m_HorizontalAccuracy = hAccuracy; m_VerticalAccuracy = vAccuracy; m_Timestamp = SA_Unix_Time.ToUnixTime(timestamp); }
/// <summary> /// Creates and returns a time interval trigger from the specified time value. /// </summary> /// <param name="timeInterval"> /// The time (in seconds) that must elapse before the trigger fires. This value must be greater than zero. /// </param> /// <param name="repeats"> /// Specify <c>false</c> to unschedule the notification after the trigger fires. /// Specify <c>true</c> if you want the notification to be rescheduled after it fires. /// </param> public ISN_UNTimeIntervalNotificationTrigger(long timeInterval, bool repeats) { m_timeInterval = timeInterval; m_repeats = repeats; m_type = ISN_UNNotificationTriggerType.TimeInterval; DateTime date = DateTime.Now; TimeSpan timeSpan = new TimeSpan(TimeSpan.TicksPerSecond * timeInterval); date.Add(timeSpan); m_nextTriggerDate = SA_Unix_Time.ToUnixTime(date); }
//For editor only public AN_Purchase(string productId, string type, string developerPayload) { m_Type = type; m_Sku = productId; m_DeveloperPayload = developerPayload; m_PackageName = Application.identifier; m_OrderId = SA_IdFactory.RandomString; m_PurchaseTime = SA_Unix_Time.ToUnixTime(DateTime.Now); m_PurchaseState = 0; m_PurchaseToken = SA_IdFactory.RandomString; m_Signature = SA_IdFactory.RandomString; m_IsAutoRenewing = false; m_IsAcknowledged = false; m_OriginalJson = JsonUtility.ToJson(this); }
//For editor only public AN_Purchase(string productId, string type, string developerPayload) { m_type = type; m_productId = productId; m_developerPayload = developerPayload; m_packageName = Application.identifier; m_orderId = SA_IdFactory.RandomString; m_purchaseTime = SA_Unix_Time.ToUnixTime(DateTime.Now); m_purchaseState = 0; m_token = SA_IdFactory.RandomString; m_signature = SA_IdFactory.RandomString; m_autoRenewing = false; m_originalJson = JsonUtility.ToJson(this); }
/// <summary> /// Create an ISN_AlarmDataRequest object. /// </summary> /// <param name="dueDate"> Due date of this alarm. </param> public ISN_AlarmDataRequest(DateTime dueDate) { m_HasAlarm = true; this.m_DueDate = SA_Unix_Time.ToUnixTime(dueDate); m_isAbsoluteDate = true; }
public ISN_GKScore(string leaderboardIdentifier) { m_leaderboardIdentifier = leaderboardIdentifier; m_date = SA_Unix_Time.ToUnixTime(DateTime.Now); }
/// <summary> /// Create ISN_EventKitDataRequest object. /// </summary> /// <param name="title">Title of event or reminder</param> /// <param name="startDate"> Start date of event or reminder</param> /// <param name="endDate"> End date of event or reminder</param> public ISN_EventKitDataRequest(string title, DateTime startDate, DateTime endDate) { m_Title = title; m_StartDate = SA_Unix_Time.ToUnixTime(startDate); m_EndDate = SA_Unix_Time.ToUnixTime(endDate); }
public long LeaderboardScore_GetTimestampMillis(AN_LeaderboardScore score) { return(SA_Unix_Time.ToUnixTime(DateTime.Now)); }
/// <summary> /// Sets a DateTime object for the specified key in the key-value store. /// </summary> public static void SetDateTime(string key, DateTime value) { SetLong(key, SA_Unix_Time.ToUnixTime(value)); }
public SA_PluginFirstInstallInfo(string firstVersion) { m_firstVersion = firstVersion; m_time = SA_Unix_Time.ToUnixTime(DateTime.Now); }
/// <summary> /// Sets the date to display in the date picker /// </summary> public void SetDate(DateTime date) { m_statrDate = SA_Unix_Time.ToUnixTime(date); }