1c6c9b2a70
Add Phase A greybox vertical slice: third-person movement, forest path, checkpoints, story triggers, and light ability gate.
28 lines
761 B
C#
28 lines
761 B
C#
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
|
|
}
|
|
}
|
|
}
|