TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.AIDecisionTimeInState Class Reference

This decision will return true after the specified duration, picked randomly between the min and max values (in seconds) has passed since the Brain has been in the state this decision is in. Use it to do something X seconds after having done something else. More...

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

Public Member Functions

override bool Decide ()
 On Decide we evaluate our time.
override void Initialization ()
 On init we randomize our next delay.
override void OnEnterState ()
 On enter state we randomize our next delay.
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 OnExitState ()
 Meant to be overridden, called when the Brain exits a State this Decision is in.

Public Attributes

float AfterTimeMin = 2f
 The minimum duration, in seconds, after which to return true.
float AfterTimeMax = 2f
 The maximum duration, in seconds, after which to return true.
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 EvaluateTime ()
 Returns true if enough time has passed since we entered the current state.
virtual void RandomizeTime ()
 On randomize time we randomize our next delay.
Protected Member Functions inherited from MoreMountains.Tools.AIDecision
virtual void Awake ()
 On Awake we grab our Brain.

Protected Attributes

float _randomTime
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 after the specified duration, picked randomly between the min and max values (in seconds) has passed since the Brain has been in the state this decision is in. Use it to do something X seconds after having done something else.

Member Function Documentation

◆ Decide()

override bool MoreMountains.TopDownEngine.AIDecisionTimeInState.Decide ( )

On Decide we evaluate our time.

Returns

◆ EvaluateTime()

virtual bool MoreMountains.TopDownEngine.AIDecisionTimeInState.EvaluateTime ( )
protectedvirtual

Returns true if enough time has passed since we entered the current state.

Returns

◆ Initialization()

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

On init we randomize our next delay.

Reimplemented from MoreMountains.Tools.AIDecision.

◆ OnEnterState()

override void MoreMountains.TopDownEngine.AIDecisionTimeInState.OnEnterState ( )
virtual

On enter state we randomize our next delay.

Reimplemented from MoreMountains.Tools.AIDecision.

◆ RandomizeTime()

virtual void MoreMountains.TopDownEngine.AIDecisionTimeInState.RandomizeTime ( )
protectedvirtual

On randomize time we randomize our next delay.

Member Data Documentation

◆ _randomTime

float MoreMountains.TopDownEngine.AIDecisionTimeInState._randomTime
protected

◆ AfterTimeMax

float MoreMountains.TopDownEngine.AIDecisionTimeInState.AfterTimeMax = 2f

The maximum duration, in seconds, after which to return true.

◆ AfterTimeMin

float MoreMountains.TopDownEngine.AIDecisionTimeInState.AfterTimeMin = 2f

The minimum duration, in seconds, after which to return true.


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/AI/Advanced/AIDecisionTimeInState.cs