Example #1
0
        public void TestClassProperties()
        {
            AssertEqual(TestReadWriteClass, typeof(MonoTestsObject), "TestReadWriteClass");
            AssertEqual(TestReadWriteActorClass, typeof(SkeletalMeshActor), "TestReadWriteActorClass");

            AssertEqual(TestReadWriteActorClass.IsChildOf(typeof(Actor)), true, "IsChildOf(Actor)");
            AssertEqual(TestReadWriteActorClass.IsChildOf(typeof(SkeletalMeshActor)), true, "IsChildOf(SkeletalMeshActor)");
            AssertEqual(TestReadWriteActorClass.IsChildOf(typeof(StaticMeshActor)), false, "IsChildOf(StaticMeshActor)");

            TestReadWriteClass = typeof(SceneComponent);
            try
            {
                TestReadWriteActorClass = typeof(MonoTestsObject);
                throw new AssertionFailedException("Unexpected success setting TestReadWriteActorClass to incompatible UClass type.");
            }
            catch (System.ArgumentException)
            {
                // success!
            }
            TestReadWriteActorClass = typeof(Light);

            VerifyClassPropertyEdits();

            SubclassOf <Actor>[] expected = new SubclassOf <Actor>[]
            {
                typeof(Actor),
                typeof(Pawn),
                typeof(Character),
            };
            TestArray(expected, TestReadWriteActorClassArray, "TestReadWriteActorClassArray", null);
        }
Example #2
0
        protected override void OnReset()
        {
            TestFloat       = 42.0f;
            TestDouble      = 108.0;
            TestBool        = false;
            TestSByte       = 43;
            TestInt16       = 44;
            TestInt         = 42;
            TestInt64       = 4815162342108;
            TestByte        = 43;
            TestUInt16      = 44;
            TestUInt32      = 0xc001beef;
            TestUInt64      = 0xdeadbeefdeadbeef;
            TestTestsObject = null;
            TestEnum        = PixelFormat.A8R8G8B8;
            TestEnumCpp     = ControllerHand.Special7;
            TestVector3     = new OpenTK.Vector3(42.0f, 42.0f, 42.0f);
            TestName        = new Name("Meef");
            TestRotator     = new Rotator(42.0f, 42.0f, 42.0f);
            TestColor       = new Color(42, 42, 42, 42);
            TestString      = "Meef";
            TestText.SetFromString("Bork bork bork");
            TestSubclassOf = new SubclassOf <UnrealEngine.Engine.Actor>(typeof(UnrealEngine.Engine.Light));


            TestStruct = new MonoTestsStruct
            {
                TestStructFloat      = 42.0f,
                TestStructInt32      = -42,
                TestStructWeakObject =
                    TestsObject,
                TestSubStruct = new MonoTestsSubStruct
                {
                    TestBool1 = true,
                    TestBool2 = false,
                },
            };

            TestIntArray.Clear();
            TestIntArray.Add(2);
            TestIntArray.Add(4);
            TestIntArray.Add(6);
            TestIntArray.Add(0);
            TestIntArray.Add(1);

            TestObjArray.Clear();
            TestObjArray.Add(this);
            TestObjArray.Add(TestsObject);

            TestNameArray.Clear();
            TestNameArray.Add(new Name("Foo"));
            TestNameArray.Add(new Name("Bar"));
            TestNameArray.Add(new Name("Hoobajoob"));
            TestNameArray.Add(new Name("Doowacky"));

            TestWeakObject = this;
        }
Example #3
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <GameplayTaskResource> ResourceClass)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = ResourceClass;
                Main.GetProcessEvent(obj, ClaimTaskResource_ptr, new IntPtr(p));;
            }
        }
Example #4
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <MovieSceneCaptureProtocolBase> ProtocolType)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = ProtocolType;
                Main.GetProcessEvent(obj, SetImageCaptureProtocolType_ptr, new IntPtr(p));;
            }
        }
Example #5
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <EmitterCameraLensEffectBase> LensEffectEmitterClass)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = LensEffectEmitterClass;
                Main.GetProcessEvent(obj, ClientSpawnCameraLensEffect_ptr, new IntPtr(p));;
            }
        }
Example #6
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <NavArea> NewAreaClass)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = NewAreaClass;
                Main.GetProcessEvent(obj, SetAreaClass_ptr, new IntPtr(p));;
            }
        }
Example #7
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <Actor> InClass)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = InClass;
                Main.GetProcessEvent(obj, SetChildActorClass_ptr, new IntPtr(p));;
            }
        }
