private void Start()
    {
        myAV = FindObjectOfType <AvatarChoice>();
        int value = myAV.avchoice;

        if (value == 1)
        {
            myA = FindObjectOfType <ScoreA>();
        }
        else if (value == 2)
        {
            myB = FindObjectOfType <ScoreB>();
        }
        else if (value == 3)
        {
            myC = FindObjectOfType <ScoreC>();
        }
        else if (value == 4)
        {
            myD = FindObjectOfType <ScoreD>();
        }
        else if (value == 5)
        {
            myE = FindObjectOfType <ScoreE>();
        }
        else if (value == 6)
        {
            myF = FindObjectOfType <ScoreF>();
        }
        else if (value == 7)
        {
            myG = FindObjectOfType <ScoreG>();
        }
    }
Exemplo n.º 2
0
 private void GiveNote()
 {
     CheckNote = true;
     if (current_Button == ButtonType.ButtonR)
     {
         CL.setMusic(CL.clip_Rnote);
         CL.winAnim.gameObject.GetComponent <Animator>().Play("NoteR");
         ScoreR++;
         txtR.text  = ScoreR.ToString();
         note_StayR = false;
         Destroy(note_prefab);
     }
     else if (current_Button == ButtonType.ButtonB)
     {
         CL.setMusic(CL.clip_Bnote);
         CL.winAnim.gameObject.GetComponent <Animator>().Play("NoteB");
         ScoreB++;
         txtB.text  = ScoreB.ToString();
         note_StayB = false;
         Destroy(note_prefab);
     }
     else if (current_Button == ButtonType.ButtonG)
     {
         CL.setMusic(CL.clip_Gnote);
         CL.winAnim.gameObject.GetComponent <Animator>().Play("NoteG");
         ScoreG++;
         txtG.text  = ScoreG.ToString();
         note_StayG = false;
         Destroy(note_prefab);
     }
     else if (current_Button == ButtonType.ButtonP)
     {
         CL.setMusic(CL.clip_Pnote);
         CL.winAnim.gameObject.GetComponent <Animator>().Play("NoteP");
         ScoreP++;
         txtP.text  = ScoreP.ToString();
         note_StayP = false;
         Destroy(note_prefab);
     }
 }
Exemplo n.º 3
0
 private void DisplayScore()
 {
     TextD.text = ScoreD.ToString();
     TextG.text = ScoreG.ToString();
 }
Exemplo n.º 4
0
    void Start()
    {
        bonus.SetActive(false);
        bt_home.onClick.AddListener(navigate_toHome);
        highscore2 = PlayerPrefs.GetInt("current_lvl2highscore");
        nodechoice = PlayerPrefs.GetInt("current_selected_note");

        gameoverpanel.SetActive(false);
        myAV = FindObjectOfType <AvatarChoice>();
        int value = myAV.avchoice;

        if (value == 1)
        {
            myA = FindObjectOfType <ScoreA>();
        }
        else if (value == 2)
        {
            myB = FindObjectOfType <ScoreB>();
        }
        else if (value == 3)
        {
            myC = FindObjectOfType <ScoreC>();
        }
        else if (value == 4)
        {
            myD = FindObjectOfType <ScoreD>();
        }
        else if (value == 5)
        {
            myE = FindObjectOfType <ScoreE>();
        }
        else if (value == 6)
        {
            myF = FindObjectOfType <ScoreF>();
        }
        else if (value == 7)
        {
            myG = FindObjectOfType <ScoreG>();
        }


        //screenHalfSizeWorldUnits = new Vector2(Camera.main.aspect * Camera.main.orthographicSize, Camera.main.orthographicSize-1f);
        user_selection.Load_PlayerPrefs();
        if (nodechoice == 1)
        {
            StartCoroutine(SpawnA());
        }
        else if (nodechoice == 2)
        {
            StartCoroutine(SpawnB());
        }
        else if (nodechoice == 3)
        {
            StartCoroutine(SpawnC());
        }
        else if (nodechoice == 4)
        {
            StartCoroutine(SpawnD());
        }
        timerText.text = Mathf.RoundToInt(timeLeft).ToString();
    }