Example #1
0
    /// <summary>
    /// 发送事件
    /// </summary>
    /// <param name="evt">Evt.</param>
    /// <param name="gameObject">Game object.</param>
    public void dispatchEvent(UEvent evt, object gameObject)
    {
        if (eventListenerDict.ContainsKey(evt.eventType))
        {
            UEventListener eventListener = eventListenerDict[evt.eventType];
            if (eventListener == null)
            {
                return;
            }

            evt.target = gameObject;
            eventListener.Excute(evt);
        }
    }
Example #2
0
 static public int Excute(IntPtr l)
 {
     try {
         UEventListener self = (UEventListener)checkSelf(l);
         UEvent         a1;
         checkType(l, 2, out a1);
         self.Excute(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }