A game about forced loneliness, made by TACStudios
1namespace UnityEngine.EventSystems
2{
3 /// <summary>
4 /// A class that can be used for sending simple events via the event system.
5 /// </summary>
6 public abstract class AbstractEventData
7 {
8 protected bool m_Used;
9
10 /// <summary>
11 /// Reset the event.
12 /// </summary>
13 public virtual void Reset()
14 {
15 m_Used = false;
16 }
17
18 /// <summary>
19 /// Use the event.
20 /// </summary>
21 /// <remarks>
22 /// Internally sets a flag that can be checked via used to see if further processing should happen.
23 /// </remarks>
24 public virtual void Use()
25 {
26 m_Used = true;
27 }
28
29 /// <summary>
30 /// Is the event used?
31 /// </summary>
32 public virtual bool used
33 {
34 get { return m_Used; }
35 }
36 }
37
38 /// <summary>
39 /// A class that contains the base event data that is common to all event types in the new EventSystem.
40 /// </summary>
41 public class BaseEventData : AbstractEventData
42 {
43 private readonly EventSystem m_EventSystem;
44 public BaseEventData(EventSystem eventSystem)
45 {
46 m_EventSystem = eventSystem;
47 }
48
49 /// <summary>
50 /// >A reference to the BaseInputModule that sent this event.
51 /// </summary>
52 public BaseInputModule currentInputModule
53 {
54 get { return m_EventSystem.currentInputModule; }
55 }
56
57 /// <summary>
58 /// The object currently considered selected by the EventSystem.
59 /// </summary>
60 public GameObject selectedObject
61 {
62 get { return m_EventSystem.currentSelectedGameObject; }
63 set { m_EventSystem.SetSelectedGameObject(value, this); }
64 }
65 }
66}