Tagged: csharp

A Finite State Machine in Unity
Split what a game object does into states with enter, update and exit steps, with a small generic state machine you can reuse in any MonoBehaviour.
Intermediate15 min
Part 1: Items and the Inventory
Build the data side of an inventory in Unity: items as ScriptableObjects, stacks with an amount and one generic inventory class for every kind of item, tried out with pickups and a recipe.
Intermediate50 min
The Singleton Pattern in Unity
A generic singleton base class for managers that exist exactly once, a version that survives scene loads, and the traps to know about.
Beginner8 min
Part 2: An Inventory Bar With UI Toolkit
Show the inventory from part 1 in a bar at the bottom of the screen with UI Toolkit: UXML for the layout, USS for the look and one generic C# class that keeps both inventories up to date.
Intermediate30 min
Smooth LookAt in Unity
Turn an object smoothly towards a target instead of snapping like transform.LookAt(), with smoothing that feels the same at every frame rate.
Beginner8 min