예제 #1
0
        public T[] GetComponentsByTag <T>(FName tag) where T : UActorComponent
        {
            UClass unrealClass = UClass.GetClass <T>();

            if (unrealClass == null)
            {
                return(null);
            }
            using (TArrayUnsafe <T> resultUnsafe = new TArrayUnsafe <T>())
            {
                Native_AActor.GetComponentsByTag(Address, unrealClass.Address, ref tag, resultUnsafe.Address);
                return(resultUnsafe.ToArray());
            }
        }
예제 #2
0
 private void UpdateDilatedTime()
 {
     if (Dilated && Owner.Owner != null)
     {
         UObject ownerObj = Owner.Owner as UObject;
         if (ownerObj != null)
         {
             TimeDilation = TimeSpan.FromSeconds(Native_AActor.GetActorTimeDilationOrDefault(
                                                     ownerObj == null ? IntPtr.Zero : ownerObj.Address));
         }
         else
         {
             TimeDilation = TimeSpan.FromSeconds(1);
         }
     }
     UpdateTotalTime();
 }
예제 #3
0
 /// <summary>
 /// Set the actor's RootComponent to the specified relative transform
 /// </summary>
 /// <param name="newRelativeTransform">New relative transform of the actor's root component</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void SetActorRelativeTransform(FTransform newRelativeTransform, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.SetActorRelativeTransform(this.Address, ref newRelativeTransform, sweep, (int)teleport);
 }
예제 #4
0
 /// <summary>
 /// Set the actor's RootComponent to the specified relative rotation
 /// </summary>
 /// <param name="NewRelativeRotation">New relative rotation of the actor's root component</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void SetActorRelativeRotation(FQuat newRelativeRotation, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.SetActorRelativeRotationQuat(this.Address, ref newRelativeRotation, sweep, (int)teleport);
 }
예제 #5
0
 /// <summary>
 /// Set the actor's RootComponent to the specified relative location.
 /// </summary>
 /// <param name="newRelativeLocation">New relative location of the actor's root component</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void SetActorRelativeLocation(FVector newRelativeLocation, bool sweep, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.SetActorRelativeLocation(this.Address, ref newRelativeLocation, sweep, (int)teleport);
 }
예제 #6
0
 /// <summary>
 /// Adds a delta to the transform of this component in its local reference frame
 /// </summary>
 /// <param name="newTransform">The change in transform in local space.</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void AddActorLocalTransform(FTransform newTransform, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.AddActorLocalTransform(this.Address, ref newTransform, sweep, (int)teleport);
 }
예제 #7
0
 /// <summary>
 /// Adds a delta to the rotation of this component in its local reference frame
 /// </summary>
 /// <param name="deltaRotation">The change in rotation in local space.</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.
 /// Whether we teleport the physics state (if physics collision is enabled for this object).</param>
 /// <param name="teleport">If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void AddActorLocalRotation(FQuat deltaRotation, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.AddActorLocalRotationQuat(this.Address, ref deltaRotation, sweep, (int)teleport);
 }
예제 #8
0
 /// <summary>
 /// Adds a delta to the location of this component in its local reference frame.
 /// </summary>
 /// <param name="deltaLocation">The change in location in local space.</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void AddActorLocalOffset(FVector deltaLocation, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.AddActorLocalOffset(this.Address, ref deltaLocation, sweep, (int)teleport);
 }
예제 #9
0
 /// <summary>
 /// Set the Actors transform to the specified one.
 /// </summary>
 /// <param name="newTransform">The new transform.</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 /// <returns></returns>
 public bool SetActorTransform(FTransform newTransform, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     return(Native_AActor.SetActorTransform(this.Address, ref newTransform, sweep, (int)teleport));
 }
예제 #10
0
 /// <summary>
 /// Adds a delta to the rotation of this actor in world space.
 /// </summary>
 /// <param name="deltaRotation">The change in rotation.</param>
 /// <param name="sweep">Whether to sweep to the target rotation (not currently supported for rotation).</param>
 /// <param name="teleport">Whether we teleport the physics state (if physics collision is enabled for this object).
 /// If true, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If false, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 public void AddActorWorldRotation(FRotator deltaRotation, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     Native_AActor.AddActorWorldRotation(this.Address, ref deltaRotation, sweep, (int)teleport);
 }
예제 #11
0
 /// <summary>
 /// Move the actor instantly to the specified location and rotation.
 /// </summary>
 /// <param name="newLocation">The new location to teleport the Actor to.</param>
 /// <param name="newRotation">The new rotation for the Actor.</param>
 /// <param name="sweep">Whether we sweep to the destination location, triggering overlaps along the way and stopping short of the target if blocked by something.
 /// Only the root component is swept and checked for blocking collision, child components move without sweeping. If collision is off, this has no effect.</param>
 /// <param name="teleport">How we teleport the physics state (if physics collision is enabled for this object).
 /// If equal to ETeleportType::TeleportPhysics, physics velocity for this object is unchanged (so ragdoll parts are not affected by change in location).
 /// If equal to ETeleportType::None, physics velocity is updated based on the change in position (affecting ragdoll parts).
 /// If CCD is on and not teleporting, this will affect objects along the entire swept volume.</param>
 /// <returns>Whether the rotation was successfully set.</returns>
 public bool SetActorLocationAndRotation(FVector newLocation, FQuat newRotation, bool sweep = false, ETeleportType teleport = ETeleportType.None)
 {
     return(Native_AActor.SetActorLocationAndRotationQuat(this.Address, ref newLocation, ref newRotation, sweep, (int)teleport));
 }
예제 #12
0
 /// <summary>
 /// Return the ULevel that this Actor is part of.
 /// </summary>
 /// <returns></returns>
 public ULevel GetLevel()
 {
     return(GCHelper.Find <ULevel>(Native_AActor.GetLevel(this.Address)));
 }
예제 #13
0
 /// <summary>
 /// Returns true if this actor is contained the given level.
 /// </summary>
 public bool IsInLevel(ULevel level)
 {
     return(Native_AActor.IsInLevel(this.Address, level.Address));
 }