Ejemplo n.º 1
0
    private void CheckForHit()
    {
        int myZ = (int)flecha.transform.localEulerAngles.z;

        Debug.Log("myZ is " + myZ);

        if ((myZ >= 291 && myZ <= 315) && goRight == true)
        {
            currNumWins += 1;
            source.PlayOneShot(right);
            int miInt = int.Parse(counter.GetParsedText());
            counter.text = (miInt - 1).ToString();
        }
        else if ((myZ >= 283 && myZ <= 307) && goRight == false)
        {
            currNumWins += 1;
            source.PlayOneShot(right);
            int miInt = int.Parse(counter.GetParsedText());
            counter.text = (miInt - 1).ToString();
        }
        else
        {
            //Debug.Log("buen intento, pero NO");
            currNumWins = 0;

            ////////SONIDO DE FALLAR
            source.PlayOneShot(wrong);
            counter.text = numWins.ToString();
        }
    }
Ejemplo n.º 2
0
    //////////////////////////////////////////////////////////////////////////

    public override string GetText()
    {
        if (!m_TryToReadLabel)
        {
            if (IsNameLocalizationKey())
            {
                return(CombinePrefix(UAP_AccessibilityManager.Localize(m_Text)));
            }
            return(m_Text);
        }

        TextMeshProUGUI label = GetLabel();

        if (label != null)
        {
            if (IsNameLocalizationKey())
            {
                return(CombinePrefix(UAP_AccessibilityManager.Localize(label.GetParsedText())));
            }
            else
            {
                return(CombinePrefix(label.GetParsedText()));
            }
        }

#if ACCESS_NGUI
        UILabel nGUILabel = GetNGUILabel();
        if (nGUILabel != null)
        {
            if (IsNameLocalizationKey())
            {
                return(CombinePrefix(UAP_AccessibilityManager.Localize(nGUILabel.text)));
            }
            else
            {
                return(CombinePrefix(nGUILabel.text));
            }
        }
#endif

        //Debug.Log("Getting item text " + m_Text);

        if (IsNameLocalizationKey())
        {
            return(UAP_AccessibilityManager.Localize(m_Text));
        }

        return(m_Text);
    }
    // Update is called once per frame
    void Update()
    {
        if (!PlayController.isGameOver)
        {
            seconds += Time.deltaTime;
            if (seconds > 59)
            {
                seconds = 0f;
                minute++;
            }
            gameTimeText.SetText(minute.ToString().Length > 1? minute.ToString() : "0" + minute.ToString() + ":"
                                 + (((int)seconds).ToString().Length > 1? ((int)seconds).ToString() : "0" + ((int)seconds).ToString()));
        }
        else
        {
            gameOverUI.SetActive(true);
            gamePlayUI.SetActive(false);
            gameOverTimeText.SetText("Time:" + gameTimeText.GetParsedText());
            int bestMintues = PlayerPrefs.GetInt("Minutes");
            int bestSeconds = PlayerPrefs.GetInt("Seconds");

            if (minute > bestMintues || minute >= bestMintues && seconds > bestSeconds)
            {
                PlayerPrefs.SetInt("Minutes", minute);
                PlayerPrefs.SetInt("Seconds", (int)seconds);
            }
            PlayController.isGameOver = false;
        }
    }
Ejemplo n.º 4
0
    private void Awake()
    {
        GameSession.instance.SetScoreDisplay(this);

        scoreDisplay = GetComponent <TextMeshProUGUI>();
        totalLength  = scoreDisplay.GetParsedText().Length;
    }
Ejemplo n.º 5
0
        /// <summary>
        /// 设置带省略号文本...
        /// </summary>
        public static void SetTextWithEllipsis(this TextMeshProUGUI component, string content)
        {
            if (string.IsNullOrEmpty(content))
            {
                component.text = string.Empty;
            }
            else
            {
                component.text = content;

                component.ForceMeshUpdate();

                string value = component.GetParsedText();

                if (string.IsNullOrEmpty(value))
                {
                    return;
                }

                if (value.Length < 3)
                {
                    return;
                }

                if (value.Length < content.Length)
                {
                    value = content.Substring(0, value.Length - 3) + "...";
                }

                component.text = value;
            }
        }
