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
  • 🎛️ Root Menus
  • 🐾 New‑Player Flow
  • 🧾 Gameplay HUD
  • 🐶 Pet Model
  • 📂 In‑Game Menus
  • 🏠 Scenario Configuration
  1. Getting Started

🗺️ UI Main Menu

UIMainMenu – Component Overview

The UIMainMenu component controls all logic related to the main menu interface, pet selection, scene switching, and HUD in the Virtual Pet Game Template. This page provides a summarized explanation of its key editable public variables and how to configure or expand them.


🎛️ Root Menus

  • uiNewPlayer: Shown when no nickname/pet is registered yet.

  • uiGame: Main gameplay UI shown after account creation.

🐾 New‑Player Flow

  • startMenu / selectMenu: Panels for nickname input and pet selection.

  • startGameBtn: Button to confirm nickname and go to pet selection.

  • nicknameInput: Text field for the player’s nickname.

  • petEntryPrefab: Prefab used to display each available pet.

  • petEntryContainer: UI container to hold all pet entries.

  • confirmBtn: Confirms nickname and pet selection to start the game.

🧾 Gameplay HUD

  • petNickname: Displays the pet’s nickname.

  • level: Displays the player's current level.

  • levelProgress: Fillable image for level EXP progress.

  • fillTweenDuration: Duration of the EXP fill animation.

🐶 Pet Model

  • petModelContainer: Where the selected pet is instantiated.

📂 In‑Game Menus

Each menu object below can be assigned and then called via OpenMenu(string id):

  • uiFridge

  • uiFoodShop

  • uiSettings

  • uiCloset

  • uiClothesShop

  • uiBed

  • uiMinigames

To add new menus:

  1. Create a new GameObject panel in the UI.

  2. Add it as a public variable in this script.

  3. Register it in the menuMap dictionary inside Awake().

  4. Call it using OpenMenu("your_id").

🏠 Scenario Configuration

  • nextSceneBtn / prevSceneBtn: Buttons to navigate between available scenes.

  • sceneNameLabel: Displays the current scene name (localized).

  • scenes: List of available scenario entries. Each contains:

    • sceneId: Unique identifier

    • sceneName: Translatable label

    • sceneBackgroundObj: Prefab for background

    • sceneOptions: Optional prefab with interactive props

  • sceneBgContainer: Where the background is instantiated.

  • sceneOptionContainer: Where scene props/options are instantiated.

✅ To add a new scene:

  1. Create a new GameScene entry in the scenes list.

  2. Assign a unique sceneId, background prefab, and optionally an options prefab.

  3. Add a sceneName translation using the LanguageManager.


This component is essential for initializing gameplay, managing navigation, and controlling the overall user experience from the home screen.

Previous🧩 Home Scene OverviewNext🗺️ LoadingManager

Last updated 28 days ago