namespace VRTK.Prefabs.Pointers
{
using UnityEngine;
using Malimbe.MemberClearanceMethod;
using Malimbe.XmlDocumentationAttribute;
using Malimbe.PropertySerializationAttribute;
using Malimbe.BehaviourStateRequirementMethod;
using Zinnia.Pointer;
using Zinnia.Data.Type;
using Zinnia.Data.Operation.Extraction;
///
/// Extracts and emits the residing .
///
public class PointerFacadeGameObjectExtractor : GameObjectExtractor
{
///
/// The source to extract from.
///
[Serialized, Cleared]
[field: DocumentedByXml]
public PointerFacade Source { get; set; }
///
public override GameObject Extract()
{
if (Source == null)
{
Result = null;
return null;
}
Result = Source.gameObject;
return base.Extract();
}
///
/// Extracts the from the given payload data.
///
/// The payload data to extract from.
/// The within the .
public virtual GameObject Extract(SurfaceData data)
{
SetSource(data);
return Extract();
}
///
/// Extracts the from the given payload data.
///
/// The payload data to extract from.
public virtual void DoExtract(SurfaceData data)
{
Extract(data);
}
///
/// Extracts the from the given payload data.
///
/// The payload data to extract from.
/// The within the .
public virtual GameObject Extract(ObjectPointer.EventData data)
{
return Extract((SurfaceData)data);
}
///
/// Extracts the from the given payload data.
///
/// The payload data to extract from.
public virtual void DoExtract(ObjectPointer.EventData data)
{
Extract(data);
}
///
/// Sets the based on given .
///
/// The data that contains the source transform.
[RequiresBehaviourState]
public virtual void SetSource(SurfaceData source)
{
if (source == null || source.Transform == null)
{
return;
}
Source = source.Transform.GetComponentInParent();
}
///
/// Sets the based on given .
///
/// The data that contains the source transform.
public virtual void SetSource(ObjectPointer.EventData source)
{
SetSource((SurfaceData)source);
}
}
}