Ejemplo n.º 6
0
    public void CoinTracker(int coinIn)
    {
        if (stopwatch.IsRunning && stopwatch.Elapsed < MinInterval)
        {
            return;
        }

        try
        {
            var coinText        = coinsText.GetParsedText();
            var coinString      = coinText.Replace("x", "");
            var coinValue       = int.Parse(coinString) + coinIn;
            var tempCoinsLength = CoinsTextLength - coinValue.ToString().Length;

            coinString = "";
            for (var i = 0; i < tempCoinsLength; i++)
            {
                coinString += "0";
            }

            coinString += coinValue.ToString();

            coinsText.SetText("x" + coinString);

            ScoreTracker(100);
        }
        finally
        {
            stopwatch.Reset();
        }
    }
    /// <summary>
    /// Type the sentence on the dialogue canvas
    /// </summary>
    /// <param name="sentence">Sentence that will be shown next</param>
    /// <param name="interactable">Indicates whether the dialogue canvas is skippable or not</param>
    /// <returns>An IEnumerator</returns>
    IEnumerator TypeSentence(string sentence, bool interactable)
    {
        // render the text behind the scenes, allows rich text effects to be applied nicely
        dialogueText.text = sentence;
        dialogueText.maxVisibleCharacters = 0;
        yield return(new WaitForSeconds(TYPE_SPEED));

        // text w/o rich text tags
        string parsedText = dialogueText.GetParsedText();

        for (int i = 0; i <= parsedText.Length; i++)
        {
            int visibleCount = i % (parsedText.Length + 1);
            dialogueText.maxVisibleCharacters = visibleCount;
            yield return(new WaitForSeconds(TYPE_SPEED));

            // play typing sound
            if (i % 2 == 0 && visibleCount < parsedText.Length)
            {
                StartCoroutine(AudioHelper.PlayAudio(audioSource, typingSound));
            }
            else
            {
                AudioHelper.StopAudio(audioSource);
            }
        }
        if (!interactable)
        {
            StartCoroutine(AutoPlay(sentence));
        }
    }
Ejemplo n.º 8
0
        public void OnWordTyped(string letters)
        {
            WordWasInvalid = false;
            WordComplete   = false;

            var word    = _text.GetParsedText();
            var newText = word;

            if (string.Equals(letters, word))
            {
                DoCompleteWordAnimation(_wordCompleteAnimationDuration);
                WordComplete = true;
                newText      = string.Format("<u>{0}</u>", word);
            }
            else if (word.StartsWith(letters))
            {
                var firstPart = word.Substring(0, letters.Length);
                newText = string.Format("<u>{0}</u>{1}", firstPart, word.Substring(letters.Length));
            }
            else
            {
                WordWasInvalid = true;
            }

            _text.SetText(newText);
        }
Ejemplo n.º 9
0
 // Update is called once per frame
 void Update()
 {
     if (PedestalOne.GetParsedText().Equals("1") && PedestalTwo.GetParsedText().Equals("1"))
     {
         BirdLight.gameObject.SetActive(true);
     }
     else
     {
         BirdLight.gameObject.SetActive(false);
     }
 }
Ejemplo n.º 10
0
    private void SetupNextLine(string[] coTextLines)
    {
        // Get sprite/name info
        SetSpriteField(coTextLines);
        SetNameField(coTextLines);
        coTextLines[currentline] = coTextLines[currentline].Replace("Mark", BasicFunctions.Name);

        textboxText.maxVisibleCharacters = 0;
        textboxText.text = coTextLines[currentline];
        textboxText.ForceMeshUpdate();
        parsedContent = textboxText.GetParsedText();
    }
Ejemplo n.º 11
0
 public void UpdateDeaths()
 {
     try
     {
         int current = int.Parse(deathsLabel.GetParsedText());
         SetDeaths(current + 1);
     }
     catch (FormatException)
     {
         SetDeaths(0);
     }
 }
Ejemplo n.º 12
0
 public void ConfirmedBuyTeam()
 {
     Debug.Log("Successfully bought this team");
     // Need to check amount then allow player to buy team
     if (teamDict.ContainsKey(teamNameText.GetParsedText().ToString()))
     {
         userDataController.userData.baskyCoins -= teamDict[teamNameText.GetParsedText()].TeamCost;
         userDataController.SaveGameData();
         baskyCoins.SetText(userDataController.userData.baskyCoins.ToString());
         teamDict[teamNameText.GetParsedText()].LockedStatus = false;
         teamDataController.EditTeamData(teamDict[teamNameText.GetParsedText().ToString()]);
         LoadBuyTeamData();
         if (teamDict == null || teamDict.Count == 0)
         {
             noTeamToBuyPopup.SetActive(true);
         }
         else
         {
             noTeamToBuyPopup.SetActive(false);
         }
     }
     else
     {
         Debug.Log("Team does not exist in dictionary");
     }
 }
