namespace Zinnia.Tracking.Collision.Active.Operation.Extraction
{
using System;
using UnityEngine;
using UnityEngine.Events;
using Zinnia.Data.Operation.Extraction;
///
/// Extracts the source container from a given found within a .
///
public class PublisherContainerExtractor : GameObjectExtractor
{
///
/// Defines the event with the specified .
///
[Serializable]
public class UnityEvent : UnityEvent { }
///
/// Extracts the source container from the given publisher contained within the .
///
/// The event data to extract the source container from.
/// The source container within the publisher.
public virtual GameObject Extract(ActiveCollisionConsumer.EventData eventData)
{
return Extract(eventData?.Publisher);
}
///
/// Extracts the source container from the given publisher contained within the .
///
/// The event data to extract the source container from.
public virtual void DoExtract(ActiveCollisionConsumer.EventData eventData)
{
Extract(eventData?.Publisher);
}
///
protected override GameObject ExtractValue()
{
return Source != null ? Source.SourceContainer : null;
}
}
}