Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

Hey!

New video about why Enums are often not the tool for the job and how to refactor them to more OO solution using Scriptable objects.


Her are the project files available for patrons - that is you :) 

https://drive.google.com/file/d/1U1GeL0CBelu_YRuHmNQ6eI2dursGlWv0/view?usp=sharing


I hope that you will enjoy the video :)

Take care!

-Peter

Files

Previews only

Unity 2021 Use Scriptable Object instead of Enum

"Why can't I create Enum values from all of my weapon in my prefab folder?!" -me few years ago When I was learning how to use Enums in Unity I knew that they are meant to represent state of something ex player has a WeaponType.Sword. This was wrong thinking. While they are good to represent ex cardinal directions (assuming that no one will add more) adding new enum for a new weapon type or anything that is certain to change / grow is not the way. Scriptable objects (and a bit of Object Oriented design) are. Let me show you why :) Learn to write more maintainable code using Design patterns by making a 2d platformer game: https://courses.sunnyvalleystudio.com/ Play the end result: https://svstudio.itch.io/unity-turn-based-strategy-tutorial-game Project files: Have any questions? Join the discord: https://discord.gg/RQEtYHz Assets used: https://quaternius.com/ #scriptableobject #unity3d #enum #csharp #sunnyvalleystudio #unitytips

Comments

No comments found for this post.