private void Update()
    {
        if (haveCondition)
        {
            EventCondition.Invoke();
            if (!isMeetCondition)
            {
                return;
            }
        }

        if (isActive)
        {
            NPCTrigger();
        }
    }
Exemple #2
0
 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;
         }
     }
 }