Skip to content

oleghcp/UnityTools

Repository files navigation

Social Tweet

Unity Discussions Topic.

About

The package is a set of C# utility code stuff for projects based on Unity Engine.
It works with Unity 2019.4 and newer.

Usage

For using the library as a unity package add the next line to dependencies in \Packages\manifest.json:

"com.oleghcp.unitytools": "https://github.com/oleghcp/UnityTools.git",

Also it can be downloaded manually from github and placed into the assets folder.

Mind that it uses assembly definitions.

Code Overview

Runtime Code

  • Base stuff. Common tools: ApplicationUtility, BitMask, RandomNumberGenerator, CameraFitter, etc.
  • Coroutine running. Allows to run coroutines in non-MonoBehaviour classes.
  • Collections. Some specific collections.
  • .Net Extensions. Extensions for base .Net api stuff (arrays, collections, strings, etc).
  • Unity Extensions. Extensions for base Unity api stuff (game objects, transforms, vectors, etc).
  • Terminal. Simple in-game console for commands and messages.
  • Inspector. Attribute classes for Unity inspector.
  • Input/Output. A few classes for work with files and paths.
  • Mathematics. Math tools and structs.
  • Graph editor. Tool for creating graphs based on linked nodes. Useful for creating dialogues.
  • Numeric entities. Structs and classes for work with numeric parameters like ranges or character stats.
  • Path finding. Simple implementation of A* pathfinding or something that pretends to be A*.
  • ObjectPool. ObjectPool implementation.
  • SignalBus. SignalBus implementation.
  • ServiceLocator. ServiceLocator implementation.
  • PostProcessing. Fog effect for the built-in render pipeline
  • Randomization. Custom random number generators.
  • Game saving. Save/load system.
  • Projectiles. Projectile implementation.
  • Singletons. Singletons based on MonoBehaviour and ScriptableObject.
  • Strings. Alphanumeric sorting.
  • Timer. Simple timer.
  • Tools. Couple of tool classes.

Editor Code

  • Editor classes. Editor and gui utilities.
  • Extensions. Extensions for base unity editor stuff.
  • Enum generator. Code generating for creating enums. Useful for generating enums based on serialized assets.
  • Node drawer. Custom node drawing for the graph editor.

Editor Stuff Overview

Preferences

Base Menu

Menu Item Description
Tools/OlegHcp/Addressables/Analysis Results Converts analysis results from bundle-duplicates to duplicate-bundles.
Tools/OlegHcp/Assets/Create Scriptable Object Asset Allows to create assets based on ScriptableObject without CreateAssetMenuAttribute.
Tools/OlegHcp/Assets/Find Asset By Guid Asset searching by guid.
Tools/OlegHcp/Assets/Meshes/ Creates simple mesh assets using mesh generating.
Tools/OlegHcp/CaptureScreen/ Creates screenshots and saves them to a file.
Tools/OlegHcp/Code/Generate Layer Set Class Allows to generate static class with layer and mask constants.
Tools/OlegHcp/Files/Convert Code Files to UTF8 Converts project code files to UTF8 including shaders.
Tools/OlegHcp/Files/Convert Text Files to UTF8 Converts all text files to UTF8 including code files.
Tools/OlegHcp/Files/Find Huge Files Searches files by given size.
Tools/OlegHcp/Folders/Open Project Folder Opens folder where the project is located.
Tools/OlegHcp/Folders/Open Persistent Data Folder Opens folder which is located at Application.persistentDataPath.
Tools/OlegHcp/Folders/Remove Empty Folders Removes empty folders within Assets folder.
Tools/OlegHcp/Misc/Generate GUID Generates new GUID and outputs it to the console.
Tools/OlegHcp/Misc/Create csc.rsp Creates csc.rsp file with precreated compiler arguments.

Custom Transform Editor

Has quick reset buttons and can be switched between local and world view.
Has indicators of tool handles if they are switched to center and global value. Transform parameters can be copied to the clipboard as json string.

Custom MeshRenderer Editor

Custom AnimationClip Editor

Asset Context Menu

  • Order Children. Sorts siblings by name.

  • Create Script From Template. Template can be modified: \your_project\UserSettings\Templates\C#ScriptTemplate.cs.txt.

  • Show Asset Guid

  • Find References In Project. The search via text also finds addressable references.

  • Create Asset Based On ScriptableObject

  • Destroy Subasset

License

This package is released under the MIT license.


I hope my humble package becomes a useful tool for your game development work and makes it more convenient.