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

This decision will return true if an object on its TargetLayer layermask is within its specified radius, false otherwise. It will also set the Brain's Target to that object. More...

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

Public Member Functions

override void Initialization ()
 On init we grab our Character component More...
 
override bool Decide ()
 On Decide we check for our target 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

float Radius = 3f
 the radius to search our target in More...
 
Vector3 DetectionOriginOffset = new Vector3(0, 0, 0)
 the offset to apply (from the collider's center) More...
 
LayerMask TargetLayerMask
 the layer(s) to search our target on More...
 
LayerMask ObstacleMask = LayerManager.ObstaclesLayerMask
 the layer(s) to block the sight More...
 
float TargetCheckFrequency = 1f
 the frequency (in seconds) at which to check for obstacles More...
 
bool CanTargetSelf = false
 if this is true, this AI will be able to consider itself (or its children) a target More...
 
int OverlapMaximum = 10
 the maximum amount of targets the overlap detection can acquire 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 DetectTarget ()
 Returns true if a target is found within the circle More...
 
virtual void OnDrawGizmosSelected ()
 Draws gizmos for the detection circle More...
 
- Protected Member Functions inherited from MoreMountains.Tools.AIDecision
virtual void Awake ()
 On Awake we grab our Brain More...
 

Protected Attributes

Collider _collider
 
Vector3 _raycastOrigin
 
Character _character
 
Color _gizmoColor = Color.yellow
 
bool _init = false
 
Vector3 _raycastDirection
 
Collider[] _hits
 
float _lastTargetCheckTimestamp = 0f
 
bool _lastReturnValue = false
 
List< Transform > _potentialTargets
 
- 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 will return true if an object on its TargetLayer layermask is within its specified radius, false otherwise. It will also set the Brain's Target to that object.

Member Function Documentation

◆ Decide()

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

On Decide we check for our target

Returns

Implements MoreMountains.Tools.AIDecision.

◆ DetectTarget()

virtual bool MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.DetectTarget ( )
protectedvirtual

Returns true if a target is found within the circle

Returns

◆ Initialization()

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

On init we grab our Character component

Reimplemented from MoreMountains.Tools.AIDecision.

◆ OnDrawGizmosSelected()

virtual void MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.OnDrawGizmosSelected ( )
protectedvirtual

Draws gizmos for the detection circle

Member Data Documentation

◆ _character

Character MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._character
protected

◆ _collider

Collider MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._collider
protected

◆ _gizmoColor

Color MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._gizmoColor = Color.yellow
protected

◆ _hits

Collider [] MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._hits
protected

◆ _init

bool MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._init = false
protected

◆ _lastReturnValue

bool MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._lastReturnValue = false
protected

◆ _lastTargetCheckTimestamp

float MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._lastTargetCheckTimestamp = 0f
protected

◆ _potentialTargets

List<Transform> MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._potentialTargets
protected

◆ _raycastDirection

Vector3 MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._raycastDirection
protected

◆ _raycastOrigin

Vector3 MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D._raycastOrigin
protected

◆ CanTargetSelf

bool MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.CanTargetSelf = false

if this is true, this AI will be able to consider itself (or its children) a target

◆ DetectionOriginOffset

Vector3 MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.DetectionOriginOffset = new Vector3(0, 0, 0)

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

◆ ObstacleMask

LayerMask MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.ObstacleMask = LayerManager.ObstaclesLayerMask

the layer(s) to block the sight

◆ OverlapMaximum

int MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.OverlapMaximum = 10

the maximum amount of targets the overlap detection can acquire

◆ Radius

float MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.Radius = 3f

the radius to search our target in

◆ TargetCheckFrequency

float MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.TargetCheckFrequency = 1f

the frequency (in seconds) at which to check for obstacles

◆ TargetLayerMask

LayerMask MoreMountains.TopDownEngine.AIDecisionDetectTargetRadius3D.TargetLayerMask

the layer(s) to search our target on


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