Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="original"></param>
        /// <returns></returns>
        public static GameObjectTarget Clone(GameObjectTarget original)
        {
            if (original == null)
            {
                return(null);
            }

            var newTarget = new GameObjectTarget {
                action          = original.action,
                gameObject      = original.gameObject,
                broadcastTarget = original.broadcastTarget,
                parameter       = CallbackParameter.Clone(original.parameter),
                _methodName     = original._methodName
            };

            if (original.cachedListeners != null)
            {
                newTarget.cachedListeners = new List <IGameEventListener>(original.cachedListeners);
            }

            if (original._cachedListenersView != null)
            {
                newTarget._cachedListenersView = new List <MonoBehaviour>(original._cachedListenersView);
            }

            return(newTarget);
        }
Example #2
0
        //=====================================================================================================================//
        //=================================================== Public Methods ==================================================//
        //=====================================================================================================================//

        #region Public Methods

        public static EventIDTarget Clone(EventIDTarget original)
        {
            if (original == null)
            {
                return(null);
            }

            var newTarget = new EventIDTarget {
                action    = original.action,
                eventID   = original.eventID,
                delay     = original.delay,
                allOfType = original.allOfType,
                parameter = CallbackParameter.Clone(original.parameter)
            };

            return(newTarget);
        }
Example #3
0
        //=====================================================================================================================//
        //=================================================== Public Methods ==================================================//
        //=====================================================================================================================//

        #region Public Methods

        public static BehaviourTarget Clone(BehaviourTarget original)
        {
            if (original == null)
            {
                return(null);
            }

            var newTarget = new BehaviourTarget {
                behaviour   = original.behaviour,
                action      = original.action,
                _gameObject = original._gameObject,
                _methodName = original._methodName,
                _methodIdx  = original._methodIdx,
                _methodArg  = CallbackParameter.Clone(original._methodArg),
                type        = original.type,
                cloth       = original.cloth,
                lodGroup    = original.lodGroup,
                collider    = original.collider,
                renderer    = original.renderer
            };

            return(newTarget);
        }
        //=====================================================================================================================//
        //=================================================== Public Methods ==================================================//
        //=====================================================================================================================//

        #region Public Methods

        public static BehaviourTarget Clone(BehaviourTarget original)
        {
            if (original == null)
            {
                return(null);
            }

            var newTarget = new BehaviourTarget {
                _behaviour  = original._behaviour,
                _action     = original._action,
                _gameObject = original._gameObject,
                _methodName = original._methodName,
                _methodIdx  = original._methodIdx,
                _methodArg  = CallbackParameter.Clone(original._methodArg),
                _type       = original._type,
                _cloth      = original._cloth,
                _lodGroup   = original._lodGroup,
                _collider   = original._collider,
                _renderer   = original._renderer
            };

            return(newTarget);
        }