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

            eventObject     = (Stratus.Event)Utilities.Reflection.Instantiate(type);
            serializedEvent = new SerializedSystemObject(type, eventObject);
            serializedEvent.Deserialize(eventDataProperty);
        }
Пример #2
0
        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);
        }
Пример #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);
 }
Пример #4
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(this GameObject gameObj, Stratus.Event eventObj, System.Type type, bool nextFrame = false)
 {
     Stratus.Events.Dispatch(gameObj, eventObj, type, nextFrame);
 }