๐บ๏ธ 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
, orShower
)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()
.
๐ FoodToolController (Not used in this script but related)
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
Player selects a tool (via
ToolsManager.SpawnTool()
)Progress is added using
AddProgress(CleaningToolType, delta)
Each step completes when the progress reaches 100%
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