Ejemplo n.º 13
0
        private void SetupTextboxGroup()
        {
            if (!playerConversant.IsActive())
            {
                return;
            }

            SetNameAndSprite();
            textContainer.SetActive(true);
            dialogueText.text = ReplaceSubstringVariables(playerConversant.GetText());
            dialogueText.maxVisibleCharacters = 0;
            dialogueText.ForceMeshUpdate();
            parsedContent = dialogueText.GetParsedText();
        }
Ejemplo n.º 14
0
    public void SetCurrentLevel(int lvl)
    {
        int best = -1;

        try
        {
            best = Math.Max(int.Parse(bestLvlLabel.GetParsedText()), lvl);
        }
        catch (FormatException)
        {
            best = lvl;
        }

        currentLvlLabel.SetText("{0}", lvl);
        bestLvlLabel.SetText("{0}", best);
    }
Ejemplo n.º 15
0
    public void ScoreTracker(int scoreIn)
    {
        var scoreTextCurrent = scoreText.GetParsedText();
        var scoreString      = scoreTextCurrent.Replace("MARIO", "");

        var scoreValue = int.Parse(scoreString) + scoreIn;

        var tempScoreLength = ScoreTextLength - scoreValue.ToString().Length;

        scoreString = "";
        for (var i = 0; i < tempScoreLength; i++)
        {
            scoreString += "0";
        }

        scoreString += scoreValue.ToString();

        scoreText.SetText("MARIO\n" + scoreString);
    }
Ejemplo n.º 16
0
        private string GameObjectText()
        {
            TMP_Text tmpText = gameObject.GetComponent <TMP_Text>();

            if (tmpText)
            {
                return(tmpText.GetParsedText());
            }
            TextMeshProUGUI tmpUIText = gameObject.GetComponent <TextMeshProUGUI>();

            if (tmpUIText)
            {
                return(tmpUIText.GetParsedText());
            }
            Text text = gameObject.GetComponent <Text>();

            if (text)
            {
                return(text.text);
            }
            return(null);
        }
Ejemplo n.º 17
0
    public void pickOptionOne()
    {
        if (!option1Text.GetParsedText().Equals("Continue"))
        {
            option2.gameObject.SetActive(false);
            question.SetText(sceneData.GetSceneData(sceneName, progress).successExplanation);

            option1Text.SetText("Continue");
        }
        else
        {
            questionBoard.SetActive(false);
            progress++;
            Time.timeScale = 1;


            if (SceneDataAccesor.previousScene != null &&
                SceneDataAccesor.previousScene.Equals(SceneManager.GetActiveScene().name))
            {
                SceneManager.LoadScene("Transition Scene");
            }
        }
    }
Ejemplo n.º 18
0
    // Update is called once per frame
    void Update()
    {
        //Incrementing time until game is over
        if (!PlayerController.isGameOver)
        {
            sec += Time.deltaTime;
            if (sec > 59)
            {
                sec = 0f;
                min++;
            }
            //Printing time elapsed in "00:00" format
            GameTimeTXT.SetText((min.ToString().Length > 1 ? min.ToString() : "0" + min.ToString()) + ":"
                                + (((int)sec).ToString().Length > 1 ? ((int)sec).ToString() : "0" + ((int)sec).ToString())
                                );
        }
        else
        {
            gameplayUI.SetActive(false);
            gameoverUI.SetActive(true);
            gameplayTimeTXT.SetText("TIME SURVIVED - " + GameTimeTXT.GetParsedText());
            int BestMin = PlayerPrefs.GetInt("Minutes");
            int BestSec = PlayerPrefs.GetInt("Seconds");

            if (sec > BestSec)
            {
                PlayerPrefs.SetInt("Seconds", (int)sec);
                PlayerPrefs.SetInt("Minutes", min);
            }
            else if (min >= BestMin && sec > BestSec)
            {
                PlayerPrefs.SetInt("Seconds", (int)sec);
                PlayerPrefs.SetInt("Minutes", min);
            }
        }
    }
