Пример #1
0
        public override void CopyFrom(FDelegateBase <TDelegate> other)
        {
            Clear();
            FMulticastDelegate <TDelegate> del = other as FMulticastDelegate <TDelegate>;

            if (del == null)
            {
                return;
            }

            if (del.IsNative)
            {
                FMulticastScriptDelegate otherScriptDelegate = *del.scriptDelegatePtr;
                int count = otherScriptDelegate.Count;
                for (int i = 0; i < count; ++i)
                {
                    if (IsNative)
                    {
                        scriptDelegatePtr->Add(otherScriptDelegate[i]);
                    }
                    else
                    {
                        managedScriptDelegate.Add(otherScriptDelegate[i]);
                    }
                }
            }
            else
            {
                FMulticastScriptDelegateWrapper otherScriptDelegate = del.managedScriptDelegate;
                int count = otherScriptDelegate.Count;
                for (int i = 0; i < count; ++i)
                {
                    if (IsNative)
                    {
                        scriptDelegatePtr->Add(otherScriptDelegate[i]);
                    }
                    else
                    {
                        managedScriptDelegate.Add(otherScriptDelegate[i]);
                    }
                }
            }
        }
Пример #2
0
        public override void CopyFrom(FDelegateBase <TDelegate> other)
        {
            Clear();
            FDelegate <TDelegate> del = other as FDelegate <TDelegate>;

            if (del == null)
            {
                return;
            }

            FScriptDelegate otherScriptDelegate = del.IsNative ? *del.scriptDelegatePtr : managedScriptDelegate;

            if (IsNative)
            {
                scriptDelegatePtr->Bind(otherScriptDelegate.Object.GetPtr(), otherScriptDelegate.FunctionName);
            }
            else
            {
                managedScriptDelegate.Bind(otherScriptDelegate.Object.GetPtr(), otherScriptDelegate.FunctionName);
            }
        }
Пример #3
0
 public abstract void CopyFrom(FDelegateBase <TDelegate> other);