A Unity package that implements various common game development functionality such as:
- Game Files: for reading and writing persistent data to the disk
- Object Pools: for reusing frequently created/destroyed objects such as projectiles
- UGUI Components: for creating tab groups, panel groups, and confirmation winds
- Misc. Extension Methods: for implementing shorthand functions for common behavior
- Lookup Table: for finding assets/objects through a string key lookup
- Time Manager: for pausing functionality that maintains a non-one timescale override
- Clamped Data Types: for defining a numeric value that is always constrained between a min and max value
- A Unity project of 2021.2 or later
- Earlier unity releases are not officially supported by this package
- Install the package via Git in the Package Manager
- Ensure you have Git installed and your Unity Version supports Git package manager imports (2019+)
- In Unity go to
Window -> Package Manager
- Press the + icon at the top left of the Package Manager window
- Choose "Add package from Git URL"
- Enter the following into the field and press enter:
- Tip: You can append a version to the end of the Git URL to lock it to a specific version such as
https://github.com/Orange-Panda/Unity-Utilities.git#v1.8.0
- Tip: You can append a version to the end of the Git URL to lock it to a specific version such as
https://github.com/Orange-Panda/Unity-Utilities.git
List.InBounds
andArray.InBounds
to check for valid indecies.- Color:
MoveTowards
andMoveTowardsAlpha
for moving values of a color by a distance delta - Color:
SetRGB
,SetA
for copying specific values from one color to another int.LayerMaskContains
to check if a mask contains a particular layerVector2.Rotate
for rotating a vector about the Z axis
Reuse frequently instantiated and destroyed objects
- Attach a
Poolable
component to a prefab - Use
ObjectPool.Instantiate
to instantiate a pooled object - Use
Poolable.Return
in place ofDestroy
to disable a object for recycling in a future instantiation - Implement
Poolable.OnReturn
orPoolable.OnRetrieve
to reset variables when recycling- Optional: Add
PoolableReturnAfterDelay
to automatically return objects after some amount of time
- Optional: Add
- Action Emitter: Handle functional UI actions such as
Press Y to reset settings
orPress X to inspect item
- Aspect Ratio Calculator: Automatically update
AspectRatioFitter
values. - Auto Scroll: Automatically update a scroll rect when a new object is selected.
- Confirmation Windows: Prompt user to accept/decline an action
- Overlays: Handle full screen ui elements that the user is expected to input for
- UI Groups: Control a mutually exclusive list of ui elements such as:
- Tab UI Groups: Ordered list of ui elements to cycle through via previous and next inputs
- Panel UI Groups: Hierarchy list of ui elements that can be traversed upwards to parent panels
- Use the Issues or Discussions of this GitHub repository for support.
This package is developed by Luke Mirman.