Esempio n. 1
0
        public AActor SpawnActor(UClass unrealClass, ref FVector location, ref FRotator rotation, ref FActorSpawnParameters parameters)
        {
            FActorSpawnParametersInterop interopParams = new FActorSpawnParametersInterop()
            {
                Name          = parameters.Name,
                Template      = parameters.Template == null ? IntPtr.Zero : parameters.Template.Address,
                Owner         = parameters.Owner == null ? IntPtr.Zero : parameters.Owner.Address,
                Instigator    = parameters.Instigator == null ? IntPtr.Zero : parameters.Instigator.Address,
                OverrideLevel = parameters.OverrideLevel == null ? IntPtr.Zero : parameters.OverrideLevel.Address,
                SpawnCollisionHandlingOverride = parameters.SpawnCollisionHandlingOverride,
                PackedBools = parameters.PackedBools,
                ObjectFlags = parameters.ObjectFlags
            };

            return(GCHelper.Find <AActor>(Native_UWorld.SpawnActor(Address, unrealClass.Address, ref location, ref rotation, ref interopParams)));
        }
Esempio n. 2
0
        // SpawnActor generics

        public T SpawnActor <T>(ref FVector location, ref FRotator rotation, ref FActorSpawnParameters parameters) where T : AActor
        {
            return(SpawnActor(UClass.GetClass <T>(), ref location, ref rotation, ref parameters) as T);
        }
Esempio n. 3
0
        // The same as the above but non-ref

        public AActor SpawnActor(UClass unrealClass, FVector location, FRotator rotation, FActorSpawnParameters parameters)
        {
            return(SpawnActor(unrealClass, ref location, ref rotation, ref parameters));
        }