Esempio n. 1
0
    public static void ResetNotification()
    {
        LocalNotification.ClearNotifications();
        var now      = DateTime.Now;
        var sheet    = StaticDataLite.GetSheet("push");
        var dataList = new List <PushData>();

        foreach (string key in sheet.Keys)
        {
            var row  = sheet[key];
            var data = new PushData();
            data.row = row;
            var h = row.Get <int>("h");
            var m = row.Get <int>("m");
            var s = row.Get <int>("s");
            data.shike = new DateTime(now.Year, now.Month, now.Day, h, m, s);
            dataList.Add(data);
        }

        for (int i = 0; i < 5; i++)
        {
            foreach (var data in dataList)
            {
                data.shike = data.shike.AddDays(1);
                var delay = data.shike - now;
                var title = data.row.Get <string>("title");
                var text  = data.row.Get <string>("text");
                LocalNotification.SendNotification(delay, title, text, new Color32(0xff, 0x44, 0x44, 255));
                Debug.Log("set notification at: " + data.shike);
            }
        }
    }
 void Awake()
 {
     LocalNotification.ClearNotifications();
     manager = GameObject.Find("TimerManager").GetComponent <TimeManager>();
     oneWeekAfter();
     stageEnd();
 }
Esempio n. 3
0
 /// <summary>
 /// Callback sent to all game objects when the player pauses.
 /// </summary>
 /// <param name="pauseStatus">The pause state of the application.</param>
 void OnApplicationPause(bool pauseStatus)
 {
     if (pauseStatus)
     {
         LocalNotification.SendNotification(1, 2000, "Title", "OnApplicationPause", new Color32(0xff, 0x44, 0x44, 255));
         LocalNotification.SendRepeatingNotification(2, 2000, 1000, "Repeat", "OnApplicationPause Repeat", new Color32(0xff, 0x44, 0x44, 255));
     }
     else
     {
         LocalNotification.ClearNotifications();
     }
 }
Esempio n. 4
0
 private void OnApplicationPause(bool pause)
 {
     if (pause)
     {
         SalvarParametros();
         AgendarNotificacao();
     }
     else
     {
         RetroCalculadora();
         LocalNotification.ClearNotifications();
     }
 }
Esempio n. 5
0
    private void Start()
    {
        //APAGAR NOTIFICAÇÕES AGENDADAS
        LocalNotification.ClearNotifications();

        #region Retrocalcular tudo
        // SE DISTÂNCIA JÁ FOI ALGUMA VEZ SALVA ENTÃO USAR RETROCALCULADORA
        if (PlayerPrefs.GetFloat("Distancia") > 0)
        {
            RetroCalculadora();
            LocalNotification.ClearNotifications();
        }
        #endregion
    }
Esempio n. 6
0
 private void OnApplicationFocus(bool focus)
 {
     // SE O APP GANHAR FOCO:
     if (focus)
     {
         RetroCalculadora();
         LocalNotification.ClearNotifications();
     }
     // SE O APP PERDER O FOCO: SALVAR PARAMETROS.
     else
     {
         SalvarParametros();
         AgendarNotificacao();
     }
 }
Esempio n. 7
0
        public void switchUser()
        {
            //GameManager.Instance.playfabManager.destroy();
            //GameManager.Instance.facebookManager.destroy();
            //GameManager.Instance.connectionLost.destroy();

            GameManager.Instance.avatarMy = null;
            PhotonNetwork.Disconnect();

            PlayerPrefs.DeleteAll();
            GameManager.Instance.resetAllData();
            LocalNotification.ClearNotifications();
            //GameManager.Instance.myPlayerData.GetCoins() = 0;
            SceneManager.LoadScene("LoginSplash");
        }
Esempio n. 8
0
 void Awake()
 {
     LocalNotification.ClearNotifications();
 }
Esempio n. 9
0
 void Awake()
 {
     Instance = this;
     LocalNotification.ClearNotifications();
 }
Esempio n. 10
0
 void Awake()
 {
     LocalNotification.ClearNotifications();
     status.text = "";
 }
