MuharremTozan/Agentic-Duel / .agent/skills/unity-interaction
unity-interaction
VerifiedGeneric raycast-based interaction system. Works for any game genre (RPG, Platformer, Simulation).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 798 B |
| assets/code/IInteractable.cs.txt | markdown | 560 B |
| assets/code/InteractionController.cs.txt | markdown | 1.6 KB |
| assets/docs/Checklist.md.txt | markdown | 955 B |
| references/guide.md | markdown | 1.2 KB |
assets/code/InteractionController.cs.txt
View on GitHubusing UnityEngine;
namespace Standard.Interaction {
/// <summary>
/// Base class for interactable objects with Raycast detection.
/// Handles selection highlighting and input routing.
/// </summary>
public class InteractionController : MonoBehaviour, IInteractor {
[Header("Detection")]
[SerializeField] private float interactDistance = 2f;
[SerializeField] private LayerMask interactableLayer;
private IInteractable _selectedTarget;
private void Update() {
DetectTarget();
HandleInput();
}
private void DetectTarget() {
Vector3 direction = transform.forward;
if (Physics.Raycast(transform.position, direction, out RaycastHit hit, interactDistance, interactableLayer)) {
if (hit.transform.TryGetComponent(out IInteractable interactable)) {
SetSelectedTarget(interactable);
return;
}
}
SetSelectedTarget(null);
}
private void HandleInput() {
if (_selectedTarget == null) return;
if (Input.GetKeyDown(KeyCode.E)) {
_selectedTarget.Interact(this);
}
if (Input.GetKeyDown(KeyCode.F)) {
_selectedTarget.InteractAlternate(this);
}
}
private void SetSelectedTarget(IInteractable target) {
if (_selectedTarget == target) return;
_selectedTarget = target;
// Fire selection event here if using event channels
}
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |