Esempio n. 1
0
 public static EventMessage createEventMessage(GameObject sender = null, Object message = null, Action<Object> action = null)
 {
     EventMessage em = new EventMessage();
     em.sender = sender;
     em.message = message;
     em.action = action;
     return em;
 }
Esempio n. 2
0
 public static void sendQueryMessage(EventMessage eventMessage, GameObject receiver, Func<Object, Object> queryFunc)
 {
     eventMessage.action = (Object obj) =>
     {
         Object result = queryFunc(obj);
         EventMessage reply = createEventMessage(receiver, result);
         sendEventMessage(reply, eventMessage.sender);
     };
     receiver.m_messageQueue.Enqueue(eventMessage);
 }
Esempio n. 3
0
 public static void sendQueryMessage(EventMessage eventMessage, List<GameObject> receivers, Func<Object, Object> queryFunc)
 {
     foreach (GameObject gameObj in receivers)
         sendQueryMessage(eventMessage, gameObj, queryFunc);
 }
Esempio n. 4
0
 public static void sendEventMessage(EventMessage eventMessage, List<GameObject> receivers)
 {
     foreach (GameObject gameObj in receivers)
         sendEventMessage(eventMessage, gameObj);
 }
Esempio n. 5
0
 public static void sendEventMessage(EventMessage eventMessage, GameObject receiver)
 {
     receiver.m_messageQueue.Enqueue(eventMessage);
 }