2 using Microsoft.Xna.Framework;
21 [
Serialize(
false,
IsPropertySaveable.Yes, description:
"Does the entity need to be facing the target? Only valid if the entity is a character.")]
33 [
Serialize(
true,
IsPropertySaveable.Yes, description:
"If both the seeing entity and the target are the same, does it count as success?")]
52 if (Vector2.DistanceSquared(target.WorldPosition, entity.WorldPosition) >
MaxDistance *
MaxDistance) {
continue; }
73 return $
"{ToolBox.GetDebugSymbol(HasBeenDetermined())} {nameof(CheckVisibilityAction)} -> (TargetTags: {EntityTag.ColorizeObject()}, {TargetTag.ColorizeObject()})";
static bool IsTargetVisible(ISpatialEntity target, ISpatialEntity seeingEntity, bool seeThroughWindows=false, bool checkFacing=false)
Check whether a specific entity is visible from the perspective of another entity.
override string ToDebugString()
Rich test to display in debugdraw
override? bool DetermineSuccess()
Identifier ApplyTagToEntity
CheckVisibilityAction(ScriptedEvent parentEvent, ContentXElement element)
Identifier ApplyTagToTarget
Identifier ExcludedEntityTag
readonly ScriptedEvent ParentEvent
void AddTarget(Identifier tag, Entity target)
IEnumerable< Entity > GetTargets(Identifier tag)