How to Code a Simple State Machine (Unity Tutorial)

Pubblicato il: 05 gennaio 2020
sul canale di: Infallible Code
163,393
4k

Sign up for the Level 2 Game Dev Newsletter: http://eepurl.com/gGb8eP

In this video, I'm going to teach you how to code a simple State Machine in Unity.

#Unity3d #UnityTutorial, #GameDevelopment

Have you ever written a method with two paths of execution? It probably had an if statement based on a member variable, right? But then your requirements changed, and you added another condition to handle a new state. And I bet they change again, over and over, until your code became a mess of hard-to-read flow logic and conditional statements.

If that's you, then you should learn about State Machines. State Machines are an implementation of the State Pattern, a behavioral design pattern that enables an object to control its internal behavior at runtime. In this Unity tutorial, I'll walk you through the implementation of a simple State Machine that handles the logic of a turn-based battle system.

📦 Download the Project:   / 32870529  

🎓 Related Courses & Videos
https://app.pluralsight.com/library/c...
   • Let's Learn Python #19 - Finite-State...  

👨💻 Join our community:   / discord  
❤️ Support the channel:   / infalliblecode  

My Favorite Unity Assets 💯⤵️
1️⃣ Odin Inspector: https://assetstore.unity.com/packages...
2️⃣ Shapes: https://assetstore.unity.com/packages...
3️⃣ Easy Save: https://assetstore.unity.com/packages...
4️⃣ Dialogue System for Unity: https://assetstore.unity.com/packages...
5️⃣ Editor Console Pro: https://assetstore.unity.com/packages...

⚡ Learn more about Unity 3D Plus at http://prf.hn/click/camref:1100l3e8M/...

👋 Contact me directly at charles@infalliblecode.com

Disclosure: These are affiliate links, which means I'll receive a commission if you use them to make a purchase.


In questa pagina del sito puoi guardare il video online How to Code a Simple State Machine (Unity Tutorial) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Infallible Code 05 gennaio 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 163,393 volte e gli è piaciuto 4 mille spettatori. Buona visione!