Войти
  • 3288Просмотров
  • 1 год назадОпубликованоFreedom Coding

Creating Finite State Machine In Unity || State Pattern

State pattern is very useful when it comes to creating enemy or player logic, where you need to manage multiple states and the transitions between them. Still, this pattern can be used in many more scenarios, where an object or group of objects can exist in different states. Using the state pattern, we will create an expandable finite state machine for enemies. To the state machine, you will be able to add as many states as you want while keeping the code readable and modifiable. 👍 Like and 🔔Subscribe for More Unity and C# Tutorials @UClTnTUyCeSu9tN8FNNoXMRg Project files - 🌟 Support My Work and Unlock Exclusive Content! 🌟 👉 Patreon: 🎮 Join Our Developer Community! 💬 Discord: 💖 Support Me Financially ☕ PayPal, Revolut: @ Website - Timestamps: 00:00 Intro 00:45 State Pattern 01:38 State Machine 02:08 Finite State Machine 02:30 Understanding The Pattern 03:32 Context + State Interface 04:58 Concrete States 07:06 Result 07:45 Complete Example