- Home
- Skills
- Game Development
- Unity Game Builder: C# Conventions and Headless Tests
Unity Game Builder: C# Conventions and Headless Tests
Unity C# that compiles, keeps rules testable and scenes intact, with headless EditMode and PlayMode tests, command-line builds and log reading the agent can prove.
$9
Works with the AI Agents you already use
Unity Game Builder: C# Conventions and Headless Tests
Example session with this skill installed
Create a new EditMode test to verify that the PlayerStats ScriptableObject correctly calculates health after taking damage, and run it via batch mode.
- Read your context and instructions
- Compiled the unity game builder
I have created the test class and verified the logic via a headless Unity run.
Test Implementation and Validation
The new test is located at Assets/Tests/EditMode/PlayerStatsTests.cs. It verifies the damage calculation logic in your PlayerStats ScriptableObject without needing to load a heavy scene.
using NUnit.Framework;
using MyGame.Core;
using UnityEngine;
namespace MyGame.Tests.EditMode
{
public class PlayerStatsTests
{
[Test]
public void TakeDamage_ReducesCurrentHealth_ButNotBelowZero()
{
// Arrange
var stats = ScriptableObject.CreateInstance<PlayerStats>();
stats.MaxHealth = 100;
stats.Reset();
// Act
stats.TakeDamage(30);
int healthAfterSmallDamage = stats.CurrentHealth;
stats.TakeDamage(150);
int healthAfterLethalDamage = stats.CurrentHealth;
// Assert
Assert.AreEqual(70, healthAfterSmallDamage);
Assert.AreEqual(0, healthAfterLethalDamage);
Object.DestroyImmediate(stats);
}
}
}
I ran the EditMode suite using the following command:
Unity.exe -batchmode -nographics -projectPath "." -runTests -testPlatform EditMode -testResults "Logs/editmode_results.xml" -logFile "Logs/editmode.log"
Test Results Summary:
- Status: Passed
- Total Tests: 1
- Failures: 0
- Duration: 0.12s
- XML Path:
Logs/editmode_results.xml
Next steps
- Open the Test Runner window in Unity (Window > General > Test Runner) to see the new test in the UI.
- Run the test once in the Editor to confirm the
PlayerStatsasset behaves correctly when modified via the Inspector.
Connects securely to your tools. The creator never sees your data.
About this skill
Building Unity games is often a cycle of broken prefab references, main-thread exceptions, and "it works in my editor" bugs. This skill enforces a professional Unity 6 workflow that treats your project as a testable, automatable codebase rather than a fragile collection of binary assets.
What it does
- Architectural Enforcement implements assembly definitions (
.asmdef), ScriptableObject data patterns, and strict C# lifecycle conventions to prevent spaghetti code. - Headless Testing runs EditMode and PlayMode tests via command line, parsing NUnit XML results to prove logic works before you ever hit Play.
- Automated Builds executes command-line player builds for Windows and Android, reading
Editor.logto diagnose compiler errors and IL2CPP stripping issues. - Asset Management handles scenes and prefabs as serialized YAML, using editor scripts for modifications to ensure reference integrity.
- Performance Auditing identifies per-frame GC allocations, missing object pools, and inefficient
GetComponentcalls during code reviews.
How it works
- Analyze Environment by checking
ProjectVersion.txt, active Input Handling, and UI frameworks to match your specific stack. - Execute Logic Changes in plain C# classes and thin
MonoBehaviouradapters to keep rules testable outside of the scene. - Validate via Batch by running headless compilation and test suites to catch regressions immediately.
- Report Results with exact test counts, log snippets for failures, and specific manual steps for the Unity Editor.
Frameworks & tools
Specifically designed for Unity 6 LTS (and 2022 LTS) using C#, URP, Input System, UI Toolkit/UGUI, and the Unity Test Framework. Works with IL2CPP and Android SDK workflows.
Why this beats prompting it yourself
Generic prompts often suggest outdated UnityEngine.Input calls or "magic" fixes for YAML merge conflicts. This skill applies specific Unity 6 constraints, like SubsystemRegistration resets for static fields and proper URP render requests, that are frequently missed by general-purpose models.
Use cases
- Refactoring a monolithic project into modular assembly definitions.
- Writing high-performance gameplay code with zero per-frame allocations.
- Setting up a headless CI/CD pipeline for automated testing and builds.
- Debugging lifecycle-sensitive issues like event unsubscription or
asynccleanup.
Known limitations
Cannot interact with the Unity Editor UI directly. Requires the developer to close the editor for batch runs or work via the Test Runner window. Cannot bypass license activation or manage store credentials.
Requires local Unity installation and activated license. Cannot run batch tasks while the project is open in the Unity Editor. Does not support patching serialized assets by hand.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 7 days ago