This repository contains a Unity project plus the package source at Packages/com.macmat01.weighted-draw-system.
The package is a game-agnostic, UPM-friendly framework for:
- editor-time CSV compilation
- generic row deserialization
- weighted random selection
- custom game-state condition evaluation
- sample-driven usage instead of hardcoding one specific game schema
Some legacy code is preserved under _Old for migration support and is explicitly marked deprecated.
If you are using the package as a consumer, start with the package-level documentation:
Packages/com.macmat01.weighted-draw-system/README.md
That document explains:
- end-to-end flow from CSV file to runtime weighted draw
- editor lifecycle (
OnValidate, column sync, compile) - a practical tutorial for creating your own row type and authoring asset
- runtime usage patterns with
WeightedDrawEngine<TEntry, TContext> - migration differences between current APIs and deprecated
_OldAPIs
Current package areas:
Packages/com.macmat01.weighted-draw-system/RuntimePackages/com.macmat01.weighted-draw-system/EditorPackages/com.macmat01.weighted-draw-system/TestsPackages/com.macmat01.weighted-draw-system/_Old
The package is meant for systems such as:
- loot tables
- dialogue/event cards
- encounter tables
- shop inventories
- any other weighted CSV-driven system
The event-card sample shows how to model your own schema while keeping the framework generic.
Use the package path URL:
https://github.com/MacMat01/weighted-draw-system.git?path=/Packages/com.macmat01.weighted-draw-system
If you want a specific revision, append #branch, #tag, or #commit.
Keep the package in this repository at:
Packages/com.macmat01.weighted-draw-system
Edit Mode tests live under:
Packages/com.macmat01.weighted-draw-system/Tests/EditMode
They cover:
- CSV parsing
- weighted selection
- condition evaluation
- editor-time authoring and compilation
See LICENSE.