Ejemplo n.º 1
0
 public void MyTestFunc4(ref List <FMyStructCustomCtor> myStruct)
 {
     FMessage.Log("count: " + myStruct.Count);
     for (int i = 0; i < myStruct.Count; i++)
     {
         FMessage.Log("val: " + myStruct[i].MyValue);
         myStruct[i] = new FMyStructCustomCtor()
         {
             MyValue = "-"
         };
     }
 }
Ejemplo n.º 2
0
        public void CallMe6(FMyStructCustomCtor test, ref FMyStructCustomCtor test2)
        {
            CheckDestroyed();
            if (!CallMe6_IsValid)
            {
                NativeReflection.LogInvalidFunctionAccessed("/Script/USharp.BPTest1:CallMe6");
                return;
            }
            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[CallMe6_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);
                FMyStructCustomCtor.ToNative(IntPtr.Add(ParamsBuffer, CallMe6_test_Offset), test);
                FMyStructCustomCtor.ToNative(IntPtr.Add(ParamsBuffer, CallMe6_test2_Offset), test2);

                NativeReflection.InvokeFunction(Address, CallMe6_FunctionAddress, ParamsBuffer, CallMe6_ParamsSize);

                test2 = FMyStructCustomCtor.FromNative(IntPtr.Add(ParamsBuffer, CallMe6_test2_Offset));
                NativeReflection.InvokeFunction_DestroyAll(CallMe6_FunctionAddress, ParamsBuffer);
            }
        }
Ejemplo n.º 3
0
        public static void Call2()
        {
            IntPtr classAddress = NativeReflection.GetClass("/Script/UnrealEngine_Runtime.MyClass");

            Test2_FunctionAddress = NativeReflection.GetFunction(classAddress, "MyTestFunc3");
            Test2_ParamsSize      = NativeReflection.GetFunctionParamsSize(Test2_FunctionAddress);
            Test2_Param1_Offset   = NativeReflection.GetPropertyOffset(Test2_FunctionAddress, "myStruct");

            UMyClass            myClass = UObject.NewObject <UMyClass>();
            FMyStructCustomCtor val     = StructDefault <FMyStructCustomCtor> .Value;

            unsafe
            {
                byte * ParamsBufferAllocation = stackalloc byte[Test2_ParamsSize];
                IntPtr ParamsBuffer           = new IntPtr(ParamsBufferAllocation);
                FMyStructCustomCtor.ToNative(IntPtr.Add(ParamsBuffer, Test2_Param1_Offset), val);

                NativeReflection.InvokeFunction(myClass.Address, Test2_FunctionAddress, ParamsBuffer, Test2_ParamsSize);

                NativeReflection.InvokeFunction_DestroyAll(Test2_FunctionAddress, ParamsBuffer);
            }
        }
Ejemplo n.º 4
0
 public static void ToNative(IntPtr nativeBuffer, int arrayIndex, IntPtr prop, UObject owner, FMyStructCustomCtor value)
 {
     value.ToNative(nativeBuffer + (arrayIndex * StructSize));
 }
Ejemplo n.º 5
0
 public static void ToNative(IntPtr nativeBuffer, FMyStructCustomCtor value)
 {
     value.ToNative(nativeBuffer);
 }
Ejemplo n.º 6
0
    public FMyStructCustomCtor Copy()
    {
        FMyStructCustomCtor result = this;

        return(result);
    }
Ejemplo n.º 7
0
 public void MyTestFunc3(FMyStructCustomCtor myStruct)
 {
     FMessage.Log("struct str: " + myStruct.MyValue);
 }