Ejemplo n.º 1
0
    // Checks if a Note Object is hit.  If one is, it will perform the Hit and remove the object
    //  from the trackedNotes Queue.
    public void CheckNoteHit()
    {
        // Always check only the first event as we clear out missed entries before.
        if (trackedNotes.Count > 0 && trackedNotes.Peek().IsNoteHittable())
        {
            NoteObjectBeatInfinity hitNote = trackedNotes.Dequeue();

            hitNote.OnHit();
        }
    }
Ejemplo n.º 2
0
    // Deactivates and returns a Note Object to the pool.
    public void ReturnNoteObjectToPool(NoteObjectBeatInfinity obj)
    {
        if (obj != null)
        {
            obj.enabled = false;
            obj.gameObject.SetActive(false);

            noteObjectPool.Push(obj);
        }
    }
Ejemplo n.º 3
0
    // Checks if the next Note Object should be spawned.  If so, it will spawn the Note Object and
    //  add it to the trackedNotes Queue.
    void CheckSpawnNext()
    {
        int samplesToTarget = GetSpawnSampleOffset();

        int currentTime = gameController.DelayedSampleTime;

        // Spawn for all events within range.
        while (pendingEventIdx < laneEvents.Count &&
               laneEvents[pendingEventIdx].StartSample < currentTime + samplesToTarget)
        {
            KoreographyEvent evt = laneEvents[pendingEventIdx];

            NoteObjectBeatInfinity newObj = gameController.GetFreshNoteObject();
            newObj.Initialize(evt, color, this, gameController);

            trackedNotes.Enqueue(newObj);

            pendingEventIdx++;
        }
    }