Post

Code Monkey
Code Monkey@UnityCodeMonkey·
With so many design patterns out there, which should you actually know as a Unity dev? My must-haves: - Singleton (for central managers) - Observer pattern (for events & messaging) - State Machine (simple AI) Then you also have Object Pooling (for performance with lots of objects when needed), the Strategy pattern, Command, and Dependency Injection, etc, all are super useful for more complex games and niche use cases. BUT: don't force a pattern "just because", patterns are tools, not rules. Use what fits and actually helps in whatever task you're working on!
Code Monkey tweet media
English
5
8
55
2.3K
Alexander T.
Alexander T.@VertexBlit·
@UnityCodeMonkey but then you go on the data oriented side and most of the patterns from OOP are unusable and/or irrelevant, at least with unity's ecs implementation :)
English
1
0
1
33
Dire Prism - Wishlist Grimfog!
Dire Prism - Wishlist Grimfog!@journeys_ARPG·
@UnityCodeMonkey Some good ones for sure. Even given how much of a bad reputation Singleton has gotten, it sure makes life much easier in Unity. Flyweight is another one that's worth a mention.
English
0
0
1
77
Robin | Game dev ᕕ(ᐛ)ᕗ
@UnityCodeMonkey And this classic: youtube.com/watch?v=raQ3iH… I use scriptable objects as event channels personally, and as glue for a tons of stuff, inventories and more. Also use the VariableSOs, for instance, instead of scripts having to reference the player, they can reference PlayerPositionSO
YouTube video
YouTube
English
0
0
0
144
Paylaş