using System;
using System.Collections.Generic;
using System.Reflection;
using Base;
namespace Model
{
///
/// 事件分发
///
[EntityEvent(EntityEventId.EventComponent)]
public class EventComponent: Component
{
private Dictionary> allEvents;
private void Awake()
{
this.Load();
}
private void Load()
{
this.allEvents = new Dictionary>();
Type[] types = DllHelper.GetBaseTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof (EventAttribute), false);
foreach (object attr in attrs)
{
EventAttribute aEventAttribute = (EventAttribute) attr;
object obj = Activator.CreateInstance(type);
if (!this.allEvents.ContainsKey(aEventAttribute.Type))
{
this.allEvents.Add(aEventAttribute.Type, new List