Example #8
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <AISense> SenseClass)
            {
                long *p = stackalloc long[] { 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = SenseClass;
                Main.GetProcessEvent(obj, UnregisterFromSense_ptr, new IntPtr(p));;
            }
        }
Example #9
0
 public static void AddResourceFactory(SubclassOf <ResourceFactory> ResourceFactoryClass)
 {
     if (Factories.FirstOrDefault(x => x.GetType() == ResourceFactoryClass) == null)
     {
         ResourceFactory rf = Activator.CreateInstance(ResourceFactoryClass) as ResourceFactory;
         Factories.Add(rf);
         Logger.Info("Found Resource Factory {0} for types {1}", ResourceFactoryClass.ToString(), string.Join(',', rf.ResourceSchemes));
     }
 }
Example #10
0
            internal static unsafe void Invoke(IntPtr obj, Name KeyName, SubclassOf <UObject> ClassValue)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((Name *)(b + 0))    = KeyName;
                *((IntPtr *)(b + 16)) = ClassValue;
                Main.GetProcessEvent(obj, SetValueAsClass_ptr, new IntPtr(p));;
            }
        }
Example #11
0
            internal static unsafe CameraModifier Invoke(IntPtr obj, SubclassOf <CameraModifier> ModifierClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = ModifierClass;
                Main.GetProcessEvent(obj, AddNewCameraModifier_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 8)));
            }
        }
Example #12
0
            internal static unsafe UserWidget Invoke(IntPtr obj, SubclassOf <UserWidget> EntryClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = EntryClass;
                Main.GetProcessEvent(obj, BP_CreateEntryOfClass_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 8)));
            }
        }
Example #13
0
            internal static unsafe DragDropOperation Invoke(SubclassOf <DragDropOperation> OperationClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = OperationClass;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, CreateDragDropOperation_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 8)));
            }
        }
Example #14
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <AISense> SenseClass, bool bEnable)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = SenseClass;
                *((bool *)(b + 8))   = bEnable;
                Main.GetProcessEvent(obj, SetSenseEnabled_ptr, new IntPtr(p));;
            }
        }
Example #15
0
            internal static unsafe RichTextBlockDecorator Invoke(IntPtr obj, SubclassOf <RichTextBlockDecorator> DecoratorClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = DecoratorClass;
                Main.GetProcessEvent(obj, GetDecoratorByClass_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 8)));
            }
        }
Example #16
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <CameraShake> Shake, bool bImmediately)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = Shake;
                *((bool *)(b + 8))   = bImmediately;
                Main.GetProcessEvent(obj, ClientStopCameraShake_ptr, new IntPtr(p));;
            }
        }
Example #17
0
            internal static unsafe Actor Invoke(IntPtr obj, SubclassOf <Actor> ActorClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = ActorClass;
                Main.GetProcessEvent(obj, Spawn_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 8)));
            }
        }
Example #18
0
            internal static unsafe bool Invoke(IntPtr obj, SubclassOf <UObject> TypeData)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = TypeData;
                Main.GetProcessEvent(obj, ContainsEmitterType_ptr, new IntPtr(p));;
                return(*((bool *)(b + 8)));
            }
        }
Example #19
0
            internal static unsafe void Invoke(BTNode NodeOwner, BlackboardKeySelector Key, SubclassOf <UObject> Value)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = NodeOwner;
                *((BlackboardKeySelector *)(b + 8)) = Key;
                *((IntPtr *)(b + 56)) = Value;
                Main.GetProcessEvent(BTFunctionLibrary.DefaultObject, SetBlackboardValueAsClass_ptr, new IntPtr(p));;
            }
        }
            internal static unsafe IReadOnlyCollection <DatasmithAssetUserData> Invoke(SubclassOf <UObject> ObjectClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = ObjectClass;
                Main.GetProcessEvent(DatasmithContentBlueprintLibrary.DefaultObject, GetAllDatasmithUserData_ptr, new IntPtr(p));;
                //TODO: array TArray OutUserData
                return(UObject.ToUObjectCollection <DatasmithAssetUserData>(b + 8));
            }
        }
Example #21
0
            internal static unsafe PawnAction Invoke(UObject WorldContextObject, SubclassOf <PawnAction> ActionClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = WorldContextObject;
                *((IntPtr *)(b + 8)) = ActionClass;
                Main.GetProcessEvent(PawnAction.DefaultObject, CreateActionInstance_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 16)));
            }
        }
Example #22
0
            internal static unsafe IReadOnlyCollection <Actor> Invoke(IntPtr obj, SubclassOf <AISense> SenseToUse)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = SenseToUse;
                Main.GetProcessEvent(obj, GetPerceivedActors_ptr, new IntPtr(p));;
                //TODO: array TArray OutActors
                return(UObject.ToUObjectCollection <Actor>(b + 8));
            }
        }
