using UnityEngine; /// /// Data/configuration component placed on block prefabs. /// Stores per-prefab drag settings so GhostManager can read them at instantiation time. /// All drag, snap, and placement logic has moved to GhostManager. /// public class GrabInteractable : MonoBehaviour { [Header("Attachment")] [SerializeField] private Transform attachPoint; [Header("Surface Alignment")] public bool alignToSurfaceNormal = true; public float alignmentSpeed = 15f; public bool snapRotation = false; [Header("Movement")] public float followSpeed = 20f; public float heightOffset = 0f; [Header("Validation & Visuals")] [SerializeField] private IValidator validator; public Color validTint = new Color(0.5f, 1.0f, 0.5f, 1.0f); public Color invalidTint = new Color(1.0f, 0.5f, 0.5f, 1.0f); /// Returns the designated attach/pivot point, or this transform if none is set. public Transform GetAttachPoint() => attachPoint; /// Returns the PlacementValidator – checks the component on this GameObject as fallback. public IValidator GetValidator() => validator != null ? validator : GetComponent(); }