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

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