示例#1
0
 public AddStepNoteOperation(Slide slide, SlideCurve slideCurve)
 {
     Invoke += () =>
     {
         slide.Add(slideCurve);
     };
     Undo += () =>
     {
         slide.Remove(slideCurve);
     };
 }
示例#2
0
    public static SlideCurve Get()
    {
        if (m_instance == null)
        {
            // var go = new GameObject("SlideCurve");
            // m_instance = go.AddComponent<SlideCurve>();

            m_instance = GameObject.Find("SlideCurve").GetComponent <SlideCurve>();
        }

        return(m_instance);
    }
示例#3
0
        private void DrawNote(PaintEventArgs e)
        {
            switch (noteType)
            {
            case NoteType.TAP:
                Tap.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.EXTAP:
                ExTap.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.EXTAPDOWN:
                ExTapDown.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.AWEXTAP:
                AwesomeExTap.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.FLICK:
                Flick.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.HELL:
                HellTap.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.HOLD:
                Hold.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f - 25), new SizeF(70, 50));
                HoldBegin.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.SLIDE:
                Slide.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f - 25), new SizeF(70, 50));
                SlideBegin.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

            case NoteType.SLIDECURVE:
                SlideCurve.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(80, 10));
                break;

                #region Air系の描画
            //HACK: いろいろとコードがガバガバなので後で直してもええんやで...
            case NoteType.AIRUPL:
                new AirUpL(8, new Position(), new PointF(previewBox.Width / 2f - 4 * 12, previewBox.Height / 2f + 15), -1).Draw(e.Graphics, new Point());
                break;

            case NoteType.AIRUPC:
                new AirUpC(8, new Position(), new PointF(previewBox.Width / 2f - 4 * 12, previewBox.Height / 2f + 15), -1).Draw(e.Graphics, new Point());
                break;

            case NoteType.AIRUPR:
                new AirUpR(8, new Position(), new PointF(previewBox.Width / 2f - 4 * 12, previewBox.Height / 2f + 15), -1).Draw(e.Graphics, new Point());
                break;

            case NoteType.AIRDOWNL:
                new AirDownL(8, new Position(), new PointF(previewBox.Width / 2f - 4 * 12, previewBox.Height / 2f + 15), -1).Draw(e.Graphics, new Point());
                break;

            case NoteType.AIRDOWNC:
                new AirDownC(8, new Position(), new PointF(previewBox.Width / 2f - 4 * 12, previewBox.Height / 2f + 15), -1).Draw(e.Graphics, new Point());
                break;

            case NoteType.AIRDOWNR:
                new AirDownR(8, new Position(), new PointF(previewBox.Width / 2f - 4 * 12, previewBox.Height / 2f + 15), -1).Draw(e.Graphics, new Point());
                break;

                #endregion
            case NoteType.AIRHOLD:
                AirHold.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f + 25), new SizeF(7, 50));
                AirAction.Draw(e, new PointF(previewBox.Width / 2f, previewBox.Height / 2f), new SizeF(78, 8));
                break;

            // HACK: 色や座標に即値を使っているのでよくない
            case NoteType.BPM:
                e.Graphics.DrawLine(
                    Pens.LimeGreen,
                    (previewBox.Width - 100) / 2f,
                    previewBox.Height / 2f,
                    (previewBox.Width + 100) / 2f,
                    previewBox.Height / 2f);
                break;

            // HACK: 同上
            case NoteType.HIGHSPEED:
                e.Graphics.DrawLine(
                    Pens.Red,
                    (previewBox.Width - 100) / 2f,
                    previewBox.Height / 2f,
                    (previewBox.Width + 100) / 2f,
                    previewBox.Height / 2f);
                break;

            default:
                break;
            }
        }