more fixes

This commit is contained in:
Jan Racek
2026-03-28 01:32:36 +01:00
parent 13ed569eaf
commit a251eeaed5
13 changed files with 83 additions and 53 deletions

View File

@@ -14,25 +14,25 @@ namespace SplashEdit.RuntimeCode
[Header("Interaction Settings")]
[Tooltip("Distance within which the player can interact with this object")]
[SerializeField] private float interactionRadius = 2.0f;
[Tooltip("Button that triggers interaction (0-15, matches PS1 button mapping)")]
[SerializeField] private int interactButton = 5; // Default to Cross button
[SerializeField] private int interactButton = 14; // Default to Cross button
[Tooltip("Can this object be interacted with multiple times?")]
[SerializeField] private bool isRepeatable = true;
[Tooltip("Cooldown between interactions (in frames, 60 = 1 second at NTSC)")]
[SerializeField] private ushort cooldownFrames = 30;
[Tooltip("Show interaction prompt when in range (requires UI system)")]
[SerializeField] private bool showPrompt = true;
[Tooltip("Show a UI canvas when the player is in range")]
[SerializeField] private bool showPrompt = false;
[Tooltip("Name of the PSXCanvas to show when the player is in range")]
[SerializeField] private string promptCanvasName = "";
[Header("Advanced")]
[Tooltip("Require line-of-sight to player for interaction")]
[Tooltip("Require the player to be facing this object to interact")]
[SerializeField] private bool requireLineOfSight = false;
[Tooltip("Custom interaction point offset from object center")]
[SerializeField] private Vector3 interactionOffset = Vector3.zero;
// Public accessors for export
public float InteractionRadius => interactionRadius;
@@ -40,23 +40,19 @@ namespace SplashEdit.RuntimeCode
public bool IsRepeatable => isRepeatable;
public ushort CooldownFrames => cooldownFrames;
public bool ShowPrompt => showPrompt;
public string PromptCanvasName => promptCanvasName;
public bool RequireLineOfSight => requireLineOfSight;
public Vector3 InteractionOffset => interactionOffset;
private void OnDrawGizmosSelected()
{
// Draw interaction radius
Gizmos.color = new Color(1f, 1f, 0f, 0.3f); // Yellow, semi-transparent
Vector3 center = transform.position + interactionOffset;
Vector3 center = transform.position;
Gizmos.DrawWireSphere(center, interactionRadius);
// Draw filled sphere with lower alpha
Gizmos.color = new Color(1f, 1f, 0f, 0.1f);
Gizmos.DrawSphere(center, interactionRadius);
// Draw interaction point
Gizmos.color = Color.yellow;
Gizmos.DrawSphere(center, 0.1f);
}
}
}