TopDown Engine  v3.6
MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D Class Reference

This decision returns true if there's no obstacle in a straight line between the agent and the brain's target, in 2D More...

Inheritance diagram for MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D:
MoreMountains.Tools.AIDecision

Public Member Functions

override void Initialization ()
 On init we grab our collider More...
 
override bool Decide ()
 On Decide we check whether we have a line of sight More...
 
- Public Member Functions inherited from MoreMountains.Tools.AIDecision
virtual void OnEnterState ()
 Meant to be overridden, called when the Brain enters a State this Decision is in More...
 
virtual void OnExitState ()
 Meant to be overridden, called when the Brain exits a State this Decision is in More...
 

Public Attributes

LayerMask ObstacleLayerMask = LayerManager.ObstaclesLayerMask
 the layermask to consider as obstacles when trying to determine whether a line of sight is present More...
 
Vector3 LineOfSightOffset = new Vector3(0, 0, 0)
 the offset to apply (from the collider's center) when casting a ray from the agent to its target More...
 
- Public Attributes inherited from MoreMountains.Tools.AIDecision
string Label
 a label you can set to organize your AI Decisions, not used by anything else More...
 

Protected Member Functions

virtual bool CheckLineOfSight ()
 Checks whether there are obstacles between the agent and the target More...
 
- Protected Member Functions inherited from MoreMountains.Tools.AIDecision
virtual void Awake ()
 On Awake we grab our Brain More...
 

Protected Attributes

Vector2 _directionToTarget
 
Collider2D _collider
 
Vector2 _raycastOrigin
 
- Protected Attributes inherited from MoreMountains.Tools.AIDecision
AIBrain _brain
 

Additional Inherited Members

- Properties inherited from MoreMountains.Tools.AIDecision
virtual bool DecisionInProgress [get, set]
 

Detailed Description

This decision returns true if there's no obstacle in a straight line between the agent and the brain's target, in 2D

Member Function Documentation

◆ CheckLineOfSight()

virtual bool MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D.CheckLineOfSight ( )
protectedvirtual

Checks whether there are obstacles between the agent and the target

Returns

◆ Decide()

override bool MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D.Decide ( )
virtual

On Decide we check whether we have a line of sight

Returns

Implements MoreMountains.Tools.AIDecision.

◆ Initialization()

override void MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D.Initialization ( )
virtual

On init we grab our collider

Reimplemented from MoreMountains.Tools.AIDecision.

Member Data Documentation

◆ _collider

Collider2D MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D._collider
protected

◆ _directionToTarget

Vector2 MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D._directionToTarget
protected

◆ _raycastOrigin

Vector2 MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D._raycastOrigin
protected

◆ LineOfSightOffset

Vector3 MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D.LineOfSightOffset = new Vector3(0, 0, 0)

the offset to apply (from the collider's center) when casting a ray from the agent to its target

◆ ObstacleLayerMask

LayerMask MoreMountains.TopDownEngine.AIDecisionLineOfSightToTarget2D.ObstacleLayerMask = LayerManager.ObstaclesLayerMask

the layermask to consider as obstacles when trying to determine whether a line of sight is present


The documentation for this class was generated from the following file: