Initial commit

This commit is contained in:
HussienX72u
2026-07-21 08:56:10 +03:00
commit 4017028111
9410 changed files with 2150500 additions and 0 deletions
@@ -0,0 +1,32 @@
using UnityEngine;
/// <summary>
/// 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.
/// </summary>
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);
/// <summary>Returns the designated attach/pivot point, or this transform if none is set.</summary>
public Transform GetAttachPoint() => attachPoint;
/// <summary>Returns the PlacementValidator – checks the component on this GameObject as fallback.</summary>
public IValidator GetValidator() => validator != null ? validator : GetComponent<IValidator>();
}