A collection of useful utilities created from various projects, designed to be used as a Unity package.
This project is available as a Unity Package, which can be installed via the Unity Package Manager.
- In Unity, go to Window > Package Manager.
- Click the
+button in the top-left corner. - Select Add package from git URL....
- Paste the following URL:
https://github.com/redd096/UnityUtilities.git?path=/Packages/com.redd096.redd096-utilities
The package will be installed in your project's Packages/com.redd096.redd096-utilities directory.
The package is organized into several main folders:
- ExamplePrefabs: Ready-to-use prefabs that can be dragged and dropped directly into your scene.
- Samples~: Samples scenes to download from package manager
- Scripts: The core C# scripts for the package's functionalities.
- Shaders: A small collection of custom shaders.
- TODO.txt: A list of planned features and improvements, primarily for the Pathfinding and SaveManager systems.
The package's main functionalities are split into several modules.
Custom Unity PropertyAttribute and helper scripts to extend and customize the Unity editor.
This module provides a system for downloading and parsing CSV files.
- Core Script: The main script is
CsvImporter.cs, which handles all core functionality. - Editor Windows:
- Access the windows from the Unity menu: Tools > redd096 > CSV Importer.
- Download CSV: Allows you to enter a URL to download a CSV file to a specified folder.
- Buttons for
DataPathandPersistentDataPathare provided for quick path selection. - The Add Element button lets you keep multiple urls and paths in memory.
- Buttons for
- CSV Reader: A window for parsing and reading a downloaded CSV file.
- Examples:
- An example script,
ExampleSimpleCsvImporterAndReader.cs, demonstrates how to useCsvImporter.cs. - You can see the results under Tools > redd096 > CSV Importer > Examples.
- The script contains three main functions: downloading a CSV, creating a
ScriptableObjectfrom a CSV, and a combined download and creation method. - Helper Functions: The
helpersare demonstrated for creating and updatingScriptableObjectandPrefabswith data from a CSV, eliminating the need for manual loops.
- An example script,
For now just a collection of helpers for the PixelCrushers Dialogue System asset.
- Note: This module requires the
PIXELCRUSHER_DIALOGUESYSTEMScripting Define Symbol to be created.
A simple utility for generating icons.
A miscellaneous collection of scripts used in various projects, including:
ScriptableObjectandControllerscripts for easily use and keep track of project files and layers.- Camera Shake.
- Save Manager.
- Sound Manager.
- Other singleton scripts.
An interface designed to provide a framework for working with various networking solutions (e.g., Fishnet, Mirror, Photon) and transports (e.g., Steam, EOS).
- Note: This module relies on several Scripting Define Symbols. Some are auto-generated when you import a specific package (e.g.,
STEAMWORKS_NETfor Steamworks orFISHNETfor Fishnet), while others are globally defined (e.g.,DISABLESTEAMWORKSfor disabling the Steamworks integration) or are custom ones you must create yourself (e.g.,PURRNETfor Purrnet).
An implementation of a GraphNode using the Unity Editor's GraphView API.
- An example of its implementation can be found in a separate project: HorrorGame on GitHub
This section contains legacy scripts that are no longer actively used or maintained, but are kept in the package for reference or backward compatibility. This folder mainly exists as an archive and as a source of ideas or code snippets that may still be useful in specific cases.
A collection of different Singleton patterns commonly used in Unity projects.
This module provides multiple implementations to cover different use cases and preferences, including:
- Singleton – Basic class with
.instancestatic variable. UsesFindObjectOfTypeto locate an existing instance in the scene if still not set, otherwise it is set inAwake. - SimpleInstance – A minimal version, providing only the
.instancestatic variable, withoutDontDestroyOnLoadand without destroying other copies in the scene. - LazySingleton – Automatically creates the singleton instance if it does not exist.
- StaticSingleton – Instead of inheriting from
Singleton, you can set an element as a singleton (.instancestatic variable andDontDestroyOnLoad) by calling a static function.
These scripts are meant to be used as base classes or helpers for creating manager-type objects (e.g. AudioManager, GameManager, SaveManager) that must exist only once in a scene or across scenes.
A generic state machine system.
- You can create serializable
IStateobjects to view states directly in the Inspector or attachIStateto aMonoBehaviourto use them asMonoBehaviourstates.
A set of scripts for controlling and optimizing Unity UI.
- Custom Button: A button with multiple target graphics (e.g. for color changes).
- Dynamic Layout: Scripts for using
ContentSizeFitterandLayoutElementwith percentages and for creating dynamicGridLayoutGrouplayouts instead of fixed cell sizes. - OptimizeEventSystem: A script that optimizes menu navigation for gamepads.
- PredictionSlider: A script for creating health bars that show predicted damage (turning red on hit) or healing (turning green).
This folder contains various components used in my previous games, including a StateMachine, Pathfinding, and various game components for both 3D and 2D top-down games.
- This also includes
PlayerControllerandPlayerPawnscripts.
An updated version of the v1 components, where MonoBehaviour is replaced with a pure C# script approach.
- Only the
Playerscript is aMonoBehaviour; all other components are pure C# scripts called by the player. - This version introduces the concept of
IGameObjectRD(the player) andIComponentRD(the game components). - The
Examplesfolder shows anExamplePlayerwith various serializableIComponentRDscripts visible in the Inspector.