Exemplo n.º 1
0
        public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
        {
            if (showResult == ShowResult.Finished)
            {
                var currentTime = DateTime.Now;
                var endTime     = EncryptedGlobalPreferences.GetPrimitive("advanced_set_end_time", currentTime);
                if (endTime < currentTime)
                {
                    endTime = currentTime;
                }

                EncryptedGlobalPreferences.SetPrimitive("advanced_set_end_time", endTime.Value.AddMinutes(30));

                Debug.Log("FINISH: FINISHED");
            }
            else if (showResult == ShowResult.Skipped)
            {
                Debug.Log("FINISH: SKIPPED");
            }
            else if (showResult == ShowResult.Failed)
            {
                Debug.LogWarning("FINISH: FAILED");
            }

            AdFinished?.Invoke(placementId, showResult);
        }
Exemplo n.º 2
0
        public override bool IsActivated()
        {
#if UNITY_EDITOR
            return(true);
#else
            var endTime = EncryptedGlobalPreferences.GetPrimitive("advanced_set_end_time", DateTime.Now);

            return(DateTime.Now < endTime || base.IsActivated());
#endif
        }
Exemplo n.º 3
0
        public virtual bool IsActivated()
        {
#if UNITY_EDITOR
            return(true);
#else
            var anyActivated = EncryptedGlobalPreferences.GetPrimitive($"any_set_activated", false);

            var result = EncryptedGlobalPreferences.GetPrimitive($"{_name}_set_activated", false);

            return(_forceActivated || (_buyAnyPackToActivate && anyActivated.Value) || result.Value);
#endif
        }