Esempio n. 11
0
    public void AgendarNotificacao()
    {
        LocalNotification.ClearNotifications();

        // CALCULAR QUANDO O BEAR VAI ALCANÇAR O CHAR

        /*
         * if (Distancia > 100)
         * {
         *  double distanciaPrevista = Distancia;
         *  double velocidadePrevista = VelocidadeChar;
         *  int tempoEmSegundos = 0;
         *
         *  while (distanciaPrevista > 100)
         *  {
         *      if (velocidadePrevista > VelocidadeMinimaAtual)
         *      {
         *          distanciaPrevista += velocidadePrevista * 0.277778;
         *
         *          velocidadePrevista = DecrementarVelocidadePersonagem(velocidadePrevista, 1);
         *
         *          tempoEmSegundos++;
         *      }
         *      else
         *      {
         *          distanciaPrevista -= (VelocidadeBear - VelocidadeMinimaAtual) * 0.277778;
         *
         *          tempoEmSegundos++;
         *      }
         *  }
         *
         *  string[] MensagensDeAproximacao = new string[]
         *  {
         *      "Faltam menos de 100m pro Bear te pegar!",
         *      "Not today, not tomorrow, but i will kill you"
         *  };
         *
         *  LocalNotification.SendNotification(3, tempoEmSegundos * 1000, "Alerta de Aproximação! (100m)", MensagensDeAproximacao[UnityEngine.Random.Range(0, MensagensDeAproximacao.Length - 1)], new Color32(0, 0, 0, 255), true, true, true, "ic_launcher");
         * }
         * if (Distancia > 50)
         * {
         *  double distanciaPrevista = Distancia;
         *  double velocidadePrevista = VelocidadeChar;
         *  int tempoEmSegundos = 0;
         *
         *  while (distanciaPrevista > 50)
         *  {
         *      if (velocidadePrevista > VelocidadeMinimaAtual)
         *      {
         *          distanciaPrevista += velocidadePrevista * 0.277778;
         *
         *          velocidadePrevista = DecrementarVelocidadePersonagem(velocidadePrevista, 1);
         *
         *          tempoEmSegundos++;
         *      }
         *      else
         *      {
         *          distanciaPrevista -= (VelocidadeBear - VelocidadeMinimaAtual) * 0.277778;
         *
         *          tempoEmSegundos++;
         *      }
         *  }
         *
         *  string[] MensagensDeAproximacao = new string[]
         *  {
         *      "Faltam menos de 50m pro Bear te pegar!",
         *      "Falta pouco pro Bear te pegar.",
         *      "The life snake.",
         *      "Hora de procastinar mais um pouco."
         *  };
         *
         *  LocalNotification.SendNotification(2, tempoEmSegundos * 1000, "Alerta de Aproximação! (50m)", MensagensDeAproximacao[UnityEngine.Random.Range(0, MensagensDeAproximacao.Length - 1)], new Color32(0, 0, 0, 255), true, true, true, "ic_launcher");
         * }
         */
        if (Distancia > 25)
        {
            double distanciaPrevista  = Distancia;
            double velocidadePrevista = VelocidadeChar;
            int    tempoEmSegundos    = 0;

            while (distanciaPrevista > 25)
            {
                // SIMULA O GANHO E PERDA DE DISTANCIA ATRAVES DO TEMPO
                if (velocidadePrevista > VelocidadeMinimaAtual)
                {
                    distanciaPrevista += velocidadePrevista * 0.277778;

                    velocidadePrevista = DecrementarVelocidadePersonagem(velocidadePrevista, 1);

                    tempoEmSegundos++;
                }
                else
                {
                    distanciaPrevista -= (VelocidadeBear - VelocidadeMinimaAtual) * 0.277778;

                    tempoEmSegundos++;

                    // AGENDAR NOTIFICAÇÃO AOS 100M RESTANTES PARA ALCANÇAR
                    if (distanciaPrevista > 99 && distanciaPrevista < 101)
                    {
                        string[] MensagensDeAproximacao100 = new string[]
                        {
                            "Faltam menos de 100m pro Bear te pegar!",
                            "Not today, not tomorrow, but i will kill you"
                        };

                        LocalNotification.SendNotification(3, tempoEmSegundos * 1000, "Alerta de Aproximação! (100m)", MensagensDeAproximacao100[UnityEngine.Random.Range(0, MensagensDeAproximacao100.Length - 1)], new Color32(0, 0, 0, 255), true, true, true, "ic_launcher");
                    }

                    // AGENDAR NOTIFICAÇÃO AOS 50M RESTANTES PARA ALCANÇAR
                    if (distanciaPrevista > 49 && distanciaPrevista < 51)
                    {
                        string[] MensagensDeAproximacao50 = new string[]
                        {
                            "Faltam menos de 50m pro Bear te pegar!",
                            "Falta pouco pro Bear te pegar.",
                            "The life snake.",
                            "Hora de procastinar mais um pouco."
                        };

                        LocalNotification.SendNotification(3, tempoEmSegundos * 1000, "Alerta de Aproximação! (50m)", MensagensDeAproximacao50[UnityEngine.Random.Range(0, MensagensDeAproximacao50.Length - 1)], new Color32(0, 0, 0, 255), true, true, true, "ic_launcher");
                    }
                }
            }

            // AGENDAR NOTIFICAÇÃO AOS 25M RESTANTES PARA ALCANÇAR
            string[] MensagensDeAproximacao = new string[]
            {
                "Faltam menos de 25m pro Bear te pegar!",
                "O Bear vai te pegar!",
                "Ó o bicho vindo!",
                "Cachoooooooorro!",
                "Two minutes to miiiiiiiidniiiiight"
            };
            LocalNotification.SendNotification(1, tempoEmSegundos * 1000, "Alerta de Aproximação! (25m)", MensagensDeAproximacao[UnityEngine.Random.Range(0, MensagensDeAproximacao.Length - 1)], new Color32(0, 0, 0, 255), true, true, true, "ic_launcher");
        }
        else
        {
            LocalNotification.SendNotification(1, 15000, "Alerta de Aproximação!", "Tem certeza que já vai? O Bear logo vai te alcançar!", new Color32(0, 0, 0, 255), true, true, true, "ic_launcher");
        }
    }