10 public void OnLoad(
Zone _zone)
13 foreach (
ZoneEvent zoneEvent
in this.list)
15 zoneEvent.OnLoad(this.zone);
20 public void Add<T>(
bool allowDuplicate =
false) where T :
ZoneEvent
22 this.Add(Activator.CreateInstance<T>(), allowDuplicate);
26 public void Add(
ZoneEvent e,
bool allowDuplicate =
false)
28 if (
EClass.debug.skipEvent && e.debugSkip)
34 foreach (
ZoneEvent zoneEvent
in this.list)
36 if (e.GetType() == zoneEvent.GetType())
45 string str =
"#game zone event ";
46 Type type = e.GetType();
47 Debug.Log(str + ((type !=
null) ? type.ToString() :
null) +
" added.");
53 if (this.zone.IsActiveZone && executeIfActiveZone)
58 this.listPreEnter.Add(e);
62 public T GetEvent<T>() where T :
ZoneEvent
64 foreach (
ZoneEvent zoneEvent
in this.list)
68 return zoneEvent as T;
75 public void Remove<T>() where T :
ZoneEvent
77 for (
int i = this.list.Count - 1; i >= 0; i--)
79 if (this.list[i] is T)
99 public void Tick(
float delta)
101 this.list.ForeachReverse(delegate(
ZoneEvent e)
108 public void OnVisit()
110 foreach (
ZoneEvent zoneEvent
in this.list)
117 public void OnLeaveZone()
119 foreach (
ZoneEvent zoneEvent
in this.list)
121 zoneEvent.OnLeaveZone();
126 public void OnSimulateHour()
128 if (this.list.Count == 0)
134 zoneEvent.OnSimulateHour();
143 public List<ZoneEvent> list =
new List<ZoneEvent>();
147 public List<ZonePreEnterEvent> listPreEnter =
new List<ZonePreEnterEvent>();