using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MoreMountains.Tools
{
///
/// Actions are behaviours and describe what your character is doing. Examples include patrolling, shooting, jumping, etc.
///
public abstract class AIAction : MonoBehaviour
{
public string Label;
public abstract void PerformAction();
public bool ActionInProgress { get; set; }
protected AIBrain _brain;
///
/// On Awake we grab our AIBrain
///
protected virtual void Awake()
{
_brain = this.gameObject.GetComponentInParent();
}
///
/// On Start we trigger our init method
///
protected virtual void Start()
{
Initialization();
}
///
/// Initializes the action. Meant to be overridden
///
protected virtual void Initialization()
{
}
///
/// Describes what happens when the brain enters the state this action is in. Meant to be overridden.
///
public virtual void OnEnterState()
{
ActionInProgress = true;
}
///
/// Describes what happens when the brain exits the state this action is in. Meant to be overridden.
///
public virtual void OnExitState()
{
ActionInProgress = false;
}
}
}