Virtual Pet Game Template
  • VIRTUAL PET GAME TEMPLATE
  • Getting Started
    • ๐ŸŽฏ Project Setup Guide
    • ๐Ÿงฉ Home Scene Overview
    • ๐Ÿ—บ๏ธ UI Main Menu
    • ๐Ÿ—บ๏ธ LoadingManager
    • ๐Ÿ—บ๏ธ GameInstance
    • ๐Ÿ—บ๏ธ ToolsManager
    • ๐Ÿ—บ๏ธ AudioManager
    • ๐Ÿ—บ๏ธ LanguageManager
    • ๐Ÿ—บ๏ธ MonetizationManager
    • ๐Ÿ—บ๏ธ PlayerSave
  • Modifying the project
    • ๐Ÿพ How to Add a New Pet
    • ๐Ÿ“œHow Add a New Pet Rules
    • ๐Ÿ’ฐ How to Add a New Currency
    • ๐ŸŽ How to Add a New Food Item
    • ๐Ÿงข Adding a New Accessory
    • ๐ŸŽฎ How to Add a New Minigame
  • Modifying Minigames
    • ๐ŸŒค๏ธ Minigame "Jump Sky"
    • ๐Ÿ” Minigame "Food Flicker"
    • ๐Ÿฆ Minigame โ€œFlappyโ€
    • ๐Ÿ’Ž Minigame โ€œGem Hunterโ€
Powered by GitBook
On this page
  • ๐Ÿงผ What It Does
  • ๐Ÿ”ง Editable Inspector Fields
  • ๐Ÿ› ๏ธ CleaningToolController
  • ๐Ÿ– FoodToolController (Not used in this script but related)
  • Cleaning Flow Summary
  1. Getting Started

๐Ÿ—บ๏ธ 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().

๐Ÿ– 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

  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.

Previous๐Ÿ—บ๏ธ GameInstanceNext๐Ÿ—บ๏ธ AudioManager

Last updated 28 days ago