Esempio n. 1
0
        /// <summary>
        /// Broadcast a message globally to all registered for T. This is faster than FindAndBroadcast, but requires manuall registering/unregistering.
        /// </summary>
        /// <typeparam name="TInterface"></typeparam>
        /// <typeparam name="TArg"></typeparam>
        /// <param name="arg"></param>
        /// <param name="functor"></param>
        /// <param name="includeDisabledComponents"></param>
        public static void Broadcast <TInterface, TArg>(TArg arg, System.Action <TInterface, TArg> functor) where TInterface : class
        {
            if (functor == null)
            {
                throw new System.ArgumentNullException("functor");
            }

            GlobalMessagePool <TInterface> .Execute <TArg>(arg, functor);
        }
Esempio n. 2
0
        /// <summary>
        /// Broadcast a message globally to all registered for T. This is faster than FindAndBroadcast, but requires manuall registering/unregistering.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="functor"></param>
        /// <param name="includeDisabledComponents"></param>
        public static void Broadcast <T>(System.Action <T> functor) where T : class
        {
            if (functor == null)
            {
                throw new System.ArgumentNullException("functor");
            }

            GlobalMessagePool <T> .Execute(functor);
        }