static IEnumerable <Event> ComputeRuntimeEvent(VisualEffectControlPlayableBehaviour behavior, VisualEffect vfx) { var events = VFXTimeSpaceHelper.GetEventNormalizedSpace(PlayableTimeSpace.Absolute, behavior); foreach (var itEvent in events) { //Apply clamping on the fly var absoluteTime = Math.Max(behavior.clipStart, Math.Min(behavior.clipEnd, itEvent.time)); yield return(new Event() { attribute = ComputeAttribute(vfx, itEvent.eventAttributes), nameId = itEvent.name, time = absoluteTime, clipIndex = -1, clipType = Event.ClipType.None }); } }
public static IEnumerable <VisualEffectPlayableSerializedEvent> GetEventNormalizedSpace(PlayableTimeSpace space, VisualEffectControlPlayableBehaviour source) { return(GetEventNormalizedSpace(space, source.events, source.clipStart, source.clipEnd)); }