39 lines
1.5 KiB
C#
39 lines
1.5 KiB
C#
using UnityEngine;
|
|
using System;
|
|
|
|
/*
|
|
# Enemy System
|
|
## States
|
|
1. **Passive**
|
|
- Enemy is unaware of danger and performing idle actions. Not actively searching for anything.
|
|
- Perception range is at its minimum.
|
|
- If agressive target is "visible" enter `Agressive` state.
|
|
- If nonagressive target is "visible" enter `Aware` state.
|
|
2. **Guard**
|
|
- Enemy is looking out for danger. Can be moving along a path or standing
|
|
- Perception range is at regular level.
|
|
- If aggressive target is "visible" enter `Agressive` state.
|
|
- If nonagressive target is "visible" enter `Aware` state.
|
|
3. **Aware**
|
|
- Enemy has noticed something and is moving towards location of interest.
|
|
- Peception range is at regular level.
|
|
- If player is "visible" enter `Agressive` state.
|
|
- If nonagresive target is "visible" of equal or greater importance change target.
|
|
- If at location and no new item of note is added to "visible", then enter either `Passive` or `Guard` mode based on original mode.
|
|
4. **Aggressive**
|
|
- Enemy has noticed player:
|
|
- Apply these actions in sequence:
|
|
a. If player has not been "visible" for more than 5 seconds enter `Guard` mode.
|
|
b. If player has not been "visible" for < 5 seconds move to last location it was visible.
|
|
c. If player is in attack range and is visible, stop moving, and attack if able.
|
|
d. If player is not in attack range and is visible, run in direction of player.
|
|
|
|
|
|
*/
|
|
class AIStateMachine : MonoBehaviour{
|
|
[SerializeField]
|
|
private EnemyAI.EnemyState state;
|
|
|
|
|
|
|
|
} |