コード例 #1
0
        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
                });
            }
        }
コード例 #2
0
 public static IEnumerable <VisualEffectPlayableSerializedEvent> GetEventNormalizedSpace(PlayableTimeSpace space, VisualEffectControlPlayableBehaviour source)
 {
     return(GetEventNormalizedSpace(space, source.events, source.clipStart, source.clipEnd));
 }