Revolutionize Your Unity Game with Optionals and Monads @git-amend
Revolutionize Your Unity Game with Optionals and Monads  @git-amend
Uploaded December 2024 | Updated September 2026, 5 days ago
Nullable types (`int?`), the `default` keyword, and the null-forgiving operator (!) set the stage for creating powerful Monads like Optional and Either in Unity. In this video, we dive into how these Monads can eliminate null checks, handle success and failure scenarios, and simplify branching logic. With practical examples, you'll learn how to implement Optional and Either to write cleaner, safer, and more expressive code for your Unity projects.

Want to support me? 😀
Buy me a coffee! ko-fi.com/adammyhre

🔔 Subscribe for more Unity Tutorials youtube.com/@git-amend

Discord: discord.gg/FDRZGQBBUC

#unity3d #gamedev #indiedev

▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬

0:00 Nullables and Default
4:35 Null Object Programming Pattern
5:30 Optional Monad
10:30 Either Monad

*Source code:* gist.github.com/adammyhre/253ecd375e2a17974c496b12e2ab54f0

OneOf Library: github.com/mcintyre321/OneOf
.NET Optionals: learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.optional-1?view=roslyn-dotnet-4.9.0

More Useful Code:
github.com/adammyhre?tab=repositories
Unity Utility Library: github.com/adammyhre/Unity-Utils
Lock Inspector Hotkey: gist.github.com/adammyhre/4754f731a93bf1cab0d1385ccfa23642

Assets Shown In This Video (Affiliate Links)
Hierarchy Folders: assetstore.unity.com/packages/tools/utilities/hierarchy-folders-157716?aid=1101lw3sv
RPG Fantasy Characters: assetstore.unity.com/packages/3d/characters/humanoids/fantasy/rpg-fantasy-pack-47749?aid=1101lw3sv
Dynamic Nature: assetstore.unity.com/packages/3d/vegetation/forest-environment-dynamic-nature-150668?aid=1101lw3sv
Beautify: assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/beautify-3-advanced-post-processing-233073?aid=1101lw3sv
Umbra Soft Shadows: assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/umbra-soft-shadows-better-directional-contact-shadows-for-urp-282485?aid=1101lw3sv
Hot Reload: assetstore.unity.com/packages/tools/utilities/hot-reload-edit-code-without-compiling-254358?aid=1101lw3sv
Hierarchy Icons: assetstore.unity.com/packages/tools/utilities/better-hierarchy-272963?aid=1101lw3sv
Better Transform: assetstore.unity.com/packages/tools/utilities/better-transform-size-notes-global-local-workspace-child-parent--276554?aid=1101lw3sv
Better Mesh Filter: assetstore.unity.com/packages/tools/utilities/better-mesh-filter-266489?aid=1101lw3sv
Editor Console Pro: assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889?aid=1101lw3sv
Any Object Finder: assetstore.unity.com/packages/tools/utilities/any-object-finder-286455?aid=1101lw3sv

*Follow me!*
https://linktr.ee/gitamend
Revolutionize Your Unity Game with Optionals and MonadsDevOps for Game Devs: New Unity CLI + GitHub ActionsLearn to Build an Advanced Event Bus | Unity ArchitectureBuild a Rail Shooter in Unity: Generate Splines at Runtime (Part 3)5 Unity Tools I’ve Added to Reduce Friction in DevelopmentEssential Elements of Cinemachine 3.1Create Baldurs Gate Style Dice in UnityClean and Extensible: Chain of Responsibility in Unity ProjectsSurvival Building System in Unity (Sockets + Snapping)5 Small Architecture Wins for New Unity DevelopersFinally, a Unity Dependency Injection Framework That Just WorksUsing Data to Drive Gameplay Systems in Unity
git-amend |

Revolutionize Your Unity Game with Optionals and Monads

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER