Meta Utilities Package

May 16, 2025 ยท View on GitHub

This package contains general utilities for Unity development.

Installation

You can integrate this package into your own project by using the Package Manager to add the following Git URL:

https://github.com/meta-quest/Unity-UtilityPackages.git?path=com.meta.utilities

Contents

UtilityDescription
AutoSet attributes

This attribute is useful for eliminating calls to GetComponent. By annotating a serialized field with [AutoSet], every instance of that field in a Prefab or Scene will automatically be assigned in editor (by calling GetComponent). This assignment is done both in the inspector (using a property drawer) as well as every time the object is saved (using an asset postprocessor).

Note, you can also use [AutoSetFromParent] or [AutoSetFromChildren].
SingletonSimple implementation of the singleton pattern for MonoBehaviours. Access the global instance through the static Instance property. Utilize in your own class through inheritance, for example:
public class MyBehaviour : Singleton<MyBehaviour>
MultitonSimilar to Singleton, this class gives global access to all enabled instances of a MonoBehaviour through its static Instances property. Utilize in your own class through inheritance, for example:
public class MyBehaviour : Multiton<MyBehaviour>
EnumDictionaryThis is an optimized Dictionary class for use with enum keys. It works by allocating an array that is indexed by the enum key. It can be used as a serialized field, unlike System.Dictionary.
Extension MethodsA library of useful extension methods for Unity classes.
Netcode Hash FixerThe NetworkObject component uses a unique id (GlobalObjectIdHash) to identify objects across the network. However, certain instances (for example, instances of prefab variants) do not generate these IDs properly. This asset postprocessor ensures that the IDs are always regenerated, which prevents issues networking between the Editor and builds.
Network Settings Toolbar
This toolbar allows for improved iteration speed while working with ParrelSync clones. By consuming the properties set in the NetworkSettings class, multiple Editor instances of the project can automatically join the same instance.
Settings Warning Toolbar
This toolbar gives a helpful warning when the build platform is not set to Android, and gives an option to switch it. This is useful for ensuring that the build platform is Android while doing Quest development.
Build ToolsThe BuildTools class contains methods for use by Continuous Integration systems.
Menu HelpersThis class adds many useful menu items to the Tools menu in the Unity Editor. When the Unity Search Extensions package is enabled, this adds a helpful asset context menu item "Graph Dependencies" and adds the "Tools/Find MIssing Dependencies" menu item.
Android HelpersThis class gives access to Android Intent extras.
Animation State Triggers / ListenersThese classes enable any Object to bind methods to respond to its Animator's OnStateEnter and OnStateExit events.
Camera FacingSimple component for billboarding a renderer.
CameraFollowingObjects with this component attached to them will follow the position and rotation of the main camera. It can be configured with an offset.
Dont Destroy On Load (On Enable)Simple component that calls DontDestroyOnLoad in its OnEnable.
Set Material Properties (On Enable)Simple component that sets up a MaterialPropertyBlock for a renderer in its OnEnable.
Nullable FloatA serializeable wrapper around float that exposes a float? through its Value property. It uses NaN as a sentinel for null.
ResetTransformThis component stores the state of an object's transform on awake and provides a public method for returning it to the stored position and rotation at any time.
HoverAboveA simple script that allows an object to hover over another object. Useful to have a child follow a specific position of the parent ignoring relative rotation.