namespace UnityEngine.EventSystems
{
///
/// A class that can be used for sending simple events via the event system.
///
public abstract class AbstractEventData
{
protected bool m_Used;
///
/// Reset the event.
///
public virtual void Reset()
{
m_Used = false;
}
///
/// Use the event.
///
///
/// Internally sets a flag that can be checked via used to see if further processing should happen.
///
public virtual void Use()
{
m_Used = true;
}
///
/// Is the event used?
///
public virtual bool used
{
get { return m_Used; }
}
}
///
/// A class that contains the base event data that is common to all event types in the new EventSystem.
///
public class BaseEventData : AbstractEventData
{
private readonly EventSystem m_EventSystem;
public BaseEventData(EventSystem eventSystem)
{
m_EventSystem = eventSystem;
}
///
/// >A reference to the BaseInputModule that sent this event.
///
public BaseInputModule currentInputModule
{
get { return m_EventSystem.currentInputModule; }
}
///
/// The object currently considered selected by the EventSystem.
///
public GameObject selectedObject
{
get { return m_EventSystem.currentSelectedGameObject; }
set { m_EventSystem.SetSelectedGameObject(value, this); }
}
}
}