๐Ÿ—บ๏ธ ToolsManager

ToolsManager โ€“ Component Overview

The ToolsManager handles the pet cleaning and feeding tools in the Virtual Pet Game Template. It controls the cleaning sequence (soap โ†’ sponge โ†’ shower), displays progress bars, triggers visual effects, and updates pet visuals accordingly.

๐Ÿงผ What It Does

  • Manages pet cleaning phases: Soap, Sponge, Shower

  • Spawns and destroys tools

  • Updates hygiene stat and rewards EXP upon completion

  • Controls visual feedback on pet (foam, dirt levels)

  • Displays sliders for tool progress


๐Ÿ”ง Editable Inspector Fields

Containers

  • toolContainer โ€“ UI container where tools are spawned.

  • vfxContainer โ€“ World-space container for particle effects.

  • ActionZone โ€“ Rect defining the interaction zone for tools.

Progress Bars

  • soapBar, spongeBar, showerBar โ€“ Sliders showing cleaning progress for each phase.

EXP Settings

  • expWhenComplete โ€“ Amount of EXP granted when all cleaning steps are finished.

Feedback Objects

  • soapStepVfxObj โ€“ Activated when soap step is completed.

  • spongeStepVfxObj โ€“ Activated when sponge step is completed.

  • finalVfxObj โ€“ Activated when shower step is completed.

Audio

  • stepCompleteSfx โ€“ Sound played when a cleaning step is finished.

  • finalCompleteSfx โ€“ Sound played when cleaning is fully completed.


๐Ÿ› ๏ธ CleaningToolController

The CleaningToolController component is used on each tool prefab. It defines:

  • The tool's type (Soap, Sponge, or Shower)

  • When and how it adds progress to the ToolsManager

  • Whether VFX should spawn only inside a defined action zone

๐Ÿ“Œ Tools are assigned to prefabs and spawned via ToolsManager.SpawnTool().

The FoodToolController handles pet feeding logic:

  • Spawns VFX while dragging food

  • Detects collision with the pet model

  • Increases pet hunger stat and plays feedback effects


Cleaning Flow Summary

  1. Player selects a tool (via ToolsManager.SpawnTool())

  2. Progress is added using AddProgress(CleaningToolType, delta)

  3. Each step completes when the progress reaches 100%

  4. Final step rewards EXP and updates hygiene stat


This component works tightly with PetModel, CleaningToolController, and UI elements to deliver interactive pet cleaning gameplay.

Last updated