Skip to content

Pang/NpcLogic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NpcLogic

NPC base, health & state logic written in C# for Unity using the Finite-State Machine Pattern

NpcBase.cs

The foundation logic, could be split into further classes but currently holds expected properties/components, as well as logic for becoming alerted/alarmed (alerted means it's suspicous and will investigate where it last heard you, alarmed means it knows you're there and they're coming!)

NpcHealth.cs

Health logic, handles npc UI healthbar & taking damage logic

HelperMethods.cs

Contains various helper methods for the npc sight and hearing

NpcStates > NpcStateManager.cs

The State Manager is a singleton class that holds an instance of all the Npc's states (idle, investigating, dead etc..) and runs the logic to switch between them. It also has a reference to all of the npc's in the scene so it could be used to group npc's and stagger routines like walking paths for performance or create world events.

About

NPC AI logic written in C# for Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages