Esempio n. 1
0
        // Returns true if the UProperty associated with this attribute should replicated,
        // based on the configured custom activation callback.
        public bool ShouldReplicate(UnrealObject owner)
        {
            if (Condition != LifetimeCondition.Custom)
            {
                throw new InvalidOperationException("ShouldReplicate() checks are only valid when using LifetimeCondition.Custom.");
            }

            if (CustomConditionCallback == null)
            {
                MethodInfo method = owner.GetType().GetMethod(CustomConditionMethod, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
                CustomConditionCallback = (CustomReplicationConditionCallback)Delegate.CreateDelegate(typeof(CustomReplicationConditionCallback), owner, method);
            }

            return(CustomConditionCallback());
        }
Esempio n. 2
0
 private void CheckOwnerObject()
 {
     if (OwnerObject != null && OwnerObject._NativeObject == IntPtr.Zero)
     {
         throw new UnrealObjectDestroyedException("Trying to access Text UProperty on destroyed object of type " + OwnerObject.GetType().ToString());
     }
 }