Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/legendary-tools-common.git

README Markdown

Copy this to your project's README.md

Style
Preview
pkglnk installs badge
## Installation

Add **Legendary Tools - Common** to your Unity project via Package Manager:

1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/legendary-tools-common.git
```

[![pkglnk](https://www.pkglnk.dev/badge/legendary-tools-common.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/legendary-tools-common)

Dependencies (5)

README

๐Ÿ“š Legendary Tools Library Overview

This library provides a collection of utilities, data structures, patterns, and editor tools for Unity development. Below is a categorized breakdown of key classes/interfaces, with descriptions of their utility. ๐Ÿš€

๐Ÿ”„ Concurrency and Asynchronous Utilities

  • AsyncWait ๐Ÿ”„:
    Provides asynchronous waiting methods (e.g., ForSeconds, ForFrames, Until, While) with support for multiple backends like Unity Coroutines, UniTask, or native Tasks. Useful for non-blocking delays or condition-based waiting in games, reducing coroutine clutter and improving performance in async-heavy code.

  • ThreadedRoutine ๐Ÿงต:
    Manages routines that can run on background threads, with integration for Unity's main thread synchronization. Ideal for offloading CPU-intensive tasks (e.g., computations) without freezing the game loop, while ensuring safe Unity API calls.

๐Ÿ“Š Data Structures and Algorithms

  • AStar ๐Ÿ—บ๏ธ:
    Implements the A* pathfinding algorithm for grid-based or graph-based navigation. Useful for AI pathfinding in games (e.g., finding shortest paths in maps), with customizable heuristics for efficiency.

  • Bictionary ๐Ÿ”„:
    A bidirectional dictionary (two-way mapping between keys and values). Handy for scenarios like entity-ID lookups or reversible mappings, saving time on manual inversion.

  • CircularBuffer ๐Ÿ”„:
    A fixed-size buffer that overwrites old data in a circular fashion. Great for logging, history tracking, or fixed-window data (e.g., recent player inputs) without resizing overhead.

  • Tree ๐ŸŒณ:
    A generic tree structure for hierarchical data. Useful for scene hierarchies, decision trees, or organizational structures in games.

  • SelfBalanceTree โš–๏ธ:
    An AVL-like self-balancing binary search tree. Ensures O(log n) operations for sorted data, ideal for dynamic datasets like leaderboards or sorted inventories.

  • MultiParentTree ๐ŸŒฟ:
    A tree allowing nodes with multiple parents (Directed Acyclic Graph-like). Useful for complex relationships, such as skill trees with shared prerequisites.

  • Graph ๐Ÿ“ˆ:
    A generic graph structure with nodes and connections, supporting directed/undirected edges. Core for modeling networks, state machines, or procedural generation (e.g., dungeon layouts).

  • BinaryTree ๐ŸŒฟ:
    A basic binary tree for ordered data. Suitable for binary search or simple hierarchical storage, like expression trees.

  • Hex ๐Ÿ”ท:
    Utilities for hexagonal grid systems (e.g., coordinates, neighbors). Essential for hex-based games like strategy titles, handling movement and adjacency efficiently.

  • Inventory ๐ŸŽ’:
    A generic inventory system for managing items with stacks, slots, and events. Useful for RPGs or crafting systems to handle item addition/removal without boilerplate.

  • ScriptableObjectInventory ๐Ÿ“œ:
    An inventory backed by ScriptableObjects for data-driven design. Integrates with Unity's asset system for easy editing and persistence of inventories.

  • ManyToManyMap ๐Ÿ”—:
    Maps multiple keys to multiple values (e.g., tags to objects). Perfect for tagging systems or relational data without databases.

  • MappedList ๐Ÿ“‹:
    A list with fast lookup via a dictionary map. Combines list ordering with O(1) access, useful for indexed collections like UI elements.

  • MovingAverage ๐Ÿ“‰:
    Computes rolling averages over a window of values. Handy for smoothing data like FPS counters or sensor inputs.

  • NestedType ๐Ÿช†:
    Represents a type with nested subtypes. Useful for reflection-heavy code, like dynamic UI generation from complex types.

  • NestedTypes ๐Ÿช†:
    Collection of nested types for a parent type. Aids in editor tools or runtime type discovery for modular systems.

  • Observable ๐Ÿ‘€:
    Implements the observer pattern for event-driven updates. Useful for decoupling components (e.g., notifying UI of data changes).

  • Octree ๐ŸŒ:
    3D spatial partitioning for efficient queries (e.g., collision detection). Optimizes performance in large 3D scenes by reducing checks.

  • OneToManyMap ๐Ÿ”—:
    Maps one key to multiple values. Ideal for grouping (e.g., players by team) with fast lookups.

  • OneToOneMap ๐Ÿ”—:
    Strict one-to-one mapping enforcing uniqueness. Useful for pairings like input-action bindings.

  • PriorityQueue โฐ:
    A heap-based queue for priority-ordered elements. Essential for task scheduling or AI decision-making.

  • QuadTree ๐ŸŸฉ:
    2D spatial partitioning for queries (e.g., visibility culling). Improves efficiency in 2D games with many objects.

  • SerializableType ๐Ÿ“ฆ:
    Serializes System.Type for Unity storage. Allows saving type references in ScriptableObjects or scenes.

  • SerializedDateTime โฑ๏ธ:
    Serializable wrapper for DateTime. Useful for saving timestamps in player data or logs.

  • SerializedTimeSpan โณ:
    Serializable wrapper for TimeSpan. Handy for durations in configs or save files.

๐Ÿ›ก๏ธ Design Patterns and Core Utilities

  • Pool โ™ป๏ธ:
    Object pooling system for reusing instances (e.g., bullets, enemies). Reduces garbage collection and instantiation overhead in performance-critical games.

  • ServiceLocator ๐Ÿ“:
    Global access point for services (e.g., audio manager). Simplifies dependency injection without full DI frameworks.

  • Singleton ๐Ÿ”’:
    Ensures a single instance of a class (e.g., game manager). Classic pattern for global state, with Unity-specific handling for persistence.

  • HardStateMachine โš™๏ธ:
    A rigid, enum-based state machine for finite states (e.g., player states like idle/jump). Simple and efficient for basic FSM needs.

  • AdvancedStateMachine โš™๏ธ:
    Hierarchical state machine with sub-states and transitions. Useful for complex AI or UI flows with nested behaviors.

  • Persistence ๐Ÿ’พ:
    Handles saving/loading data (e.g., player prefs, files). Abstracts storage for cross-platform persistence.

  • SOVariable ๐Ÿ“œ:
    ScriptableObject-based variables for decoupled data (e.g., health). Enables runtime changes and event-driven updates.

  • SOEvent ๐Ÿ“œ:
    ScriptableObject events for broadcasting without direct references. Promotes loose coupling in event systems.

  • ScriptableObjectVariant ๐Ÿ“œ:
    Variants of ScriptableObjects with overrides. Useful for inheritance-like customization without subclassing.

  • Tag ๐Ÿท๏ธ:
    Custom tagging system beyond Unity's built-in tags. Allows multi-tagging for flexible querying.

๐ŸŽฎ Unity-Specific Utilities

  • DictionaryConfigEnumWeaver ๐Ÿ”—:
    Generates enums from ScriptableObject configs and weaves dictionaries. Automates mapping for data-driven enums (e.g., items).

  • DictionaryConfigNamesWeaver ๐Ÿ”—:
    Weaves string constants from config names. Ensures compile-time safety for referencing configs.

  • DebugFilterConfig ๐Ÿž:
    Configures debug logging levels per type. Filters logs to reduce noise in large projects.

  • Debugger ๐Ÿž:
    Custom logging with filtering and formatting. Enhances Unity's Debug with type-based control.

  • FollowTransform ๐Ÿ‘ฃ:
    Smoothly follows a target's position/rotation. Useful for cameras or UI elements tracking objects.

  • ProximityDetector ๐Ÿ“ก:
    Detects overlapping actors via triggers/colliders. Base for proximity-based interactions (e.g., NPC detection).

  • VisibilityDetector ๐Ÿ‘๏ธ:
    Checks if objects are visible in the viewport. Optimizes rendering or logic for on-screen elements.

  • UniqueBehaviour ๐Ÿ”’:
    Ensures unique MonoBehaviours in scenes (e.g., singletons). Validates duplicates in editor/playmode.

  • UniqueScriptableObject ๐Ÿ“œ:
    Ensures unique ScriptableObjects across assets. Prevents ID conflicts in data-driven systems.

  • UnityHub ๐ŸŒ:
    Central hub for Unity events (Update, FixedUpdate). Simplifies global event subscription.

  • ColorUtil ๐ŸŽจ:
    Color manipulation helpers (e.g., lerp, conversions). Useful for procedural colors or UI themes.

  • CurveUtil ๐Ÿ“ˆ:
    AnimationCurve utilities (e.g., evaluation, editing). Aids in tweening or procedural animations.

  • FlagUtil ๐Ÿšฉ:
    Bitwise flag operations for enums. Simplifies managing flag-based states (e.g., permissions).

  • HSV ๐ŸŽจ:
    HSV color model helpers. Easier for color adjustments than RGB (e.g., hue shifts).

  • MathUtil โž—:
    Extended math functions (e.g., clamping, remapping). Fills gaps in Unity's Mathf for common ops.

  • MeshUtil ๐Ÿ•ธ๏ธ:
    Mesh generation/manipulation tools. Useful for procedural meshes (e.g., dynamic terrain).

  • Security ๐Ÿ”:
    Basic encryption/decryption for data. Protects save files or assets from tampering.

๐Ÿ› ๏ธ Editor Tools and Windows

  • AssetGuidMapper ๐Ÿ—‚๏ธ:
    Maps and tracks GUIDs in project files. Helps with asset refactoring or merge conflicts.

  • AssetNavigatorWindow ๐Ÿงญ:
    Editor window for browsing/searching assets. Speeds up asset management in large projects.

  • AssetUsageFinder ๐Ÿ”:
    Finds usages of assets in scenes/prefabs. Essential for cleanup or dependency analysis.

  • CommandGenerator โšก:
    Generates command classes/patterns. Automates undoable actions or input handling.

  • CopySerializedValuesWindow ๐Ÿ“‹:
    Copies serialized data between objects. Useful for duplicating component setups.

  • MonoBehaviourToScriptableObjectConverter ๐Ÿ”„:
    Converts MonoBehaviours to ScriptableObjects. Migrates behavior to data-driven assets.

  • UIComponentFieldGenerator ๐Ÿ–ผ๏ธ:
    Auto-generates fields for UI components. Saves time in UI scripting.

  • ScriptInSceneAnalyzer ๐Ÿ”:
    Analyzes scripts used in scenes. Helps identify unused code or dependencies.

  • DefineSymbolsEditor โš™๏ธ:
    Manages scripting define symbols. Toggles features/platforms in editor.

  • GUIStyleBrowser ๐ŸŽจ:
    Browses and previews GUIStyles. Aids in custom editor UI design.

  • NestedTypesEditor ๐Ÿช†:
    Editor for handling nested types. Simplifies inspection of complex data.

  • VisualGraphEditorWindow ๐Ÿ“Š:
    Visual editor for graphs (nodes/edges). Useful for designing state machines or dialogs.

  • PlayerPrefsEditor ๐Ÿ’พ:
    Editor for viewing/editing PlayerPrefs. Debugs persistent data easily.

  • PlayModeStarterFromScene0 โ–ถ๏ธ:
    Starts playmode from scene 0. Automates testing workflows.

  • InlineEditorDrawer ๐Ÿ–ผ๏ธ:
    Draws inline editors for properties. Enhances inspector usability.

  • MinMaxSliderDrawer ๐Ÿ“:
    Custom drawer for min-max sliders. Improves range editing in inspectors.

  • MultiLevelEnumDrawer ๐Ÿ“Š:
    Drawer for nested/multi-level enums. Handles complex enum hierarchies.

  • SerializableDictionaryDrawer ๐Ÿ“–:
    Inspector drawer for serializable dictionaries. Makes dicts editable in Unity.

  • SerializableTypeDrawer ๐Ÿ“ฆ:
    Drawer for SerializableType. Visualizes type references.

  • SerializedDateTimeDrawer โฑ๏ธ:
    Drawer for SerializedDateTime. User-friendly date editing.

  • SerializedTimeSpanDrawer โณ:
    Drawer for SerializedTimeSpan. Edits durations intuitively.

  • UniqueBehaviourReferenceDrawer ๐Ÿ”’:
    Drawer for referencing UniqueBehaviours. Ensures unique selections.

  • MultiScriptableObjectEditor ๐Ÿ“œ:
    Edits multiple ScriptableObjects at once. Batch editing for configs.

  • ScriptableObjectBrowser ๐Ÿ”:
    Browses ScriptableObjects in editor. Quick access to assets.

  • SpreadsheetImporterWindow ๐Ÿ“‘:
    Imports data from spreadsheets (e.g., CSV/Excel). Data-driven content population.

  • RenderingPerformanceHubWindow ๐Ÿ“Š:
    Monitors rendering performance. Profiles draw calls, batches, etc.

  • StatePersisterEditor ๐Ÿ’พ:
    Persists state machine data in editor. Saves/loads FSM configurations.

  • FieldSyncEditor ๐Ÿ”„:
    Syncs fields between objects in editor. Automates data alignment.

  • SceneUiObjectsTagger ๐Ÿท๏ธ:
    Tags UI objects in scenes. Organizes canvas elements for querying.

๐ŸŽญ Actor System

  • Actor ๐ŸŽญ:
    Base for actor-model entities (message-passing concurrency). Decouples systems for scalable, thread-safe logic.

  • ActorMonoBehaviour ๐ŸŽญ:
    MonoBehaviour wrapper for Actors. Integrates actor pattern with Unity's component system.

โš™๏ธ Attribute System

  • AttributeConfig โš™๏ธ:
    Config for attributes (e.g., health, speed). Data-driven entity stats.

  • Attribute โš™๏ธ:
    Runtime attribute with modifiers. Handles buffs/debuffs for RPG entities.

  • Entity ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘:
    Base entity with attributes. Core for character/NPC systems.

๐ŸŽต Bragi Audio System

  • Bragi ๐Ÿ“œ: High-level audio hub with pooling that spawns AudioHandlers and plays AudioConfig or AudioGroup at a position/parent, including simultaneous, sequential, or chained modes.

  • AudioHandler ๐Ÿ”Š: Component that owns an AudioSource, applies AudioSettings, exposes IsPlaying/IsPaused/IsMuted, fade in/out, events (OnPlay, OnFinished, OnStop), and returns itself to the pool on dispose.

  • Jukebox (+ JukeboxConfig) ๐ŸŽถ: Playlist player with sequential/random/random-reseeding and loop/circular options; commands (Next/Prev/Mute/Unmute/Pause/Stop) and automatic continuation when a handler finishes.

  • UIAudioTrigger ๐Ÿ”Š: Drop-in component to bind UI/Unity events (pointer, select, drag, lifecycle, or custom string) to AudioConfig plays, with an option to prevent parallel plays.

๐Ÿ”ง Miscellaneous Systems

  • Chronos โณ:
    Time management system (e.g., timers, scheduling). Useful for cooldowns or timed events.

๐ŸŽผ Maestro System (Initialization and Task Management)

  • GameInitialization ๐Ÿš€:
    Manages game startup with sequenced init steps. Ensures orderly loading (e.g., assets before UI).

  • InitStepConfig โš™๏ธ:
    Configurable init task with dependencies/timeouts. Modularizes startup logic.

  • Maestro ๐ŸŽผ:
    Orchestrates tasks with dependencies, timeouts, and internet checks. Handles async initialization graphs.

๐Ÿ–ฅ๏ธ Screen Flow System (UI Navigation)

  • ScreenConfig ๐Ÿ–ผ๏ธ:
    Config for screens/popups with transitions. Defines navigation rules.

  • ScreenFlow ๐Ÿ”„:
    Manages screen transitions, history, and popups. Simplifies app-like navigation in Unity.

๐Ÿ–ผ๏ธ UI Components

  • CircularScrollView ๐Ÿ”„:
    Infinite circular scrolling UI. Ideal for carousels or looping lists.

  • DynamicScrollView ๐Ÿ“œ:
    Scroll view with dynamic item population. Optimizes large lists (e.g., inventories).

  • FieldSync ๐Ÿ”„:
    Syncs fields between components/objects. Automates data binding.

  • GameObjectListing ๐Ÿ“‹:
    Lists GameObjects (e.g., in UI). Useful for dynamic menus or debug panels.

  • ProximityUiBehaviour ๐Ÿ“ก:
    Displays UI based on proximity (e.g., interaction prompts). Enhances immersive interactions.

  • UIFollowTransform ๐Ÿ‘ฃ:
    UI element follows a 3D transform. For world-space UI like health bars.

  • UIGradient ๐ŸŒˆ:
    Applies gradients to UI elements. Enhances visual appeal without shaders.

  • UILineConnector ๐Ÿ”—:
    Draws lines between UI points. Useful for graphs or connections in menus.

  • UISafeArea ๐Ÿ“ฑ:
    Adjusts UI for device safe areas (e.g., notches). Ensures compatibility on mobile.

Comments

No comments yet. Be the first!