Example #1
0
        /************************************************************************************************************************/

        /// <summary>Copies the contents of this the 'target' event to this event.</summary>
        public virtual void CopyFrom(UltEventBase target)
        {
            if (target._PersistentCalls == null)
            {
                _PersistentCalls = null;
            }
            else
            {
                if (_PersistentCalls == null)
                {
                    _PersistentCalls = new List <PersistentCall>();
                }
                else
                {
                    _PersistentCalls.Clear();
                }

                for (int i = 0; i < target._PersistentCalls.Count; i++)
                {
                    var call = new PersistentCall();
                    call.CopyFrom(target._PersistentCalls[i]);
                    _PersistentCalls.Add(call);
                }
            }

            DynamicCallsBase = target.DynamicCallsBase;

#if UNITY_EDITOR
            _DynamicCallInvocationList = target._DynamicCallInvocationList;
#endif
        }
Example #2
0
        /************************************************************************************************************************/

        /// <summary>
        /// Add the specified 'method to the persistent call list.
        /// </summary>
        public PersistentCall AddPersistentCall(Delegate method)
        {
            if (_PersistentCalls == null)
            {
                _PersistentCalls = new List <PersistentCall>(4);
            }

            var call = new PersistentCall(method);

            _PersistentCalls.Add(call);
            return(call);
        }
Example #3
0
        /************************************************************************************************************************/

        /// <summary>Copies the contents of the 'target' call to this call.</summary>
        public void CopyFrom(PersistentCall target)
        {
            _Target     = target._Target;
            _MethodName = target._MethodName;
            _Method     = target._Method;

            _PersistentArguments = new PersistentArgument[target._PersistentArguments.Length];
            for (int i = 0; i < _PersistentArguments.Length; i++)
            {
                _PersistentArguments[i] = target._PersistentArguments[i].Clone();
            }
        }