Unity Tools

Small collection of Unity C# scripts for a game manager, saving, sound, options, triggers, tracking and common helpers.

GitHub Repo

Overview

Unity Tools is a small collection of Unity C# scripts I keep around as reference. My newer rendering and LOD systems are in MAZE Tools.

Included scripts

  • MAIN is a central singleton for the main game manager, with a screen fade, level loading and debug tools.
  • SaveManager saves game data and custom data to a file. Anything serializable can be stored.
  • Sound handles pooled SFX with sound banks, pitch and volume variation, 3D and UI sounds, and music with fades and intro-to-loop tracks.
  • OptionsMenu saves volume, resolution and quality settings through PlayerPrefs. It's built on my own menu UI and a few other scripts, so it needs hooking up to your own.
  • AnimatorEventPasser fires animation events on any object set in the inspector, not just the one with the animator.
  • Trigger fires enter, exit and stay events from a trigger collider, filtered by tag.
  • Tracker follows a target transform with options for lookahead, damping, rotation follow, automatic player tracking and Y locking.
  • Util has object, coroutine, math, random and scene-loading helpers.

Included Features

Game Manager

MAIN is a central singleton with a screen fade, level loading and debug tools.

Saving

SaveManager saves any serializable data to a file, custom classes included.

Sound

Pooled SFX with sound banks, and music with an intro section that leads into a loop.

Options Menu

OptionsMenu saves volume, resolution and quality settings through PlayerPrefs.

Animation Events

AnimatorEventPasser fires animation events on any object set in the inspector.

Target Tracking

Tracker follows a target, with optional controls such as lookahead, damping and rotation.