예제 #1
0
파일: NotesUI.cs 프로젝트: CamiTori/Catneep
 public void OnIconEvent(NoteEventType eventType)
 {
     switch (eventType)
     {
     case NoteEventType.Hit:
         indicatorUI.OnNoteHit();
         break;
     }
 }
예제 #2
0
        public int x; //lane

        #endregion Fields

        #region Constructors

        public NoteEvent(bool c, int id, int measure, double measureDiv, int channel)
        {
            x = GetBmsOnX(channel);
            this.c = c;
            this.id = (ulong)id;
            this.measure = measure;
            this.measureDiv = measureDiv;
            this.channel = channel;
            eventType = EventType.NoteEvent;
            noteEventType = GetNoteEventType(channel);
        }
예제 #3
0
    public void CallAllNoteEvents(NoteEventType eventType)
    {
        if (onNoteEvent == null)
        {
            return;
        }

        foreach (int note in this)
        {
            onNoteEvent.Invoke(eventType, note);
        }
    }
예제 #4
0
 public NoteMidiEvent(
     int deltaTime,
     byte typeCode,
     byte note,
     byte param)
     : base(deltaTime, typeCode)
 {
     noteEventType = (NoteEventType)(typeCode & 0b1111_0000);
     channel       = (byte)(typeCode & 0b1111);
     this.note     = note;
     this.param    = param;
 }
예제 #5
0
 public NoteMidiEvent(
     int deltaTime,
     NoteEventType noteEventType,
     byte channel,
     byte note,
     byte param)
     : base(deltaTime, GetCode(noteEventType, channel))
 {
     this.noteEventType = noteEventType;
     this.channel       = channel;
     this.note          = note;
     this.param         = param;
 }
예제 #6
0
파일: NotesUI.cs 프로젝트: CamiTori/Catneep
        private void OnIconEvent(NoteEventType eventType, int note)
        {
            //Debug.Log("Event = " + eventType + ":" + note);
            // Busca una instancia de ícono que tenga el mismo índice que se le pasó
            NoteIcon icon = noteIcons[note];

            // Revisa si encontró una nota con el mismo índice para continuar con el método
            if (icon == null)
            {
                return;
            }

            // En función del parámetro eventType, actualiza el ícono
            switch (eventType)
            {
            case NoteEventType.Hit:
                HitNote(icon, note);
                break;

            case NoteEventType.Miss:
                icon.OnMiss(owner.missColor);
                // TODO: Mostrar más claramente que fallamos esa nota
                break;

            case NoteEventType.Release:
                icon.OnRelease();
                icon.OnMiss(owner.missColor);
                break;

            case NoteEventType.NextNote:
                icon.OnNextNote();
                break;
            }

            owner.noteIndicators[note].OnIconEvent(eventType);
        }
예제 #7
0
 public NoteEvent(float beatStamp, NoteEventType type, NoteMessage message)
 {
     this.beatStamp = beatStamp;
     this.eventType = type;
     this.message   = message;
 }
예제 #8
0
 public void CallNoteEvent(NoteEventType eventType, int index)
 {
     onNoteEvent.Invoke(eventType, index);
 }
예제 #9
0
 private static byte GetCode(NoteEventType noteEventType, byte channel) =>
 (byte)((byte)noteEventType | channel);