using System.Collections; using System.Collections.Generic; using UnityEngine; public class QuestionTrigger : MonoBehaviour { public Test test; public int questionIndex; // index pertanyaan untuk trigger ini public Damageable damage; private bool hasShownQuestion = false; private void Start() { test = FindObjectOfType(); } private void Update() { if (damage != null && !damage.IsAlive && !hasShownQuestion) { test.ShowQuestion(questionIndex); hasShownQuestion = true; // agar hanya muncul sekali } } }