How hisacat/unity-numbercountershader works
Project type and purpose
• This is an open-source Unity “Number Counter Shader” package. It provides a lightweight, optimized shader for rendering multi-digit counters in Unity scenes or Particle Systems. It also includes an Editor extension (com.vrchat.core.vpm-resolver) to streamline package import via VCC.
File structure
Top-level directories and key components:
• Assets/
• HisaCat/NumberCounterShader – Sample Scene and placeholder files.
• Packages/
• cat.hisa.number-counter-shader/Runtime – Core assets: Shaders, .cginc logic, Materials, Prefabs, Fonts, Sample Scene, asmdef, package.json.
• com.vrchat.core.vpm-resolver/Editor – Editor UI for packaging/resolving with dependencies.
• manifest.json & packages-lock.json – Unity Package Manager configuration.
• ProjectSettings/ – Unity project configuration.
• Website/ – Static site for documentation (HTML, CSS, JS).
README insights
• Core logic in NumberCounter.cginc.
• Usage: apply provided Materials/Shaders on a Quad in your scene.
• Extensibility: custom font textures (via provided PSD).
• Packaging: VCC-based import; no runtime dependencies beyond Unity.
Main components
a. Unity Host Environment
• Unity Editor (Package Manager, Inspector, Scene View)
• Unity Runtime (player/GPU)
b. cat.hisa.number-counter-shader Package
• Shader Module (NumberCounterUnlit*.shader & .cginc logic)
• Materials & Prefabs (preconfigured assets)
• Font Textures (default + custom PSD template)
• Sample Scene (Assets/HisaCat/Main Scene & Packages/.../Sample Scene)
c. Editor Extension
• com.vrchat.core.vpm-resolver (PackageMakerWindow, ResolverWindow)
• Dependencies (YamlDotNet, Serilog, SemanticVersioning)
d. External Services
• GitHub (Source, Releases, Issues)
• BuyMeACoffee (support link)
• VCC website for import
Relationships & interactions
• Unity Editor ↔ Package Manager ↔ cat.hisa.number-counter-shader (import/resolve)
• Unity Editor → com.vrchat.core.vpm-resolver (UI windows to package/make .tgz)
• Runtime Shader Module → GPU (compiled HLSL/CG) → renders quad digits
• Materials/Prefabs reference Shader Module and Font Textures
• Website files (index.html, app.js) served to end-user for documentation
Architectural patterns & principles
• Modular Package Design (separation of Runtime vs. Editor code via asmdef files)
• MVC-style separation:
• View = Sample Scene + Prefab + Material
• Model = Shader parameters (Value, DisplayLength)
• Controller = Unity Inspector & Scripts (none custom, uses Shader properties)
• Extensibility: PSD template for custom fonts, custom shaders via .cginc include