public void CheckTriggers(BaseGameEntity npc) { foreach (Trigger trigger in _triggers) { trigger.Try(npc); } }
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; } }
public abstract void Try(BaseGameEntity entity);
public ProximityRegion(BaseGameEntity entity, float triggerRadius) { _entity = entity; _triggerRadius = triggerRadius; }