namespace Zinnia.Data.Operation.Extraction
{
using System;
using UnityEngine;
using UnityEngine.Events;
using Zinnia.Extension;
///
/// Extracts and emits the found in relation to the .
///
public class ComponentRigidbodyExtractor : ComponentExtractor
{
///
/// Defines the event with the specified .
///
[Serializable]
public class UnityEvent : UnityEvent { }
///
protected override Rigidbody ExtractValue()
{
return Source != null
? Source.gameObject.TryGetComponent(
(SearchAlsoOn & SearchCriteria.IncludeDescendants) != 0,
(SearchAlsoOn & SearchCriteria.IncludeAncestors) != 0
)
: null;
}
///
protected override bool InvokeResult(Rigidbody data)
{
return InvokeEvent(data);
}
}
}