namespace Zinnia.Data.Operation.Extraction
{
using System;
using UnityEngine;
using UnityEngine.Events;
///
/// Extracts a child by the given named path.
///
public class GameObjectChildByNameExtractor : GameObjectExtractor
{
[Tooltip("The path name to the child GameObject.")]
[SerializeField]
private string childNamePath;
///
/// The path name to the child .
///
public string ChildNamePath
{
get
{
return childNamePath;
}
set
{
childNamePath = value;
}
}
///
/// Defines the event with the specified .
///
[Serializable]
public class UnityEvent : UnityEvent { }
///
protected override GameObject ExtractValue()
{
if (Source == null)
{
return null;
}
Transform found = Source.transform.Find(ChildNamePath);
return found != null ? found.gameObject : null;
}
}
}