Helper scripts for Unity development
Utilikit is a collection of scripts & bits to make Unity development that little bit easier.
All scripts are Copyright Eddie Cameron unless they say otherwise.
Replaces MonoBehaviour as the base class for script components. It replaces Unity's own (now obsolete) component getters (e.g. .transform and .rigidbody) with caching versions.
A Unity-friendly singleton for your own static classes. Ensures there's only one in each scene at a time, and auto instantiates itself when needed.
Replace Debug. calls with DebugExtras. calls to have them auto stripped when a DEBUG flag isn't present. Also makes console printouts a little easier to read.
A separately pausable Time system that doesn't affect unwanted coroutines, with helper events for when timescale changes.
Standard events with multiple listeners will stop executing when one listener throws an exception. Raise events through this class to make sure all listeners get the event, as well as getting a handy auto-null check.
Static class to tween any object's location, rotation or scale in a given time. Supports easing and callbacks.
Lerps a value to keep up with a target.
Sends events when objects of a given layer enter/stay/exit a trigger. Can also keep track of all matching colliders within the trigger.
Probably the script I use the most!
Just switches a renderer's colour back and forth. Seemed like a good idea at the time.
To smoothly transition a value between on/off states without worrying about all those edge cases. (e.g. a light that dims slowly when turned off)
Just makes the object face the given target. Useful for billboards.
Make an object oscillate over a given axis
Rotates an object around a given axis
Make any enum with the [Flags] attribute into a dropdown list, like the Unity layer mask selector.
Make an int/float range field with sliders.
- Set one axis of location, rotation, or scale directly transform.SetZPos( 200 )
- Um...just rename the Unity TransformPosition/Direction functions, because I can never remember which way round they go.
- Return the ray from this object going along it's forward axis. transform.GetRay()
- Only add a value to a collection if it doesn't already exist. AddUnique for list types, and TryAdd for dictionaries
- Use foreach on a collection, removing null values as it goes
- Mapping function to copy to a new collection
- RandomElement and Shuffle
A bunch of helpful math functions. Normalise angles, intersect lines & planes, generate min hulls, number formatting, easing (thanks to Darren David), and combinatorics (thanks to Alex Reguiero)
Generic, basic A* pathfinding algorithm
Use Alt-Enter to add a new line to inspector text-boxes in Windows