Ejemplo n.º 19
0
    IEnumerator TypeText(int visible)
    {
        Text.maxVisibleCharacters = visible;
        Text.text = message;

        Effects.DynamicAnimator();

        if (!Skipping)
        {
            yield return(new WaitForSeconds(Time.deltaTime));

            while (Text.maxVisibleCharacters < Text.GetParsedText().Length)
            {
                Stratus.Scene.Dispatch <AudioManager.AudioEvent>(new AudioManager.AudioEvent(AudioManager.AudioEvent.SoundType.SFX, ScrollEvent));

                /*
                 * if (!audios.isPlaying)
                 * {
                 *  if (Text.maxVisibleCharacters < Text.GetParsedText().Length)
                 *  {
                 *      print(Text.maxVisibleCharacters);
                 *      audios.volume = DefaultVolume * Game.current.Progress.GetFloatValue("SFXVolume")
                 * Game.current.Progress.GetFloatValue("MasterVolume");
                 *      audios.PlayOneShot(sound);
                 *  }
                 *
                 *
                 * }
                 */
                if (UpdateSpeed.ContainsKey(Text.maxVisibleCharacters))
                {
                    if (UpdateSpeed.ContainsKey(Text.maxVisibleCharacters + 1))
                    {
                        letterPause = (UpdateSpeed[Text.maxVisibleCharacters]);

                        print("Delay " + letterPause);
                    }
                    else
                    {
                        letterPause = 1 / (UpdateSpeed[Text.maxVisibleCharacters] * PauseSpeedMultiplier);
                        print("on " + letterPause + "with Speed: " + UpdateSpeed[Text.maxVisibleCharacters]);
                    }
                }

                var vis = Text.maxVisibleCharacters;

                if (vis < 0)
                {
                    vis = 0;
                }
                if (vis >= Text.GetParsedText().Length)
                {
                    vis = Text.GetParsedText().Length - 1;
                }


                var charaPause = DelayContains(vis, letterPause);
                //print(Text.GetParsedText()[vis] + " " + charaPause);
                Text.maxVisibleCharacters++;

                Effects.AnimateText();

                yield return(new WaitForSeconds(charaPause));
            }
        }
        else
        {
            Text.maxVisibleCharacters = message.Length;
            yield return(new WaitForSeconds(letterPause));
        }



        Text.maxVisibleCharacters = message.Length;

        //audios.Stop();
        Space.DispatchEvent(Events.FinishedAutoType);

        while (true)
        {
            Effects.AnimateText();
            yield return(new WaitForSeconds(Time.deltaTime));
        }
    }
Ejemplo n.º 20
0
 // Update is called once per frame
 void Update()
 {
     GetComponent <TextMeshProUGUI>().text = textToCopy.GetParsedText();
 }
Ejemplo n.º 21
0
 private void CambiaCounter()
 {
     //SONIDO DE "CHOP" DE UN CUCHILLO
     miInt        = int.Parse(counter.GetParsedText());
     counter.text = (miInt - 1).ToString();
 }
    private IEnumerator ReadLine()
    {
        audioSource.pitch = dialogue1.interlocutor.pitch;
        foreach (string stringLine in dialogue1.lines)
        {
            m_TextMeshPro.text = stringLine;
            int totalVisibleCharacters = m_TextMeshPro.textInfo.characterCount;
            m_TextMeshPro.maxVisibleCharacters = 0;
            m_TextMeshPro.ForceMeshUpdate();
            char[] line = RemoveAccents(m_TextMeshPro.GetParsedText().ToLower()).ToCharArray();

            for (int i = 0; i < line.Length; i++)
            {
                m_TextMeshPro.maxVisibleCharacters = i + 1;

                if (line[i] != ' ' && line[i] != ',' && line[i] != '\'')
                {
                    if (line[i] == 'y')
                    {
                        line[i] = 'i';
                    }
                    if (isVoyelle(line[i]))
                    {
                        audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["" + line[i]]);
                    }
                    else if (isConsonne(line[i]))
                    {
                        if (i + 1 < line.Length)
                        {
                            if (isComplex(line[i]) && line[i + 1] == 'h')
                            {
                                if (i + 2 < line.Length && isVoyelle(line[i + 2]))
                                {
                                    audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["" + line[i] + line[i + 1] + line[i + 2]]);
                                }
                                else
                                {
                                    audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["" + line[i] + line[i + 1] + ('e')]);
                                }
                                i++;
                            }
                            else
                            {
                                if (line[i] == 'y')
                                {
                                    line[i] = 'i';
                                }
                                if (isVoyelle(line[i + 1]))
                                {
                                    audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["" + line[i] + line[i + 1]]);
                                }
                                else
                                {
                                    audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["" + line[i] + ('e')]);
                                }
                            }
                        }
                        else
                        {
                            audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["" + line[i] + ('e')]);
                        }
                    }
                    else
                    {
                        audioSource.PlayOneShot(values[dialogue1.interlocutor.name]["_punctuation"]);
                    }
                }

                yield return(new WaitForSecondsRealtime((faster == true) ? 0.01f : 0.06f));
            }
            nextLine = false;
            faster   = false;
            yield return(new WaitUntil(() => nextLine == true));
        }
        nextDialogue      = true;
        dialogueMustStart = false;
    }