Example #23
0
            internal static unsafe bool Invoke(UObject WorldContextObject, SubclassOf <AISense> Sense, Actor Target)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))  = WorldContextObject;
                *((IntPtr *)(b + 8))  = Sense;
                *((IntPtr *)(b + 16)) = Target;
                Main.GetProcessEvent(AIPerceptionSystem.DefaultObject, RegisterPerceptionStimuliSource_ptr, new IntPtr(p));;
                return(*((bool *)(b + 24)));
            }
        }
Example #24
0
            internal static unsafe void Invoke(IntPtr obj, SubclassOf <CameraShake> Shake, float Scale, byte PlaySpace, Rotator UserPlaySpaceRot)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))   = Shake;
                *((float *)(b + 8))    = Scale;
                *(b + 12)              = PlaySpace;
                *((Rotator *)(b + 16)) = UserPlaySpaceRot;
                Main.GetProcessEvent(obj, ClientPlayCameraShake_ptr, new IntPtr(p));;
            }
        }
Example #25
0
            internal static unsafe UserWidget Invoke(UObject WorldContextObject, SubclassOf <UserWidget> WidgetType, PlayerController OwningPlayer)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))  = WorldContextObject;
                *((IntPtr *)(b + 8))  = WidgetType;
                *((IntPtr *)(b + 16)) = OwningPlayer;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, Create_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 24)));
            }
        }
Example #26
0
            internal static unsafe IReadOnlyCollection <Actor> Invoke(byte TargetArray /*TODO: array TArray */, SubclassOf <Actor> FilterClass)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                throw new NotImplementedException(); //TODO: array TArray TargetArray
                *((IntPtr *)(b + 16)) = FilterClass;
                Main.GetProcessEvent(KismetArrayLibrary.DefaultObject, FilterArray_ptr, new IntPtr(p));;
                //TODO: array TArray TargetArray
                //TODO: array TArray FilteredArray
                return(UObject.ToUObjectCollection <Actor>(b + 24));
            }
        }
Example #27
0
            internal static unsafe IReadOnlyCollection <Actor> Invoke(UObject WorldContextObject, SubclassOf <Actor> ActorClass, GameplayTagQuery GameplayTagQuery)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))            = WorldContextObject;
                *((IntPtr *)(b + 8))            = ActorClass;
                *((GameplayTagQuery *)(b + 16)) = GameplayTagQuery;
                Main.GetProcessEvent(BlueprintGameplayTagLibrary.DefaultObject, GetAllActorsOfClassMatchingTagQuery_ptr, new IntPtr(p));;
                //TODO: array TArray OutActors
                return(UObject.ToUObjectCollection <Actor>(b + 88));
            }
        }
Example #28
0
            internal static unsafe MaterialExpression Invoke(MaterialFunction MaterialFunction, SubclassOf <MaterialExpression> ExpressionClass, int NodePosX, int NodePosY)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = MaterialFunction;
                *((IntPtr *)(b + 8)) = ExpressionClass;
                *((int *)(b + 16))   = NodePosX;
                *((int *)(b + 20))   = NodePosY;
                Main.GetProcessEvent(MaterialEditingLibrary.DefaultObject, CreateMaterialExpressionInFunction_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 24)));
            }
        }
Example #29
0
            internal static unsafe CanvasRenderTarget2D Invoke(UObject WorldContextObject, SubclassOf <CanvasRenderTarget2D> CanvasRenderTarget2DClass, int Width, int Height)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = WorldContextObject;
                *((IntPtr *)(b + 8)) = CanvasRenderTarget2DClass;
                *((int *)(b + 16))   = Width;
                *((int *)(b + 20))   = Height;
                Main.GetProcessEvent(CanvasRenderTarget2D.DefaultObject, CreateCanvasRenderTarget2D_ptr, new IntPtr(p));;
                return(*((IntPtr *)(b + 24)));
            }
        }
Example #30
0
            internal static unsafe IReadOnlyCollection <UserWidget> Invoke(UObject WorldContextObject, SubclassOf <Interface> Interface, bool TopLevelOnly)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = WorldContextObject;
                *((IntPtr *)(b + 8)) = Interface;
                *((bool *)(b + 32))  = TopLevelOnly;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, GetAllWidgetsWithInterface_ptr, new IntPtr(p));;
                //TODO: array TArray FoundWidgets
                return(UObject.ToUObjectCollection <UserWidget>(b + 16));
            }
        }