예제 #1
0
    public IEnumerator DestroyAfterimages()
    {
        var spacingNote = Note.Thirtysecond;
        var spacingTime = Conductor.noteDurations[spacingNote];
        var startNote   = Note.Quarter;

        var start = Conductor.GetNextNote(startNote);
        var end   = start + Conductor.noteDurations[spacingNote] * afterimages.Count;

        PlayerSfx.PlayDashSfx(start, end);

        for (int i = 0; i < afterimages.Count; i++)
        {
            var targetTime = start + i * spacingTime;
            afterimages[i].Run(targetTime);
        }

        yield return(new WaitForNote(startNote));

        Destroy(gameObject);
    }