Пример #1
0
        /// <summary>
        /// Consumes data from a from a <see cref="ActiveCollisionPublisher"/>.
        /// </summary>
        /// <param name="publisher">The publisher of the data.</param>
        /// <param name="currentCollision">The current collision within published data.</param>
        public virtual void Consume(ActiveCollisionPublisher publisher, CollisionNotifier.EventData currentCollision)
        {
            if (!isActiveAndEnabled || !publisherValidity.Accepts(publisher.gameObject))
            {
                return;
            }

            PublisherSource  = publisher;
            CurrentCollision = currentCollision;
            Consumed?.Invoke(eventData.Set(PublisherSource, currentCollision));
        }
Пример #2
0
 public EventData Set(ActiveCollisionPublisher publisher, CollisionNotifier.EventData currentCollision)
 {
     this.publisher        = publisher;
     this.currentCollision = currentCollision;
     return(this);
 }