-
Notifications
You must be signed in to change notification settings - Fork 10
Index
title: Unity Helpers description: Production-ready Unity utilities - 10-15x faster PRNGs, O(log n) spatial queries, zero-allocation pooling, inspector tooling, and data-driven effects.
Utilities tested in commercial releases
Unity Helpers reduces repetitive work with utilities tested in commercial releases. Benchmarks demonstrate 10-15x faster random generation compared to Unity.Random and significant speedups for common reflection operations. From auto-wiring components to fast spatial queries, this toolkit provides common utilities for Unity development.
=== "OpenUPM (Recommended)"
```bash
openupm add com.wallstop-studios.unity-helpers
```
=== "Git URL"
In Unity Package Manager, click **Add package from git URL** and enter:
```text
https://github.com/wallstop/unity-helpers.git
```
=== "NPM Registry"
Add scoped registry in `manifest.json`:
```json
{
"scopedRegistries": [
{
"name": "npm",
"url": "https://registry.npmjs.org",
"scopes": ["com.wallstop-studios"]
}
],
"dependencies": {
"com.wallstop-studios.unity-helpers": "3.0.0"
}
}
```
=== "Source"
Download the [latest release](https://github.com/wallstop/unity-helpers/releases) `.unitypackage` or clone the repository.
Grouping, buttons, conditional display, toggle grids for Unity inspectors, free and open source.
Learn more :material-arrow-right:{ .md-button }
PRNG.Instance provides high-performance random generation with API including weighted selection, Gaussian distribution, and Perlin noise.
Learn more :material-arrow-right:{ .md-button }
Auto-wire components with attributes like [SiblingComponent], [ParentComponent], and [ChildComponent]. Works with DI containers.
Learn more :material-arrow-right:{ .md-button }
Designer-friendly buffs and debuffs as ScriptableObjects. Add new effects via data instead of code changes.
Learn more :material-arrow-right:{ .md-button }
QuadTree, KdTree, RTree, OctTree, and SpatialHash for 2D and 3D. Efficient spatial queries without linear iteration.
Learn more :material-arrow-right:{ .md-button }
Automate sprite, animation, texture, and prefab workflows. Reduces manual repetitive tasks.
Learn more :material-arrow-right:{ .md-button }
Pick your starting point based on your biggest pain point:
| Your Problem | Your Solution | Time to Value |
|---|---|---|
| Writing custom editors | Inspector Tooling - Inspector attributes, free | ~2 minutes |
Writing GetComponent everywhere |
Relational Components - Auto-wire with attributes | ~2 minutes |
| Need buffs/debuffs system | Effects System - Designer-friendly ScriptableObjects | ~5 minutes |
| Slow spatial searches | Spatial Trees - O(log n) queries | ~5 minutes |
| Random is too slow/limited | Random Generators - 10-15x faster with weighted selection, Gaussian, Perlin noise | ~1 minute |
| Need save/load system | Serialization - Unity types supported | ~10 minutes |
| Manual sprite workflows | Editor Tools - 20+ automation tools | ~3 minutes |
!!! tip "Not sure where to start?"
The [Getting Started Guide](Overview-Getting-Started) walks through the top 3 features in 5 minutes.
using UnityEngine;
using WallstopStudios.UnityHelpers.Core.Attributes;
public class Player : MonoBehaviour
{
// Auto-finds on same GameObject
[SiblingComponent] private SpriteRenderer spriteRenderer;
// Auto-finds in parent hierarchy
[ParentComponent] private Rigidbody2D rigidbody;
// Auto-finds all in children
[ChildComponent] private Collider2D[] childColliders;
void Awake()
{
this.AssignRelationalComponents(); // One call wires all marked fields
}
}using WallstopStudios.UnityHelpers.Core.Random;
using WallstopStudios.UnityHelpers.Core.Extension;
public class LootDrop : MonoBehaviour
{
void Start()
{
// 10-15x faster than UnityEngine.Random
IRandom rng = PRNG.Instance;
// Basic usage
int damage = rng.Next(10, 20);
float chance = rng.NextFloat();
// Weighted random selection
string[] loot = { "Common", "Rare", "Epic", "Legendary" };
float[] weights = { 0.6f, 0.25f, 0.10f, 0.05f };
int index = rng.NextWeightedIndex(weights);
Debug.Log($"Dropped: {loot[index]}");
}
}using UnityEngine;
using WallstopStudios.UnityHelpers.Core.Attributes;
public class CharacterStats : MonoBehaviour
{
[WGroup("combat", "Combat Stats", collapsible: true)]
public float maxHealth = 100f;
[WGroupEnd("combat")]
public float defense = 10f;
public enum WeaponType { Melee, Ranged, Magic }
public WeaponType weaponType;
[WShowIf(nameof(weaponType), WShowIfComparison.Equal, WeaponType.Ranged)]
public int ammoCapacity = 30;
[WButton("Heal to Full", groupName: "Debug")]
private void HealToFull() { maxHealth = 100f; }
}Compatible with IL2CPP and WebGL. Includes optimizations for AOT compilation.
- Getting Started - Quick start guide (5 minutes)
- Feature Index - Alphabetical reference of all features
- Glossary - Term definitions
- Roadmap - Upcoming features and priorities
- Inspector Tooling - Attributes, buttons, validation
- Relational Components - Auto-wire with attributes
- Effects System - Data-driven buffs/debuffs
- Spatial Trees - Fast spatial queries
- Serialization - JSON and Protobuf with Unity types
- Data Structures - Heaps, tries, and more
- Random Generators - High-performance PRNGs
- Editor Tools - Sprite, animation, texture automation
- Random Performance
- Spatial Tree 2D Performance
- Spatial Tree 3D Performance
- Relational Components Performance
Unity Helpers is released under the MIT License. Use it freely in commercial and personal projects.
Getting Started Guide{ .md-button .md-button--primary } View on GitHub{ .md-button }
📦 Unity Helpers | 📖 Documentation | 🐛 Issues | 📜 MIT License
- Inspector Button
- Inspector Conditional Display
- Inspector Grouping Attributes
- Inspector Inline Editor
- Inspector Overview
- Inspector Selection Attributes
- Inspector Settings
- Inspector Validation Attributes
- Utility Components
- Visual Components
- Data Structures
- Helper Utilities
- Math And Extensions
- Pooling Guide
- Random Generators
- Reflection Helpers
- Singletons