How imcanida/propstealth works
Project Type and Purpose
• PropStealth is a Unity game mod/plugin that transforms the player into a prop when crouching.
• It uses the BepInEx mod loader and Harmony patching to hook into the game’s runtime.
File Structure
• Top-level solution and project (PropStealth.sln, PropStealth/PropStealth.csproj).
• libraries/ folder with external dependencies (BepInEx, Unity debugging tools).
• PropStealth/ contains subfolders:
• Config (configuration logic)
• Hooks (Harmony patches for runtime events)
• Managers (runtime managers, e.g., AssetManager)
• Models (data models for assets)
• Utils (helper classes)
• AssetsEmbedded (embedded asset bundles)
• publish.ps1 script for packaging or deployment.
README
• Confirms the sole feature: “When you crouch you turn into a prop.”
Main Components
a. External Systems
• Unity Game Engine (host application)
• BepInEx Mod Loader
• Harmony Patching Library
b. PropStealth Plugin
• Entry Point (Main.cs)
• Configuration Module (Config/AssetConfig.cs)
• Hook Module (Hooks/PlayerSetCrouch.cs)
• Asset Management (Managers/AssetManager.cs)
• Data Models (Models/AssetPrefabToLoad.cs)
• Utility Helpers (Utils/*.cs)
• Embedded Assets (AssetsEmbedded/propstealth)
c. Build & Deployment
• publish.ps1 and project files (.csproj, packages.config)
Relationships and Interactions
• On Unity startup, BepInEx Preloader loads Harmony and PropStealth plugin.
• Main.cs registers hooks via Harmony.
• When the player crouches, PlayerSetCrouch hook intercepts the event.
• Hook calls into AssetManager to select and load the correct prop prefab.
• AssetManager uses AssetConfig to determine which asset bundle to use.
• Utils classes handle JSON parsing, persistence, and Unity API calls.
• The selected prefab is instantiated via Unity’s API, replacing the player model.
Architectural Patterns
• Modular separation: Config, Hooks, Managers, Models, Utils.
• Observer/Hook pattern via Harmony for event interception.
• Asset bundle loading for dynamic content.
Technologies & Frameworks
• C#, .NET Framework (via .csproj and app.config)
• Unity Engine (runtime host)
• BepInEx (mod loader)
• Harmony (runtime method patching)