Example #1
0
 public override void ChangeNoteColor(Color color)
 {
     NoteFill.GetComponent <SpriteRenderer>().color             = color;
     BottomFillNoteBody.GetComponent <SpriteRenderer>().color   = color;
     TopFillNoteBody.GetComponent <SpriteRenderer>().color      = color;
     TopHollowNoteBody.GetComponent <SpriteRenderer>().color    = new Color(255, 255, 255, color.a);
     BottomHollowNoteBody.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);

        ApproachTime = (float)note.approach_time;

        TopHeight = (float)(1.0 - note.y) * GlobalState.PlayAreaHeight;
        TopFillNoteBody.GetComponent <SpriteRenderer>().size   = new Vector2(Size, TopHeight);
        TopHollowNoteBody.GetComponent <SpriteRenderer>().size = new Vector2(Size, TopHeight);

        BottomHeight = (float)note.y * GlobalState.PlayAreaHeight;
        BottomFillNoteBody.GetComponent <SpriteRenderer>().size   = new Vector2(Size, BottomHeight);
        BottomHollowNoteBody.GetComponent <SpriteRenderer>().size = new Vector2(Size, BottomHeight);

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

        HoldTime = (float)note.hold_time;

        Highlighted = true;
        Highlight();

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

        FinishIndicator.SetActive(!GlobalState.IsGameRunning);

        if (GlobalState.IsGameRunning)
        {
            TopHollowNoteBody.transform.localScale    = new Vector3(0.2f, 1);
            BottomHollowNoteBody.transform.localScale = new Vector3(0.2f, 1);
            NoteFill.transform.localScale             = NoteBorder.transform.localScale = new Vector3(0.6f, 0.6f);
            InnerNoteBorder.transform.localScale      = new Vector3(0.4f, 0.4f);
        }
        else
        {
            ChangeToPausedVisuals();
        }
    }
 public void SetBottomHeight(float height)
 {
     BottomHeight = height;
     BottomFillNoteBody.GetComponent <SpriteRenderer>().size   = new Vector2(Size, height);
     BottomHollowNoteBody.GetComponent <SpriteRenderer>().size = new Vector2(Size, height);
 }