TopDown Engine v5.0
Loading...
Searching...
No Matches
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.
override bool Decide ()
 On Decide we check for our target.
Public Member Functions inherited from MoreMountains.Tools.AIDecision
bool Decide ()
 Decide will be performed every frame while the Brain is in a state this Decision is in. Should return true or false, which will then determine the transition's outcome.
virtual void OnEnterState ()
 Meant to be overridden, called when the Brain enters a State this Decision is in.
virtual void OnExitState ()
 Meant to be overridden, called when the Brain exits a State this Decision is in.

Public Attributes

float Radius = 3f
 the radius to search our target in
Vector3 DetectionOriginOffset = new Vector3(0, 0, 0)
 the offset to apply (from the collider's center)
LayerMask TargetLayerMask
 the layer(s) to search our target on
LayerMask ObstacleMask = LayerManager.ObstaclesLayerMask
 the layer(s) to block the sight
float TargetCheckFrequency = 1f
 the frequency (in seconds) at which to check for obstacles
bool CanTargetSelf = false
 if this is true, this AI will be able to consider itself (or its children) a target
int OverlapMaximum = 10
 the maximum amount of targets the overlap detection can acquire
Public Attributes inherited from MoreMountains.Tools.AIDecision
string Label
 a label you can set to organize your AI Decisions, not used by anything else

Protected Member Functions

virtual bool DetectTarget ()
 Returns true if a target is found within the circle.
virtual void OnDrawGizmosSelected ()
 Draws gizmos for the detection circle.
Protected Member Functions inherited from MoreMountains.Tools.AIDecision
virtual void Awake ()
 On Awake we grab our Brain.

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 ( )

On Decide we check for our target.

Returns

◆ 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: