Exemplo n.º 1
0
    void Update()
    {
        //make this a for loop?
        if (Input.GetKeyDown(KeyCode.Alpha1) && triggers[0].IsNoteNear())
        {
            playerController.SetScore(triggers[0].GetScore());
            playerController.UpdatePlayer();
            noteController.DeactivateNote(triggers[0].GetNearNote());
        }
        else if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            playerController.UpdatePlayer();
        }

        if (Input.GetKeyDown(KeyCode.Alpha2) && triggers[1].IsNoteNear())
        {
            playerController.SetScore(triggers[1].GetScore());
            playerController.UpdatePlayer();
            noteController.DeactivateNote(triggers[1].GetNearNote());
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            playerController.UpdatePlayer();
        }

        if (Input.GetKeyDown(KeyCode.Alpha3) && triggers[2].IsNoteNear())
        {
            playerController.SetScore(triggers[2].GetScore());
            playerController.UpdatePlayer();
            noteController.DeactivateNote(triggers[2].GetNearNote());
        }
        else if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            playerController.UpdatePlayer();
        }

        if (Input.GetKeyDown(KeyCode.Alpha4) && triggers[3].IsNoteNear())
        {
            playerController.SetScore(triggers[3].GetScore());
            playerController.UpdatePlayer();
            noteController.DeactivateNote(triggers[3].GetNearNote());
        }
        else if (Input.GetKeyDown(KeyCode.Alpha4))
        {
            playerController.UpdatePlayer();
        }
    }
Exemplo n.º 2
0
 // Update is called once per frame
 void FixedUpdate()
 {
     transform.position -= transform.right / 8;
     if (transform.position.x < -10)
     {
         //make an event here to avoid tons of references?
         //break combo, go to next player & remove note
         playerController.UpdatePlayer();
         controller.DeactivateNote(gameObject);
     }
 }