Ejemplo n.º 23
0
 protected virtual void SetupModification()
 {
     ModificationStartIndex = TextContainer.GetParsedText().IndexOf(TextToModify, StringComparison.Ordinal);
     ModificationEndIndex   = ModificationStartIndex + TextToModify.Length;
 }
Ejemplo n.º 24
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown("escape"))
        {
            currNumWins = 0;
            exito       = false;
            gameEnded   = true;
            Invoke("EndJuego", .5f);
            source.PlayOneShot(escape);
        }

        if (gameEnded == false)
        {
            if (currNumWins == winsNeeded)
            {
                //Debug.Log("won game");
                exito = true;
                EndJuego();
            }

            //GENERATING
            if (state == generating)
            {
                if (Time.time - waitTime2 > pausaEntreFallos)
                {
                    miSecuencia[k] = Random.Range(0, 4);
                    //Debug.Log(k + "th element is " + miSecuencia[k]);
                    waitTime  = Time.time;
                    currBoton = miSecuencia[k];
                    ActivaBoton();
                    state = waiting;
                    if (k < maxSecuencia)
                    {
                        k++;
                    }
                }
            }

            //WAITING
            if (state == waiting)
            {
                if (Time.time - waitTime > pausaSecuencia)
                {
                    //Debug.Log("YEAH");
                    if (k == maxSecuencia)
                    {
                        DesactivaBoton();
                        k = 0;
                        //printSequence();
                        validator = 0;
                        state     = validating;
                        waitTime2 = Time.time;
                    }
                    else
                    {
                        DesactivaBoton();
                        state = generating;
                    }
                }
            }

            //VALIDATING
            if (state == validating)
            {
                //Debug.Log("validator is: "+validator);
                if (validator == miSecuencia.Length)
                {
                    currNumWins++;
                    int miInt = int.Parse(counter.GetParsedText());
                    counter.text = (miInt - 1).ToString();
                    //Debug.Log("Has ganado " + currNumWins + " veces!");
                    waitTime2 = Time.time;
                    state     = waiting;
                    validator = 0;
                }

                int nextBoton = miSecuencia[validator];

                if (Input.GetKeyDown("a"))
                {
                    if (nextBoton == 0)
                    {
                        currBoton = 0;
                        ActivaBoton();
                        validator++;
                        ///SONIDO - PRESIONAR TECLA
                        source.PlayOneShot(button);
                        DesactivaBoton();
                    }
                    else
                    {
                        ///SONIDO - FALLAR
                        ///
                        //Debug.Log("A - wrong");
                        validator    = 0;
                        waitTime2    = Time.time;
                        counter.text = winsNeeded.ToString();
                        state        = waiting;
                        currNumWins  = 0;
                        source.PlayOneShot(wrong);
                    }
                }

                if (Input.GetKey("w"))
                {
                    currBoton = 1;
                    ActivaBoton();
                }

                else if (Input.GetKey("a"))
                {
                    currBoton = 0;
                    ActivaBoton();
                }

                else if (Input.GetKey("s"))
                {
                    currBoton = 2;
                    ActivaBoton();
                }

                else if (Input.GetKey("d"))
                {
                    currBoton = 3;
                    ActivaBoton();
                }


                else
                {
                    DesactivaBoton();
                }

                if (Input.GetKeyDown("w"))
                {
                    if (nextBoton == 1)
                    {
                        currBoton = 1;
                        validator++;
                        ///SONIDO - PRESIONAR TECLA
                        source.PlayOneShot(button);
                        DesactivaBoton();
                    }
                    else
                    {
                        ///SONIDO - FALLAR
                        ///
                        //Debug.Log("W - wrong");
                        validator    = 0;
                        waitTime2    = Time.time;
                        counter.text = winsNeeded.ToString();
                        state        = waiting;
                        currNumWins  = 0;
                        source.PlayOneShot(wrong);
                    }
                }

                if (Input.GetKeyDown("s"))
                {
                    if (nextBoton == 2)
                    {
                        currBoton = 2;
                        ActivaBoton();
                        validator++;
                        ///SONIDO - PRESIONAR TECLA
                        source.PlayOneShot(button);
                        DesactivaBoton();
                    }
                    else
                    {
                        ///SONIDO - FALLAR
                        //Debug.Log("S - wrong");
                        validator    = 0;
                        waitTime2    = Time.time;
                        counter.text = winsNeeded.ToString();
                        state        = waiting;
                        currNumWins  = 0;
                        source.PlayOneShot(wrong);
                    }
                }

                if (Input.GetKeyDown("d"))
                {
                    if (nextBoton == 3)
                    {
                        currBoton = 3;
                        ActivaBoton();
                        validator++;
                        ///SONIDO - PRESIONAR TECLA
                        source.PlayOneShot(button);
                        DesactivaBoton();
                    }
                    else
                    {
                        ///SONIDO - FALLAR
                        ///
                        //Debug.Log("D - wrong");
                        validator    = 0;
                        waitTime2    = Time.time;
                        counter.text = winsNeeded.ToString();
                        state        = waiting;
                        currNumWins  = 0;
                        source.PlayOneShot(wrong);
                    }
                }
            }
        }

        //  The easy way out.
        if (Input.GetKeyDown("y"))
        {
            exito = true;
            EndJuego();
        }
    }
