Unity Packages

Various Editor Tools and Packages to assist development

I have developed many packages and in editor tools for use across projects while working at Mini Mammoth Games. These aim to speed up development and provide new features while working on projects.

Features

Starting as the save and load system for Bundimal Rush, I developed and expanded the save and load system into a standalone package which was then used for all future Mini Mammoth Games projects. The static class contains simple Save and Load functions for serializing and deserializing classes to locally stored files. It includes the ability to change out serializers so files can be saved as binary, JSON or use third party serializers such as Odin.

Save and Load

The MMG package contains various helper and extension functions for common functionality. Some of these include:

  • Bitwise: Implements setter and getter functions for working with bitmasks including testing for collisions between bitmasks.

  • Math Functions: Various math functions for calculating sum, averages, closest point on a line, and circle intersection.

  • Collection Extensions: Extension functions for collections including shuffle, swap and move, as well as methods for finding minimum and maximum values.

  • Vector Extensions: Extension methods for vectors for resizing, rotating, and snapping to axis.

Helper and Extension Functions

To improve the usability of the Unity Inspector, I implemented various attributes and classes modifying how variables can be displayed. Some of the most useful include:

  • TweenCurve: Displays a dropdown for various easing curves, including the ability to create custom curves.

  • InterfaceObject: Allows objects to be passed into the Unity Inspector based on their implemented interfaces.

  • Expandable Attribute: Displays the serialized values of a Scriptable Object in line, when passed into another object.

  • ArrayName Attribute: Allows the renaming of array elements, including the use of wildcards.

  • TagSelector Attribute: Displays a string variable as a dropdown of the tags setup in Unity.

  • ShowAssetPreview Attribute: Displays an asset’s icon when passed into the inspector.

Attributes and Helper Classes

Tools

The packages include a number of editor tools I’ve created that provide specific functionality in the Unity Editor. These tools include:

  • Bake Texture Tool: Renders a material to a texture, allowing textures to be created via shaders.

  • Combine Mesh Tool: Combines multiple meshes together into one asset as submeshes, which can improve performance.

  • Multi Screenshot Capture: Screenshots the game at set resolutions, useful for capturing images for store pages.

Advanced Logging

The AdvancedLog class improves Unity’s default Debug.Log functionality by adding various conditionals to prevent filling up the console unnecessarily. Developers can define what platforms to log to, and can set up tags which can be toggled on and off per user.

Reference Object and Reference List

One of the most useful and unique editor features I created within the Unity Packages was what I named Reference Objects and Reference Lists. By default, Unity does not allow for the serialization of derived classes and interfaces. However, using the SerializeReference attribute, I was able to create an editor property drawer that allows the selection of all derived classes from a generic base class or interface. The Inspector will then display the serialized variables of that class to be edited, which allows the easy exchanging and reuse of functionality in distinct classes without storing unneeded variables.

UI Animation

I created MMG’s UI Package which contains a variety of components for opening and closing with various tweens and animations that can be swapped out and adjusted easily. The tween components contain values for adjusting their duration, delay and easing curve.

Documentation

Using doxygen, I created documentation webpages for all the classes and functionality in the MMG packages. The documentation contains images and code examples for all methods and variables, allowing all programmers–including placement students–to be able to use the packages easily and effectively.

Previous
Previous

Merge Racer

Next
Next

Other Projects