Example #1
0
 /// <summary>
 /// Ask for permission to notify the user
 /// </summary>
 public void Initialize()
 {
     NotificationServices.RegisterForNotifications(
         NotificationType.Alert |
         NotificationType.Badge |
         NotificationType.Sound);
 }
Example #2
0
        // Use this for initialization
        private void Start()
        {
            #if UNITY_IOS
            NotificationServices.RegisterForNotifications(NotificationType.Alert | NotificationType.Badge | NotificationType.Sound, false);
            #endif

            _mageFactory = new MageFactory(MageUpgradeManager.MagePrefabs, this);
            ElementController.Instance.TowerTextures  = TowerTextures;
            ElementController.Instance.ShrineTextures = ShrineTextures;
            ElementController.Instance.MageTextures   = MageTextures;
            ElementController.Instance.SpellParticles = SpellParticles;
            ElementController.Instance.ElementIcons   = ElementIcons;

            MageUpgradeManager.Init();

            if (PlayerPrefs.GetInt("sfxMute") == 1)
            {
                SFXSlider.AssignSlider();
                if (_audioManager && _audioManager.SFXAudio.mute)
                {
                    _audioManager.ToggleSound();
                }
                SFXSlider.ChangeValue();
            }

            if (PlayerPrefs.GetInt("musicMute") == 1)
            {
                MusicSlider.AssignSlider();
                if (_audioManager && _audioManager.MusicAudio.mute)
                {
                    _audioManager.ToggleMusic();
                }
                MusicSlider.ChangeValue();
            }

            //Currency Bonus
            if (!string.IsNullOrEmpty(PlayerPrefs.GetString("_currencyBonusEndTime")))
            {
                _currencyModifierEndTime = DateTime.Parse(PlayerPrefs.GetString("_currencyBonusEndTime"));
                if (_currencyModifierEndTime > DateTime.Now)
                {
                    var restTime = AdManager.BonusTime - (_currencyModifierEndTime - DateTime.Now).TotalSeconds;
                    _currencyModifier = PlayerPrefs.GetFloat("_currencyModifier");
                    UIManager.OpenCurrencyBonus(_currencyModifier);
                    AdManager.Timer.Cooldown((float)restTime, Time.time);
                }
            }
            //Damage Bonus
            if (!string.IsNullOrEmpty(PlayerPrefs.GetString("_damageBonusEndTime")))
            {
                _damageModifierEndTime = DateTime.Parse(PlayerPrefs.GetString("_damageBonusEndTime"));
                if (_damageModifierEndTime > DateTime.Now)
                {
                    var restTime = AdManager.BonusTime - (_damageModifierEndTime - DateTime.Now).TotalSeconds;
                    _damageModifier = PlayerPrefs.GetFloat("_damageModifier");
                    UIManager.OpenDamageBonus(_damageModifier);
                    AdManager.Timer.Cooldown((float)restTime, Time.time);
                }
            }
        }
 public virtual void Register(string id = "")
 {
     NotificationServices.RegisterForNotifications(
         NotificationType.Alert |
         NotificationType.Badge |
         NotificationType.Sound);
 }
Example #4
0
 void Start()
 {
     Debug.Log("NotificationExample: start");
     #if UNITY_IOS
     NotificationServices.RegisterForNotifications(
         NotificationType.Alert |
         NotificationType.Badge |
         NotificationType.Sound);
     StartCoroutine(CleanNotification());
     #endif
 }