Back to Browse

Unity C# - State Machine Design Pattern With Scriptable Objects - 2024 Solution

345 views
May 4, 2024
20:21

In this video, I'm going to show the State Machine solution that I've been using for the past few months in my projects. This system was initially created when I started the Ghosts 'n Goblins series. But it had some problems, and it wasn't as flexible as this current version is. So I did some refactoring and improved some areas, and now it's good to be used in Unity Projects. This system uses Scriptable Objects to create and define StateMachines. So I would say it's almost like a data-driven system. This is not a hierarchical StateMachine, because it was originally designed to be used on the Ghosts 'n Goblins game, and there was no need to create this system as hierarchical. But you can expand using this current version as a base. I think in the future I'll create a hierarchical StateMachine and I'll certainly be using this current version as a foundation. If you have any questions or suggestions, just drop a comment down below. You can get the package and source code files here: https://github.com/Lasanha-Dev/Unity-StateMachine 00:00 Demonstration 05:40 EntityComponentsReferences 06:50 StateDefinition 07:46 AnyStateDefinition 08:10 TransitionConditionBase 09:35 StateMachine 10:50 StateBase 11:55 StateMachineParameters 14:28 StateMachineStates 16:43 Custom Editor 18:17 States 18:45 Outro

Download

0 formats

No download links available.

Unity C# - State Machine Design Pattern With Scriptable Objects - 2024 Solution | NatokHD