Пример #1
0
 public void CheckTriggers(BaseGameEntity npc)
 {
     foreach (Trigger trigger in _triggers)
     {
         trigger.Try(npc);
     }
 }
Пример #2
0
 public override void Try(BaseGameEntity entity)
 {
     // check if we are within the trigger distance, and if so
     // tell event broker that we need to display a dialog
     // for this npc, or npc show dialog?
     if (IsTouchingTrigger(entity.Position, entity.CollisionRadius))
     {
         // only trigger if this is the first time npc entered region
         if (!_triggered)
         {
             _triggered = true;
             _owner.StartConversation(_conversationName);
         }
     }
     else
     {
         _triggered = false;
     }
 }
Пример #3
0
 public abstract void Try(BaseGameEntity entity);
Пример #4
0
 public ProximityRegion(BaseGameEntity entity, float triggerRadius)
 {
     _entity = entity;
     _triggerRadius = triggerRadius;
 }