示例#1
0
    public void UpdateNote(NoteInfo noteInfo)
    {
        Duration = noteInfo.Duration == 0 ? 0.25f : noteInfo.Duration;

        NoteMeshFilter.mesh         = GeometryCreator.CreateNote(Duration, noteInfo.Deformations);
        NoteMeshCollider.sharedMesh = null;
        NoteMeshCollider.sharedMesh = NoteMeshFilter.mesh;

        _noteType = noteInfo.NoteType;

        Color newColor = Color.white;

        switch (_noteType)
        {
        case TypeOfNotes.Blue:
            newColor = Color.blue;
            break;

        case TypeOfNotes.Green:
            newColor = Color.green;
            break;

        case TypeOfNotes.Red:
            newColor = Color.red;
            break;

        case TypeOfNotes.Yellow:
            newColor = Color.yellow;
            break;
        }

        NoteRenderer.material.color = newColor;
        _xPosition = noteInfo.XPosition;
    }
示例#2
0
 private void ChangeColor()
 {
     if (Input.GetKey(KeyCode.A))
     {
         PlayerColor = TypeOfNotes.Red;
     }
     else if (Input.GetKey(KeyCode.S))
     {
         PlayerColor = TypeOfNotes.Green;
     }
     else if (Input.GetKey(KeyCode.D))
     {
         PlayerColor = TypeOfNotes.Blue;
     }
     else if (Input.GetKey(KeyCode.F))
     {
         PlayerColor = TypeOfNotes.Yellow;
     }
 }