<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />

Navigation

</aside>

🏠 Home Page

Getting Started

Architecture

Level System

Characters & Vehicles

Run Mechanics

World Objects

Boosters & Modifiers

Progression & Economy

UI

Save & Debugging

Modules

Publishing

Reference

💰 Monetization (Ads & IAP)

<aside> 💡 Press Play on any scene from the Scenes folder. The template boots through Init first and then jumps to the scene that was open.

</aside>

How Play works

The Core class AutoInitializerLoader changes the Play start scene while Auto Load Initializer is enabled in Core Settings:

  1. The scene that is open in the Editor is remembered.
  2. Play starts from Init, so all modules and the save system are ready.
  3. After the loading screen, the game jumps to the remembered scene.

The redirect applies only to scenes in the Scenes folder from Core Settings.

core-settings.png

Testing a level scene

A level scene has no GameController, so the start target is changed by LevelStartSceneModifier:

  1. Open a level scene, for example Level 3. Open Game next to it with the Scenes Toolbar if needed.
  2. Press Play.
  3. The game starts through Init → Game. The Levels Database finds the Level asset that owns the open scene and GameController loads that level.

The chosen level index is stored in EditorPrefs on the current machine. It does not change the save file or any asset. When no level scene is open, the override is turned off and the level saved in the player save is loaded.

When the player completes a level in the Editor, the override moves to the next level, so Continue loads the next level instead of reloading the same one.

Default level

GameController has a Level Index field with the [LevelPicker] drawer. This level is used when the save is empty and no override is active. Set it to the level that must start first in a new game.

game-controller.png

Restoring the state after tests

Play tests change the saved selected level, the unlocked levels and the currency balance.

Add a custom start scene rule

Implement IStartSceneModifier in any Editor assembly to change the Play start scene. Implementations are found automatically and run in ascending Priority order after the default Init redirect.

namespace Watermelon
{
    public class MyStartSceneModifier : IStartSceneModifier
    {
        public int Priority => 10;

        public void Modify(StartSceneContext context)
        {
            // Change context.TargetBuildIndex to start from another scene
        }
    }
}