private void Update() { if (haveCondition) { EventCondition.Invoke(); if (!isMeetCondition) { return; } } if (isActive) { NPCTrigger(); } }
private void OnTriggerEnter2D(Collider2D other) { if (haveCondition) { EventCondition.Invoke(); if (!isMeetCondition) { return; } } if (other.tag == "Player" && isActive) { EventManager.GetInstance.TriggerEvent(eventName); if (isActiveOnce) { isActive = false; } } }