Initial Unity 6 scaffold for Cat Kirby Adventures.
Add Phase A greybox vertical slice: third-person movement, forest path, checkpoints, story triggers, and light ability gate.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace KirbyAdventures
|
||||
{
|
||||
[RequireComponent(typeof(Collider))]
|
||||
public class StoryTrigger : MonoBehaviour
|
||||
{
|
||||
[TextArea] public string Quote;
|
||||
public float DisplaySeconds = 4.5f;
|
||||
public bool Once = true;
|
||||
bool _shown;
|
||||
|
||||
void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (Once && _shown) return;
|
||||
if (other.GetComponent<PlayerMotor>() == null) return;
|
||||
_shown = true;
|
||||
DialogueUI.ShowTemporary(Quote, DisplaySeconds);
|
||||
}
|
||||
|
||||
void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.GetComponent<PlayerMotor>() == null) return;
|
||||
// Optional: hide early when leaving — keep simple, let timer finish
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user