
Explore building a Unity stat system from scratch using the UI toolkit, UI Builder, and Graph API, and implement save, level, health, damage, and basic tests.
this lecture builds a unity stat system with a stat class, stat definition, and a stack of modifiers featuring additive, multiplicative, and override operations, plus value calculation and clamped caps.
Implement a state controller to manage all stats, introduce a stat database scriptable object, a case-insensitive dictionary of state entries, and initialization events.
Implement play mode tests for the stat system, creating test assemblies and a stat database to verify modifiers update physical attack and attack speed within capacity.
Implement an attribute system by creating an attribute class with a value capped by max, applying modifiers via override, additive, or multiplicative modes, and firing change events during state initialization.
Tests validate health attribute behavior in Unity: setup, load scene, apply additive modifiers, clamp current value to max 100 and min 0.
Create primary stats that inherit from stat with their base value, override base value to a member variable, provide add and subtract restricted to stat system, and initialize stat database.
Create tests for the primary stat system, load a test scene, and assert the strength stat base value is one while enabling internals visible for cross-assembly access.
This lecture shows how to build a custom editor window to manage stats in a star database, with tabs for stats, primary stats, attributes; editing base value, capacity, and formula.
Create a Unity scriptable object collection editor with a split view, a left toolbar (search field and create button), and a right panel bound to the name property.
Master a custom scriptable object collection editor in unity by building a generic visual element, binding a list view, search filtering, and create/duplicate/remove workflows with inspector integration.
Create a state database editor window in Unity, using a state system menu item, an 800x600 minimum size, and selection-driven linking to a stat database.
Finalize the Unity stat database editor by implementing the stat collection editor with ed extension controls and a tabbed interface for stats, primary stats, and attributes.
Introduce a node graph editor that lets game designers define stat formulas with notes and add nodes, enabling level- and class-based health scaling across locations without code changes.
Create a node graph editor window in Unity and wire its runtime assets. Configure a visual tree, stylesheet, and split view to enable zoom, selection, and node graph editing.
Create the root node by building a node view with input and output ports, using the create output port function and wiring it into the graph.
Build a custom search window in Unity to search and add graph nodes, implement a provider interface, and create scalar nodes and node views for Unity Shader Graph workflows.
Add an inspector to the editor window to work with serialized variables and propagate the node selected action across the node view and node graph view.
Override get compatible ports to create edges between nodes in the Unity graph, handle non-start directions, and ensure edges persist after reopening the graph by saving changes.
Save graph changes by updating node and edge states, removing and creating connections, and persisting positions. Introduce an intermediate node to distinguish root and leaf nodes and manage graph relationships.
Create and wire math nodes in unity's stat system, building add, subtract, multiply, divide, and power nodes with inputs, outputs, and corresponding views.
Create a stat system using a stat node and a formula node graph to compute values from the root node. Initialize and manage state nodes in the state controller.
Explore the Unity stat system by building a physical attack formula in a node graph, using strength, a scalar of three, and a multiply node, then test updates.
Create a level system where experience requirements rise with level, grant stat points each level, and display level and current versus required experience in a hud.
Create a modular Unity level system with a level controller that tracks experience, updates current level via a graph-based required experience formula, and notifies changes through events.
Implement the old school moonscape experience table using the node graph editor, starting at level one and using the current player level to avoid subtracting one, then validate the output.
Implement the required experience formula using a node graph, create a test directory and level system tests, and wire divide, add, multiply, and power nodes with level and scalar inputs.
Create a test scene, attach the level controller, and verify the level starts at one, current experience reaches zero with 83 required experience, then updates to 90.
Implement the player stat controller in a Unity stat system, wiring level progression, start points (five), and a player stack controller that reacts to level changes and events.
Develop and test a Unity stat system by implementing a player stat controller and level controller. Verify stat points, level progression, and experience handling through tests.
the lecture presents a save system that preserves primary stat values and stat points, enabling resume from fights, with a save manager, file manager, and AI savable controllers for save/load.
Implement a safe save system in Unity using a safe system folder, file manager for binary save/load, AI savable interface, and save data channels managed by a save manager.
Learn to persist Unity stats by integrating a safe system, defining attribute data and primary state data, and wiring a savable interface with load and save flows.
Create a Unity stats window UI by building panels and visual elements for level, experience, attributes, and primary stats, then style with a USS file and color selectors.
Create a stats UI script that wires the UI document to the player's experience, level, and primary stats, updates labels on changes, and manages stat point allocation.
Explains creating and testing the stats ui in Unity, including setting up the stats ui object, panel, and ui document, and validating stat increments and level and experience updates.
Create a heads up display user interface in Unity using the user interface builder, configuring health, mana, and experience bars with colors, fonts, and a row-aligned layout.
Develop a heads up display UI that connects health, mana, level, and experience bars to the player state controller, using a ui document and event-driven updates for dynamic in-game feedback.
Write and run unit tests for the Unity heads up display, wiring the HUD UI to the player state controller and verifying level up text and health bar updates.
Builds the skeleton of a Unity combat system by defining eye damage interfaces, health and max health, damage events, and a floating text display with object pooling and do tween.
Create a health bar in Unity using the legacy UI, building a canvas with background, fill, and border, and a HealthBarUI script updating a slider from max and current health.
Explore implementing physical attacks in a Unity stat system by building a melee weapon with hit events, health modifiers, and a combat system involving a sword, damage, and critical hits.
Implement a health defense system in Unity: a Health class overrides apply modifier, adds physical and magical defense via tag checks, with stack controller integration.
Verify that physical defense reduces damage in the Unity stat system by applying an additive -10 modifier from an ability, with initial health 100 and defense set to five.
Wire the attack speed stat to the enemy's attack speed parameter in the animation controller. Divide the stat value by 100 to scale attacks, with base value 100.
In this course, we will implement a stat system in Unity.
Who is this course for?
This is an advanced course designed for those who already have a fundamental grasp of Unity, and want to learn how to implement a stat system using SOLID design principles.
Are there any course requirements?
A solid understanding of C#
Previous experience using Unity
What you will learn:
How to work with Unity's UI Toolkit and UI Builder
How to work with Unity’s GraphView API
How to implement a save system
How to implement a level system
How to implement a stat system
How to use C# assembly definitions
How to create a custom editor window using the UI Builder
How to create a Heads Up Display (HUD)
How to create a health bar using the Unity UI system
How to create a user interface for viewing stat values
How to make a stat value a function of a mathematical formula
Required experience & base maximum health increase as the player levels up
How to display the damage taken by a character
How to write Play Mode tests
How to modify the speed of an animation based on a stat
How to implement a damage system that accounts for critical hits, differentiates between physical/magical attacks, and includes defensive stats
If all this sounds appealing to you, please join me, and I’ll see you inside the course.