void AdjustScale(KoreographyEvent evt, int sampleTime, int sampleDelta, DeltaSlice deltaSlice) { if (evt.HasCurvePayload()) { // Get the value of the curve at the current audio position. This will be a // value between [0, 1] and will be used, below, to interpolate between // minScale and maxScale. float curveValue = evt.GetEventDeltaAtSampleTime(sampleTime); transform.localScale = Vector3.one * Mathf.Lerp(minScale, maxScale, curveValue); } }
void AdjustScale(KoreographyEvent evt, int sampleTime, int sampleDelta, DeltaSlice deltaSlice) { if (evt.HasCurvePayload()) { // Get the value of the curve at the current audio position. This will be a // value between [0, 1] and will be used, below, to interpolate between // minScale and maxScale. float curveValue = evt.GetEventDeltaAtSampleTime(sampleTime); transform.localScale = Vector3.one * Mathf.Lerp(minScale, maxScale, curveValue); } }
void OnLyricEvent(KoreographyEvent koreoEvt, int sampleTime, int sampleDelta, DeltaSlice slice) { string lyric = koreoEvt.GetTextValue(); float percent = koreoEvt.GetEventDeltaAtSampleTime(sampleTime); for (int i = 0; i < textLines.Count; ++i) { KaraokeTextLine curLine = textLines[i]; if (!curLine.IsLineFull()) { curLine.FillKaraokeSection(lyric, percent); break; } } }
void OnKoreographerTime(KoreographyEvent kevent, int sampleTime, int sampleDelta) { if (kevent.Payload != null && kevent.Payload as CurvePayload != null) { SetValue(GetMinMaxValue(rangeMin, rangeMax, (kevent.Payload as CurvePayload).GetValueAtDelta(kevent.GetEventDeltaAtSampleTime(sampleTime)))); } }