50 lines
1.4 KiB
C#
50 lines
1.4 KiB
C#
using UnityEngine;
|
|
|
|
public struct GhostMovementContext
|
|
{
|
|
// Ghost
|
|
public readonly Transform GhostTransform;
|
|
|
|
// surface
|
|
public readonly Vector3 SurfacePoint;
|
|
public readonly Vector3 SurfaceNormal;
|
|
|
|
// Socket snap
|
|
public readonly SocketPoint MySocket;
|
|
public readonly SocketPoint TargetSocket;
|
|
|
|
// Per-prefab config
|
|
public readonly Transform AttachPoint;
|
|
public readonly float FollowSpeed;
|
|
public readonly float HeightOffset;
|
|
public readonly bool AlignToSurfaceNormal;
|
|
public readonly bool SnapRotation;
|
|
|
|
// Output, GhostManager reads it after the call
|
|
public Vector3 RotationAxis;
|
|
|
|
public GhostMovementContext(
|
|
Transform ghostTransform,
|
|
Vector3 surfacePoint,
|
|
Vector3 surfaceNormal,
|
|
SocketPoint mySocket,
|
|
SocketPoint targetSocket,
|
|
Transform attachPoint,
|
|
float followSpeed,
|
|
float heightOffset,
|
|
bool alignToSurfaceNormal,
|
|
bool snapRotation)
|
|
{
|
|
GhostTransform = ghostTransform;
|
|
SurfacePoint = surfacePoint;
|
|
SurfaceNormal = surfaceNormal;
|
|
MySocket = mySocket;
|
|
TargetSocket = targetSocket;
|
|
AttachPoint = attachPoint;
|
|
FollowSpeed = followSpeed;
|
|
HeightOffset = heightOffset;
|
|
AlignToSurfaceNormal = alignToSurfaceNormal;
|
|
SnapRotation = snapRotation;
|
|
RotationAxis = Vector3.up;
|
|
}
|
|
} |