using System;
using System.Collections;using System.Collections.Generic;
using UnityEngine;
namespace FrameWork
{
/// <summary>
/// delegate Define
/// </summary>
public delegate void GllobalDelegate();
public delegate void GllobalDelegate<T0>(T0 arg0);
public delegate void GllobalDelegate<T0, T1>(T0 arg0, T1 arg1);
public delegate void GllobalDelegate<T0, T1, T2>(T0 arg0, T1 arg1, T2 arg2);
public delegate void GllobalDelegate<T0, T1, T2, T3>(T0 arg0, T1 arg1, T2 arg2, T3 arg3);
public delegate void GllobalDelegate<T0, T1, T2, T3, T4>(T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4);
/// <summary>
/// Gllobal Event Entity
/// </summary>
public class GllobalEventEntity : IDisposable
{
private static GllobalEventEntity _Instance;
private static GllobalEventEntity Instance
{
get
{
if(_Instance==null)
_Instance = new GllobalEventEntity();
return _Instance;
}
set
{
_Instance = value;
}
}
private static Dictionary<System.Enum, Delegate> ListenerDictionary= new Dictionary<System.Enum, Delegate>();
private static void Listen(System.Enum eventType,Delegate Callback)
{
Delegate callback;
if (ListenerDictionary.TryGetValue(eventType, out callback))
{
if ( callback.Method!=Callback.Method)
{
callback = Delegate.Combine(callback, Callback);