Ejemplo n.º 25
0
    public void CallAddRoutine()
    {
        string subject_code, block_string, block_id, class_string, start_string, day_string, end_string;
        int    index = 0;

        subject_code = sub_code.GetParsedText().Trim();
        class_string = class_name.GetParsedText().Trim();
        start_string = start_time.GetParsedText().Trim();
        end_string   = end_time.GetParsedText().Trim();
        day_string   = day.GetParsedText().Trim();
        block_string = "Test";
        block_id     = "test";
        if (subject_code.Length == 0 || class_string.Length == 0 || start_string.Length == 0 || end_string.Length == 0 || day_string.Length == 0)
        {
            error.text = "The input field may be empty.";
        }
        else
        {
            //FOR BLOCK
            int temp = Convert.ToInt32(block.GetParsedText().Trim());
            if (temp <= 14 && temp > 0)
            {
                if (temp < 10)
                {
                    block_string = "Block " + temp;
                    block_id     = "blk0" + temp;
                }
                else
                {
                    block_string = "Block " + temp;
                    block_id     = "blk" + temp;
                }
                index++;
            }
            //FOR Subject Code
            for (int i = 0; i < subjects.Count; i++)
            {
                if (subject_code.Trim() == subjects[i].ToString().Trim())
                {
                    index++;
                    subject_code = subject_code.Trim();
                    break;
                }
            }
            //DAY
            int day_id = GetDayId(day_string.ToUpper());
            //FOR duplicate routines

            if (index == 2)
            {
                //subject and block name passed
                if (day_id != 0)
                {
                    int checkRoutine = db.CheckRoutine(day_id, block_string, class_string, start_string, end_string);
                    if (checkRoutine == 1)
                    {
                        Debug.Log("All correct No class in that time");
                        db.AddRoutine(class_string, day_id, subject_code, block_string, block_id, start_string, end_string);
                    }
                    else
                    {
                        Debug.Log("Classes in that time");
                        error.text = "Class " + class_string + " of " + block_string + "is not empty at that time";
                    }
                }
                else
                {
                    error.text = "The day input is incorrect";
                }
            }
            else
            {
                error.text = "Either the Subject doesnt exist or the block";
            }
        }
    }