void UpdateEventObject()
        {
            if (!triggerable.hasType)
            {
                return;
            }

            eventObject     = (Stratus.Event)Utilities.Reflection.Instantiate(type);
            serializedEvent = new SerializedSystemObject(type, eventObject);
            serializedEvent.Deserialize(eventDataProperty);
        }
        void OnEvent(Stratus.Event e)
        {
            if (!e.GetType().Equals(type.Type))
            {
                return;
            }

            //if (debug)
            //  Trace.Script("Triggered by " + type.Type.Name, this);

            onTrigger.Invoke(e);
        }
Exemple #3
0
 /// <summary>
 /// Dispatches the given event of the specified type onto this object.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="gameObj">The GameObject to which to connect to.</param>
 /// <param name="eventObj">The event object. </param>
 /// <param name="nextFrame">Whether the event should be sent next frame.</param>
 public static void Dispatch(Stratus.Event eventObj, System.Type type, bool nextFrame = false)
 {
     get.Poke();
     Stratus.Events.Dispatch(get.gameObject, eventObj, type, nextFrame);
 }
 /// <summary>
 /// Dispatches the given event of the specified type onto this object.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="gameObj">The GameObject to which to connect to.</param>
 /// <param name="eventObj">The event object. </param>
 /// <param name="nextFrame">Whether the event should be sent next frame.</param>
 public static void Dispatch(this GameObject gameObj, Stratus.Event eventObj, System.Type type, bool nextFrame = false)
 {
     Stratus.Events.Dispatch(gameObj, eventObj, type, nextFrame);
 }