Example #1
0
 public override void ChangeNoteColor(Color color)
 {
     NoteFill.GetComponent <SpriteRenderer>().color        = color;
     FillNoteBody.GetComponent <SpriteRenderer>().color    = color;
     HollowNoteBody.GetComponent <SpriteRenderer>().color  = new Color(255, 255, 255, color.a);
     InnerNoteBorder.GetComponent <SpriteRenderer>().color = new Color(255, 255, 255, color.a);
     NoteBorder.GetComponent <SpriteRenderer>().color      = new Color(255, 255, 255, color.a);
 }
Example #2
0
    public override void Initialize(Note note)
    {
        NoteStopwatch = Stopwatch.StartNew();

        gameObject.transform.position = new Vector3((float)((note.x - 0.5) * GlobalState.PlayAreaWidth), (float)((note.y - 0.5) * GlobalState.PlayAreaHeight));

        Size = GlobalState.Config.DefaultNoteSize * (float)note.actual_size;
        NoteHead.transform.localScale    = new Vector2(Size, Size);
        NoteHead.transform.localPosition = new Vector3(0, Size);

        ApproachTime = (float)note.approach_time;

        Height = (float)(GlobalState.PlayAreaHeight * note.hold_tick / GlobalState.CurrentChart.page_list[note.page_index].PageSize);
        FillNoteBody.GetComponent <SpriteRenderer>().size   = new Vector2(Size, Height);
        HollowNoteBody.GetComponent <SpriteRenderer>().size = new Vector2(Size, Height);

        HoldTime = (float)note.hold_time;

        if (GlobalState.CurrentChart.page_list[note.page_index].scan_line_direction == -1)
        {
            transform.rotation = new Quaternion(0, 0, 1, 0);
        }
        else
        {
            transform.rotation = new Quaternion(0, 0, 0, 0);
        }

        CompletionPercentage = 0;
        FillNoteBodyMask.transform.localScale = new Vector3(Size * 50, 0);

        Highlighted = true;
        Highlight();

        Notetype = note.type;
        NoteID   = note.id;

        if (GlobalState.IsGameRunning)
        {
            NoteFill.transform.localScale        = NoteBorder.transform.localScale = new Vector3(0.6f, 0.6f);
            InnerNoteBorder.transform.localScale = new Vector3(0.4f, 0.4f);
            HollowNoteBody.transform.localScale  = new Vector3(0.2f, 1);
        }
        else
        {
            ChangeToPausedVisuals();
        }
    }
Example #3
0
 public void SetHeight(float height)
 {
     Height = height;
     FillNoteBody.GetComponent <SpriteRenderer>().size   = new Vector2(Size, height);
     HollowNoteBody.GetComponent <SpriteRenderer>().size = new Vector2(Size, height);
 }