Corgi Engine  v8.8
MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget Class Reference

Use this decision to make sure there is an unobstructed line of sight between this AI and its current target More...

Inheritance diagram for MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget:
MoreMountains.Tools.AIDecision

Public Member Functions

override void Initialization ()
 On init we grab our collider component More...
 
override bool Decide ()
 On Decide we check whether we've got a line of sight or not 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 containing the layers that should be considered as obstacles blocking sight More...
 
Vector3 LineOfSightOffset = new Vector3(0, 0, 0)
 the offset to apply (from the collider's center) 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 ()
 Casts a ray towards the target to see if there's an obstacle in between or not 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
 
Vector3 _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

Use this decision to make sure there is an unobstructed line of sight between this AI and its current target

Member Function Documentation

◆ CheckLineOfSight()

virtual bool MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget.CheckLineOfSight ( )
protectedvirtual

Casts a ray towards the target to see if there's an obstacle in between or not

Returns

◆ Decide()

override bool MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget.Decide ( )
virtual

On Decide we check whether we've got a line of sight or not

Returns

Implements MoreMountains.Tools.AIDecision.

◆ Initialization()

override void MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget.Initialization ( )
virtual

On init we grab our collider component

Reimplemented from MoreMountains.Tools.AIDecision.

Member Data Documentation

◆ _collider

Collider2D MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget._collider
protected

◆ _directionToTarget

Vector2 MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget._directionToTarget
protected

◆ _raycastOrigin

Vector3 MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget._raycastOrigin
protected

◆ LineOfSightOffset

Vector3 MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget.LineOfSightOffset = new Vector3(0, 0, 0)

the offset to apply (from the collider's center)

◆ ObstacleLayerMask

LayerMask MoreMountains.CorgiEngine.AIDecisionLineOfSightToTarget.ObstacleLayerMask = LayerManager.ObstaclesLayerMask

the layermask containing the layers that should be considered as obstacles blocking sight


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