//----------------------------------------------------------------------------
    //	@brief		ローカル通知のキャンセル
    //----------------------------------------------------------------------------
    public static void CancelAllNotifications()
    {
        if (Patcher.Instance.GetLocalNotificationCancelDisable())
        {
            return;
        }

#if LOCAL_NOTIFICATION_EDITOR
#if DEBUG_LOG
        // Editor
        Debug.Log("CancelAllNotification");
#endif
#elif LOCAL_NOTIFICATION_ANDROID
        // Android
        ELANManager.CancelAllNotifications();
#elif LOCAL_NOTIFICATION_IOS
        // iOS
        if (NotificationServices.localNotificationCount >= 0)
        {
            LocalNotification notification = new LocalNotification();
            if (notification != null)
            {
                notification.applicationIconBadgeNumber = -1;
                NotificationServices.PresentLocalNotificationNow(notification);

                NotificationServices.CancelAllLocalNotifications();
                NotificationServices.ClearLocalNotifications();
            }
        }
#endif
    }
Пример #2
0
    void OnGUI()
    {
        // Schedule notifications GUI
        GUI.Box(new Rect(10, 10, 340, 300), "ELAN Demo");

        if (GUI.Button(new Rect(20, 40, 120, 40), "Send"))
        {
            long d;
            if (long.TryParse(delay, out d))
            {
                long r;
                if (long.TryParse(rep, out r))
                {
                    if (r <= 0)
                    {
                        ELANManager.SendNotification(title, message, d);
                    }
                    else
                    {
                        ELANManager.ScheduleRepeatingNotification(title, message, d, r);
                    }
                    error = "";
                }
                else
                {
                    error = "Repetition must be an integer!";
                }
            }
            else
            {
                error = "Delay must be an integer!";
            }
        }
        title   = GUI.TextField(new Rect(20, 90, 120, 40), title, 15);
        message = GUI.TextField(new Rect(20, 140, 120, 40), message, 15);
        GUI.Label(new Rect(20, 190, 120, 40), "Delay");
        delay = GUI.TextField(new Rect(120, 190, 120, 40), delay, 15);
        GUI.Label(new Rect(20, 240, 120, 40), "Repetition");
        rep = GUI.TextField(new Rect(120, 240, 120, 40), rep, 15);
        if (GUI.Button(new Rect(20, 320, 120, 40), "Exit"))
        {
            Application.Quit();
        }

        GUI.Label(new Rect(20, 380, 300, 40), error);

        // Cancel scheduled notification GUI
        GUI.Box(new Rect(410, 10, 300, 150), "Cancel notifications");

        if (GUI.Button(new Rect(420, 40, 140, 40), "Cancel repeating"))
        {
            ELANManager.CancelRepeatingNotification();
        }
        if (GUI.Button(new Rect(420, 90, 140, 40), "Cancel ALL"))
        {
            ELANManager.CancelAllNotifications();
        }
    }
    //----------------------------------------------------------------------------
    //	@brief		ローカル通知設定
    //	@param[in]	string		(title)		通知文言:タイトル
    //	@param[in]	string		(text)		通知文言:本文
    //	@param[in]	int			(delay)		現在時刻から表示するまでの時間(秒)
    //----------------------------------------------------------------------------
    public static void SendNotification(string title, string text, int delay)
    {
        if (Patcher.Instance.GetLocalNotificationRegisterDisable())
        {
            return;
        }

        if (TimeManager.Instance == null)
        {
            return;
        }

#if LOCAL_NOTIFICATION_EDITOR
#if DEBUG_LOG
        // Editor
        Debug.Log("SetNotification: " + title + " / text: " + text + " / delay: " + delay);
#endif
#elif LOCAL_NOTIFICATION_ANDROID
        string package  = Application.identifier;
        string activity = "com.onevcat.uniwebview.AndroidPlugin";
        // Android
        ELANManager.SendNotification(title, text, package, activity, delay);
#elif LOCAL_NOTIFICATION_IOS
        // iOS(現在時刻とりなおして、ディレイ時間を足してるので若干登録時間に誤差がでるかも。気になるレベルではないはず)
        LocalNotification notification = new LocalNotification();
        if (notification != null)
        {
            // サーバー時間を加味して通知時間を変更している
            ulong    totalSeconds = TimeUtil.ConvertLocalTimeToServerTime(TimeManager.Instance.m_TimeNow.AddSeconds(delay));
            DateTime td           = TimeUtil.ConvertTotalSecondsToServerTime(totalSeconds);

            notification.applicationIconBadgeNumber = -1;
            notification.fireDate  = td;
            notification.alertBody = text;
            NotificationServices.ScheduleLocalNotification(notification);
        }
#endif
    }
Пример #4
0
    void OnGUI()
    {
        //Debug.Log("test..test");
        if (mainMenuSkin != null)
        {
            GUI.skin = mainMenuSkin;
        }


        /*
         * Dialog PlantAR
         * */


        //Introduction Dialog Box
        int dialogDivW = Screen.width * 4 / 5;
        int dialogDivH = Screen.height * 1 / 4;
        int dialogDivX = dialogDivW * 1 / 6;
        int dialogDivY = dialogDivH * 3;

        Color32 colorAux = GUI.backgroundColor;

        if (dialogPanel)
        {
            Color32 colorPanel = new Color(1, 1, 1, 0.25f);

            GUI.backgroundColor = colorPanel;

            if (myData.currentLevel == 1)
            {
                //x=0.21,y=0.25,font=18
                GUI.Box(new Rect(dialogDivX + 50, dialogDivY, dialogDivX * 4, dialogDivH - dialogDivH * 3 / 10), "");
            }
            else
            {
                //0.16,0.36,fsize=16,center
                GUI.Box(new Rect(dialogDivX + 50, dialogDivY - dialogDivH * 1 / 2, dialogDivX * 4, dialogDivH + dialogDivH * 3 / 10), "");
            }

            switch (nMessage)
            {
            case 0:
                dialogText.text = "Fin del Juego";
                break;

            case 1:
                dialogText.text = "Hola...  ¿Que hora es? ¿puedo seguir durmiendo? \nCreo que no";
                break;

            case 2:
                dialogText.text = "¡Está bien empecemos!";
                break;

            case 3:
                dialogText.text = "Soy una semilla muy rara de Planta de Gato \nSolo puedo crecer con agua luz solar \ny mucho cuidado";
                break;

            case 4:
                dialogText.text = "¿Me ayudas? \nsi / si";
                break;

            case 5:
                dialogText.text = "¡Genial! \nPero aun no tengo nombre ¿me das uno?";
                plantName       = GUI.TextField(new Rect(dialogDivX * 2, dialogDivY + dialogDivH * 4 / 10, 250, 50), plantName, 25);
                break;

            case 6:
                dialogText.text = "¡Me gusta mucho mi nombre!\nen especial cuando le agregas \n“La planta asombrosa” al final!";
                break;

            case 7:
                dialogText.text = "¡" + plantName + " la planta asombrosa!";
                break;

            case 8:
                dialogText.text = "Yo ya tengo nombre, pero yo no conozco el tuyo \n¿como te llamas?";
                playerName      = GUI.TextField(new Rect(dialogDivX * 2, dialogDivY + dialogDivH * 4 / 10, 250, 50), playerName, 25);
                break;

            case 9:
                dialogText.text     = "¡Excelente!\nAhora si podemos iniciar";
                myData.plantName    = plantName;
                myData.playerName   = playerName;
                myData.currentLevel = 2;
                SaveData();
                break;

            case 10:
                dialogText.text      = "";
                informationText.text = "¡Hola " + myData.playerName + "!\nSabias que las semillas necesitamos un lugar con tierra fértil\nde donde tomamos los nutrientes para vivir.\n¿Vez lo que está detrás de mi? \nEste será mi hogar, el cual ya tiene tierra para que me alimente.";
                break;

            case 11:
                informationText.text = "\nTengo hambre. ¿De casualidad traes abono contigo?\nEso es lo que comemos las plantas cuando nos sentimos débiles\ny se me antoja una buena porción.\nPara darme de comer, debes de seleccionar dentro\ndel menú \"Planta\" la opción que dice \"Abonar\"";
                dialogButton         = false;
                break;

            case 12:
                informationText.text = "\n\n\n                 ¡Mmmmm Mmmmm! Mucho mejor, gracias";
                dialogButton         = true;
                break;

            case 13:
                informationText.text = "\n\nSiento un poco de sed. ¿Me puedes dar agua, por favor?\nPara darme de beber debes seleccionar dentro\ndel menú \"Planta\" la opción que dice \"Regar\"";
                dialogButton         = false;
                break;

            case 14:
                informationText.text = "\n\n\n                 ¡Ahh! Eso se siente mucho mejor";
                dialogButton         = true;
                break;

            case 15:
                informationText.text = "¡Listo! Ya tengo todo para crecer bien y tener una vida genial.\n Pero recuerda sin tus cuidados no podré sobrevivir.\nEn el reloj de abajo puedes ver cuanto tiempo falta\npara que tome mi nueva forma.\nMientras tanto debes estar al pendiente, porque voy a necesitar\nmucho de tu ayuda. ";
                break;

            case 16:
                informationText.text = "n\n\nPienso que seremos buenos amigos, aunque no seas una planta ;)";
                animationHealth      = false;
                break;

            case 18:
                _textMessage = "          Ya voy Creciendo";
                break;

            case 19:
                _textMessage = "          Ya voy Creciendo.. mas";
                break;

            case 20:
                _textMessage = "          Ya voy Creciendo.. ++";
                break;

            case 21:
                _textMessage = "          Ya voy Creciendo.. +++";
                break;

            case 22:
                _textMessage = "          Ya voy Creciendo.. ++++";
                break;

            case 23:
                _textMessage = "          Felicidades eres un Campeon";
                break;
            }

            GUI.backgroundColor = colorAux;

            if (nMessage >= 18)
            {
                informationText.text = _textMessage;
                GUI.Button(new Rect(dialogDivX + dialogDivX * 4, dialogDivY - dialogDivH * 1 / 2, 100, 20), "Share FB");
            }
        }

        Color32 color = new Color(0, 0, 0, 0);

        GUI.backgroundColor = color;

        if (dialogButton)
        {
            if (myData.currentLevel == 1)
            {
                if (GUI.Button(new Rect(dialogDivX, dialogDivY, dialogDivX * 4, dialogDivH - dialogDivH * 4 / 10), ""))
                {
                    nMessage++;
                }
            }
            else
            {
                if (GUI.Button(new Rect(dialogDivX, dialogDivY - dialogDivH * 1 / 2, dialogDivX * 4, dialogDivH + dialogDivH * 3 / 10), ""))
                {
                    nMessage++;

                    //Level Start Game
                    if (nMessage == 17)
                    {
                        myData.waterAuxTime       = (float)Time.realtimeSinceStartup;
                        myData.modelAuxChangeTime = (float)Time.realtimeSinceStartup;
                        ELANManager.ScheduleRepeatingNotification("PlantAR", ":'( Agua", 0, 10);
                        myData.notificationOn     = true;
                        dialogButton              = false;
                        dialogPanel               = false;
                        informationText.text      = "";
                        waterCount                = waterFull;
                        compostCount              = compostFull;
                        myData.compostLevelHealth = compostFull;
                        myData.waterLevelHealth   = waterFull;
                        myData.sunLevelHealth     = waterFull;
                        myData.plantarTime        = (float)Time.realtimeSinceStartup;
                        myData.currentLevel       = 3;
                        compostHealth             = 1f;
                        waterHealth               = 1f;
                        sunHealth = 1f;

                        SaveData();
                    }

                    if (nMessage >= 18)
                    {
                        dialogButton         = false;
                        dialogPanel          = false;
                        informationText.text = "";
                    }
                }
            }
        }

        /*
         * Menu Planta Options
         * */

        //Main Menu
        GUI.backgroundColor = colorAux;
        GUI.Box(new Rect(Screen.width - Screen.width / 5, 0, Screen.width / 5, Screen.height), "", mainMenuSkin.GetStyle("Panel"));

        //Creating Buttons
        mMenuX   = Screen.width - Screen.width / 5;
        mMenuY   = 0;
        mMenuOpW = Screen.width / 5;
        mMenuOpH = Screen.height / 4;

        GUI.backgroundColor = color;

        if (bVisiblePlant)
        {
            if (GUI.Button(new Rect(mMenuX, mMenuY, mMenuOpW, mMenuOpH), iPlanta))
            {
                bVisiblePlant = false;
            }
        }

        //Plant Options (Abonar,Regar)
        if (!bVisiblePlant)
        {
            int plantMenuX = mMenuX - mMenuOpW * 2;
            int plantMenuw = mMenuOpW;
            int plantMenuH = mMenuOpH;

            GUI.backgroundColor = colorAux;

            GUI.Box(new Rect(plantMenuX, mMenuY, plantMenuw * 2, plantMenuH), "", mainMenuSkin.GetStyle("Panel"));

            GUI.backgroundColor = color;

            //Abonar
            if (GUI.Button(new Rect(plantMenuX, mMenuY, plantMenuw, plantMenuH), iAbonar))
            {
                bVisiblePlant = true;
                if (myData.currentLevel == 2 && nMessage == 11)
                {
                    animationHealth    = true;
                    compostTotalHealth = 1f;
                    timeReset          = true;
                    nMessage++;
                }
            }

            plantMenuX += plantMenuw;

            //Regar
            if (GUI.Button(new Rect(plantMenuX, mMenuY, plantMenuw, plantMenuH), iRegar))
            {
                bVisiblePlant = true;
                if (myData.currentLevel == 2 && nMessage == 13)
                {
                    waterTotalHealth = 1f;
                    timeReset        = true;
                    nMessage++;
                }
                else
                {
                    if (myData.currentLevel >= 3)
                    {
                        waterHealth += waterOne;

                        if (waterCount <= waterFull)
                        {
                            waterCount++;
                        }

                        myData.waterLevelHealth = waterCount;
                    }
                }
            }
            plantMenuX += plantMenuw;

            if (GUI.Button(new Rect(plantMenuX, mMenuY, plantMenuw, plantMenuH), iOverPlantar))
            {
                bVisiblePlant = true;
            }
        }



        /*
         * Animation Health Bars
         * */

        //Background
        GUI.BeginGroup(new Rect(compostPosition.x, compostPosition.y, compostSize.x, compostSize.y));
        GUI.Box(new Rect(0, 0, compostSize.x, compostSize.y), compostTextureEmpty);

        //Filling:
        GUI.BeginGroup(new Rect(0, 0, compostSize.x * compostHealth, compostSize.y));
        GUI.Box(new Rect(0, 0, compostSize.x, compostSize.y), compostTextureFull);
        GUI.EndGroup();
        GUI.EndGroup();


        //Background
        GUI.BeginGroup(new Rect(sunPosition.x, sunPosition.y, sunSize.x, sunSize.y));
        GUI.Box(new Rect(0, 0, sunSize.x, sunSize.y), sunTextureEmpty);

        //Filling:
        GUI.BeginGroup(new Rect(0, 0, sunSize.x * sunHealth, sunSize.y));
        GUI.Box(new Rect(0, 0, sunSize.x, sunSize.y), sunTextureFull);
        GUI.EndGroup();
        GUI.EndGroup();


        //Background
        GUI.BeginGroup(new Rect(waterPosition.x, waterPosition.y, waterSize.x, waterSize.y));
        GUI.Box(new Rect(0, 0, waterSize.x, waterSize.y), waterTextureEmpty);

        //Filling:
        GUI.BeginGroup(new Rect(0, 0, waterSize.x * waterHealth, waterSize.y));
        GUI.Box(new Rect(0, 0, waterSize.x, waterSize.y), waterTextureFull);
        GUI.EndGroup();
        GUI.EndGroup();


        mMenuY += Screen.height / 4;
        if (GUI.Button(new Rect(mMenuX, mMenuY, mMenuOpW, mMenuOpH), iLogros))
        {
            Application.LoadLevel("AchievementsMenu");
        }

        mMenuY += Screen.height / 4;
        if (GUI.Button(new Rect(mMenuX, mMenuY, mMenuOpW, mMenuOpH), iFoto))
        {
            StartCoroutine(TakeScreenshot());
            Application.LoadLevel("FacebookMenu");
        }

        mMenuY += Screen.height / 4;

        if (GUI.Button(new Rect(mMenuX, mMenuY, mMenuOpW, mMenuOpH), iConfig))
        {
            Application.LoadLevel("ConfigurationMenu");
        }

        /*
         * Timer Countdown
         * */
        /*DateTime time = DateTime.Now;
         * string hour = LeadingZero( time.Hour );
         * string minute = LeadingZero( time.Minute );
         * string second = LeadingZero( time.Second );
         * timerText.text = hour + ":" + minute + ":" +  second;*/

        if (myData.currentLevel >= 3 && myData.currentLevel < 9)
        {
            waterTime = myData.plantarTime - myData.waterAuxTime;

            modelChangeTime    = myData.plantarTime - myData.modelAuxChangeTime;
            waterTimeCountdown = modelChangeTimeTaken - modelChangeTime;

            if (waterTime >= waterTimeTaken)
            {
                myData.waterAuxTime = myData.plantarTime;
                waterHealth        -= waterOne;
                waterCount--;
                ELANManager.SendNotification("PlantAR", "Me estoy quedando sin agua.. :'(", 0);
                myData.waterLevelHealth = waterCount;
                Debug.Log("water Count " + waterCount);
                Debug.Log("Water Health " + waterHealth);

                if (waterCount == 0)
                {
                    myData.modelAuxChangeTime += penaltyTime;
                    compostHealth             -= compostOne;
                    compostCount--;
                    myData.compostLevelHealth = compostCount;

                    waterHealth             = 1f;
                    waterCount              = waterFull;
                    myData.waterLevelHealth = waterCount;

                    //------ GAME OVER ------
                    if (compostCount == 0)
                    {
                        dialogPanel         = true;
                        nMessage            = 0;
                        myData.currentLevel = 0;
                    }
                }
            }
            else
            {
                timeSpan = TimeSpan.FromSeconds(waterTimeCountdown);
                string timeText = string.Format("{0:D2}/{1:D2}:{2:D2}:{3:D2}", timeSpan.Days, timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
                timerText.text = timeText;
            }

            if (modelChangeTime > modelChangeTimeTaken)
            {
                Debug.Log("modelChangeTime " + modelChangeTime);
                Debug.Log("modelChangeTimeTaken " + modelChangeTimeTaken);
                myData.modelAuxChangeTime = myData.plantarTime;
                myData.modelType++;
                myData.currentLevel++;
                nMessage++;

                Debug.Log("Mensaje -> " + _textMessage);
                myAchievements.MessageStorage.Add(_textMessage);
                SaveAchievements();

                modelChange  = true;
                dialogButton = true;
                dialogPanel  = true;
            }

            myData.plantarTime = (float)Time.realtimeSinceStartup + initialTime;
            SaveData();
        }
    }
Пример #5
0
    void OnGUI()
    {
        GUI.skin = configurationSkin;

        //Background box Rect(x,y,width,height)
        //Main Menu
        Color32 colorAux = GUI.backgroundColor;

        GUI.Box(new Rect(0, 0, Screen.width * 4 / 5 + 10, Screen.height), "", configurationSkin.GetStyle("PanelContent"));

        GUI.Box(new Rect(Screen.width - Screen.width / 5, 0, Screen.width / 5, Screen.height), "", configurationSkin.GetStyle("PanelLeft"));

        //Creating Buttons
        mainMenuX = Screen.width - Screen.width / 5;
        mainMenuY = 0;
        menuOpW   = Screen.width / 5;
        menuOpH   = Screen.height / 4;

        Color32 color = new Color(0, 0, 0, 0);

        GUI.backgroundColor = color;

        if (bVisiblePlant)
        {
            if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iPlanta))
            {
                ApplicationModel.currentLevel = 1;
                Application.LoadLevel("InitialMainMenu");
            }
        }

        mainMenuY += Screen.height / 4;
        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iLogros))
        {
            Application.LoadLevel("AchievementsMenu");
        }

        mainMenuY += Screen.height / 4;
        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iFoto))
        {
            Application.LoadLevel("FacebookMenu");
        }

        mainMenuY += Screen.height / 4;
        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iConfig))
        {
            Application.LoadLevel("ConfigurationMenu");
        }

        /*
         *
         * Panel Configuration
         *
         * */

        int auxX = 0;
        int auxY = 0;

        GUI.backgroundColor = colorAux;

        GUI.Box(new Rect(Screen.width * 4 / 5 * 1 / 38, Screen.height * 1 / 27, Screen.width * 4 / 5 * 36 / 38, Screen.height * 25 / 27), "", configurationSkin.GetStyle("PanelCenter"));

        //Creating Buttons 3 iconos , 4 espaces
        mainMenuX = (Screen.width * 4 / 5) * 1 / 8;
        auxX      = mainMenuX;
        mainMenuY = (Screen.height / 3) * 1 / 2;
        menuOpW   = (Screen.width * 4 / 5) * 1 / 6;
        menuOpH   = Screen.height / 3 * 3 / 4;
        auxY      = Screen.height / 3 + Screen.height / 3 * 1 / 4;

        GUI.backgroundColor = color;

        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iAlertas))
        {
            optionMenu = 1;
        }
        GUI.Label(new Rect(mainMenuX + menuOpW * 1 / 4, mainMenuY + menuOpH, menuOpW, menuOpH), "Alertas");

        mainMenuX += auxX + menuOpW;

        GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iFB);
        GUI.Label(new Rect(mainMenuX + menuOpW * 1 / 5, mainMenuY + menuOpH, menuOpW, menuOpH), "Cuenta de Facebook");

        mainMenuX += auxX + menuOpW;

        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iAcerca))
        {
            optionMenu = 3;
        }
        GUI.Label(new Rect(mainMenuX + menuOpW * 1 / 4, mainMenuY + menuOpH, menuOpW, menuOpH), "A Cerca De");


        mainMenuX  = auxX;
        mainMenuY += auxY;

        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iHistorial))
        {
            optionMenu = 4;
        }

        GUI.Label(new Rect(mainMenuX + menuOpW * 1 / 4, mainMenuY + menuOpH, menuOpW, menuOpH), "Cambiar Nombre a Planta");

        mainMenuX += auxX + menuOpW;

        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iMensajes))
        {
            optionMenu = 5;
        }
        GUI.Label(new Rect(mainMenuX + menuOpW * 1 / 5, mainMenuY + menuOpH, menuOpW, menuOpH), "Cambiar Nombre Jugador");

        mainMenuX += auxX + menuOpW;

        if (GUI.Button(new Rect(mainMenuX, mainMenuY, menuOpW, menuOpH), iSonidos))
        {
            optionMenu = 6;
        }
        GUI.Label(new Rect(mainMenuX + menuOpW * 1 / 4, mainMenuY + menuOpH, menuOpW, menuOpH), "Reiniciar");


        /**
         * Creating Options
         * */

        GUI.backgroundColor = colorAux;

        mainMenuX = (Screen.width * 4 / 5) * 1 / 8;
        auxX      = mainMenuX;
        mainMenuY = (Screen.height / 3) * 1 / 2;
        menuOpW   = (Screen.width * 4 / 5) * 1 / 6;
        menuOpH   = Screen.height / 3 * 3 / 4;
        auxY      = Screen.height / 3 + Screen.height / 3 * 1 / 4;

        if (optionMenu > 0)
        {
            GUI.Box(new Rect(mainMenuX, mainMenuY, menuOpW * 5, menuOpH * 3), "");
        }

        switch (optionMenu)
        {
        case 1:
            buttonSaveX = mainMenuX + menuOpW * 5 / 2 - menuOpW / 2;
            buttonSaveY = mainMenuY + menuOpH * 3 / 2 - menuOpH / 4;

            notificationOn = GUI.Toggle(new Rect(buttonSaveX, buttonSaveY, 150, 15), notificationOn, "Activar/Desactivar");

            Debug.Log("Toggle " + notificationOn);
            if (GUI.Button(new Rect(buttonSaveX, buttonSaveY + 30, menuOpW, menuOpH / 2), "Guardar"))
            {
                ELANManager.CancelRepeatingNotification();
                if (notificationOn)
                {
                    myConfiguration.notificationOn = true;
                    ELANManager.ScheduleRepeatingNotification("PlantAR", ":'( Agua", 0, 10);
                    Debug.Log("Notification ON");
                }
                else
                {
                    myConfiguration.notificationOn = false;
                    Debug.Log("Notification OFF");
                }

                SaveConfiguration();
                optionMenu = 0;
            }
            break;

        case 2:
            break;

        case 3:
            buttonSaveX = mainMenuX + menuOpW * 5 / 2 - menuOpW / 2;
            buttonSaveY = mainMenuY + menuOpH * 2;
            string about = "PlantAR @Copyrights";
            GUI.Label(new Rect(mainMenuX + menuOpW, buttonSaveY - menuOpH * 3 / 2, menuOpW * 3, menuOpH * 2), about, configurationSkin.GetStyle("TextAbout"));

            if (GUI.Button(new Rect(buttonSaveX, buttonSaveY + 30, menuOpW, menuOpH / 4), "Aceptar"))
            {
                optionMenu = 0;
            }
            break;

        case 4:
            buttonSaveX = mainMenuX + menuOpW * 5 / 2 - menuOpW / 2;
            buttonSaveY = mainMenuY + menuOpH * 2;
            plantName   = GUI.TextField(new Rect(buttonSaveX - 50, buttonSaveY - menuOpH, 200, 25), plantName, 25);
            //playerName = GUI.TextField(new Rect(dialogDivX*2,dialogDivY+dialogDivH*4/10,200,25), playerName ,25);
            if (GUI.Button(new Rect(buttonSaveX, buttonSaveY + 30, menuOpW, menuOpH / 4), "Guardar"))
            {
                myConfiguration.plantName = plantName;
                optionMenu = 0;
                SaveConfiguration();
            }
            break;

        case 5:
            buttonSaveX = mainMenuX + menuOpW * 5 / 2 - menuOpW / 2;
            buttonSaveY = mainMenuY + menuOpH * 2;
            playerName  = GUI.TextField(new Rect(buttonSaveX - 50, buttonSaveY - menuOpH, 200, 25), playerName, 25);
            //playerName = GUI.TextField(new Rect(dialogDivX*2,dialogDivY+dialogDivH*4/10,200,25), playerName ,25);
            if (GUI.Button(new Rect(buttonSaveX, buttonSaveY + 30, menuOpW, menuOpH / 4), "Guardar"))
            {
                myConfiguration.playerName = playerName;
                SaveConfiguration();
                optionMenu = 0;
            }
            break;

        case 6:
            buttonSaveX = mainMenuX + menuOpW * 5 / 2 - menuOpW / 2;
            buttonSaveY = mainMenuY + menuOpH * 2;
            //playerName = GUI.TextField(new Rect(dialogDivX*2,dialogDivY+dialogDivH*4/10,200,25), playerName ,25);
            if (GUI.Button(new Rect(buttonSaveX, buttonSaveY + 30, menuOpW, menuOpH / 4), "Reiniciar"))
            {
                myConfiguration = new PlantARData();
                myAchievements  = new AchievementsData();
                CreateConfiguration();
                CreateAchievements();
                ApplicationModel.initialTime = 0;
                optionMenu = 0;
            }
            break;
        }
    }