AIBrain

Description

The main runtime component of DaniAI. Creates and runs a copy of an AITemplate instance.

public class InitialPrefabs.DaniAI.AIBrain
    : MonoBehaviour, IAIBrain, IBrainRunnable

Properties

Type Name Summary
ExecutionType ExecutionOrder When the brain should run its AI Step (during Update, OnUpdate, etc.).
RunningState RunningStatus The current running state of the brain. The brain will only run when its running status is set to RunningState.Running (via StartBrain()).
AITemplate RuntimeTemplate The local copy of the template used to perform AI-related actions.
AITemplate Template The template that this brain is using to perform AI-related actions.

Events

Type Name Summary
DrawGizmosHandler OnDrawGizmosEvent A gizmos event that is called during OnDrawGizmos().
DrawGizmosHandler OnDrawGizmosSelectedEvent A gizmos event that is called when the AIBrain is selected in the editor.
PauseHandler OnPauseEvent An event that is called when the brain pauses. Register a method here if you want your AINode to pause when the brain pauses.
ResumeHandler OnResumeEvent An event that is called when the brain resumes. Register a method here if you want your AINode to resume when the brain resumes.

Methods

Type Name Summary
float GetCurrentDecisionScore(Decision decision) Gets the current score of a decision
void Pause() Pauses the brain and its AI nodes.
void RestartBrain() Restarts the brain and runs all AI steps from scratch.
void Resume() Attempts to resume the brain from its paused state.
void RunActionStep() Runs the appropriate set of actions as defined by the active decision.
void RunAIStep() Plays all AI Steps (observation, decision, action) together in one go.
void RunDecisionStep() Updates the decision to the next active decision.
void RunObservationStep() Updates all enabled Observers' values.
void StartBrain() Starts the brain by picking a decision and running the observer step.
void StopBrain() Stops the brain from running all functions