void OnApplicationPause(bool pauseStatus)
 {
     if (pauseStatus)
     {
         globalVariables.AppPaused = true;
         if (!notificationSent)
         {
             if (globalVariables.NarState < 5)
             {
                 NotificationManager.Send(TimeSpan.FromSeconds(120), "Buddy is hungry!", "Come feed your buddy!", new Color(1, 0.3f, 0.15f));
             }
             else if (globalVariables.NarState >= 5 && globalVariables.NarState < 7)
             {
                 NotificationManager.Send(TimeSpan.FromSeconds(60), "Buddy is hungry!", "FEED ME", new Color(1, 0.3f, 0.15f));
             }
             else if (globalVariables.NarState >= 7 && globalVariables.NarState < 11)
             {
                 NotificationManager.Send(TimeSpan.FromSeconds(30), "COME BACK", "COME BACK", new Color(1, 0.3f, 0.15f));
             }
             notificationSent = true;
         }
         globalVariables.sad = true;
     }
     else
     {
         if (globalVariables.AppPaused)
         {
             savingSystem sn = this.GetComponent <savingSystem>();
             sn.Load();
         }
         globalVariables.AppPaused = false;
     }
 }
 public void SendNotif()
 {
     NotificationManager.Send(TimeSpan.FromSeconds(5),
                              "Notification",
                              "Esta es una notificacion",
                              Color.white);
 }
예제 #3
0
 public void SendNotifLivesFull()
 {
     if (PlayerPrefs.GetInt("Lives", 0) == 5 && PlayerPrefs.GetInt("NotifLives", 0) == 1)
     {
         NotificationManager.Send(TimeSpan.FromSeconds(5), "Come back and play !", "Your Lives are full now !", Color.red, NotificationIcon.Heart);
         PlayerPrefs.SetInt("NotifLives", 0);
     }
 }
예제 #4
0
        public void SendNotifDaily()
        {
            int NotifyDaily = PlayerPrefs.GetInt("NotifDaily", 0);

            if (NotifyDaily != DateTime.Now.DayOfYear && DateTime.Now.TimeOfDay.Minutes > 60 * 10) //Benachrichtigung erst nach 10 Uhr morgens ?
            {
                NotificationManager.Send(TimeSpan.FromSeconds(5), "Come back and play !", "Get your daily Bonus !", Color.red, NotificationIcon.Bell);
                PlayerPrefs.SetInt("NotifDaily", DateTime.Now.DayOfYear);
            }
        }
예제 #5
0
 public void ScheduleSimple()
 {
     #if UNITY_ANDROID
     NotificationManager.Send(TimeSpan.FromSeconds(15), "Simple 15 notification", "Customize icon and color", new Color(1, 0.3f, 0.15f));
     #elif UNITY_IOS
     if (count == 0)
     {
         ScheduleNotificationForiOSWithMessage("Test ios notification", DateTime.Now.AddSeconds(5.0f));
         count++;
     }
     else if (count == 1)
     {
         ScheduleNotificationForiOSWithMessage("Test ios notification", DateTime.Now.AddSeconds(15.0f));
         count++;
     }
     else if (count == 2)
     {
         ScheduleNotificationForiOSWithMessage("Test ios notification", DateTime.Now.AddSeconds(25.0f));
     }
     #endif
 }
예제 #6
0
        public void OnGUI()
        {
            if (GUILayout.Button("Simple 5 sec", GUILayout.Height(Screen.height * 0.2f), GUILayout.Width(Screen.width)))
            {
                NotificationManager.Send(TimeSpan.FromSeconds(5), "Simple notification", "Customize icon and color", new Color(1, 0.3f, 0.15f));
            }

            if (GUILayout.Button("Normal 5 sec", GUILayout.Height(Screen.height * 0.2f), GUILayout.Width(Screen.width)))
            {
                NotificationManager.SendWithAppIcon(TimeSpan.FromSeconds(5), "Notification", "Notification with app icon", new Color(0, 0.6f, 1), NotificationIcon.Message);
            }

            if (GUILayout.Button("Custom 5 sec", GUILayout.Height(Screen.height * 0.2f), GUILayout.Width(Screen.width)))
            {
                var notificationParams = new NotificationParams
                {
                    Id             = UnityEngine.Random.Range(0, int.MaxValue),
                    Delay          = TimeSpan.FromSeconds(5),
                    Title          = "Custom notification",
                    Message        = "Message",
                    Ticker         = "Ticker",
                    Sound          = true,
                    Vibrate        = true,
                    Light          = true,
                    SmallIcon      = NotificationIcon.Heart,
                    SmallIconColor = new Color(0, 0.5f, 0),
                    LargeIcon      = "app_icon"
                };

                NotificationManager.SendCustom(notificationParams);
            }

            if (GUILayout.Button("Cancel all", GUILayout.Height(Screen.height * 0.2f), GUILayout.Width(Screen.width)))
            {
                NotificationManager.CancelAll();
            }
        }
 public void ScheduleSimple()
 {
     NotificationManager.Send(TimeSpan.FromSeconds(5), "Simple notification", "Customize icon and color", new Color(1, 0.3f, 0.15f));
 }
예제 #8
0
 public void SendNotifHighscore()
 {
     NotificationManager.Send(TimeSpan.FromSeconds(5), "Come back and play !", "Someone beat your highscore ! ", Color.red, NotificationIcon.Star);
 }
예제 #9
0
 public void QuitGame()
 {
     NotificationManager.Send(TimeSpan.FromSeconds(5), notifTitre, notifTexte, Color.black, NotificationIcon.Star);
     Application.Quit();
 }
예제 #10
0
 // agenda simples
 public void ScheduleSimple()
 {
     NotificationManager.Send(TimeSpan.FromSeconds(10), "se passaram 10 segundos..", "Cuide do seu Pet Digital", new Color(1, 0.3f, 0.15f), NotificationIcon.Heart);
 }
예제 #11
0
 public void ScheduleSimple()  //"Simple notification" matlab Heading ... "Customize icon and color" matlab sub detail.
 {
     NotificationManager.Send(TimeSpan.FromSeconds(5), "Simple notification", "Customize icon and color", new Color(1, 0.3f, 0.15f));
 }
예제 #12
0
 public void ScheduleSimple(int seconds)
 {
     NotificationManager.Send(TimeSpan.FromSeconds((double)seconds), "Simple notification", "Please rate the asset on the Asset Store!", new Color(1f, 0.3f, 0.15f), NotificationIcon.Bell, false);
 }
예제 #13
0
 public void SendNotif()
 {
     NotificationManager.Send(TimeSpan.FromSeconds(5), notifTitre, notifTexte, Color.white);
 }