Heroic Engine
  • Welcome
  • Getting Started
    • Quickstart
    • Example Games
      • Tic Tac Toe
      • Turn based duel
  • Basics
    • Injection Manager
    • Engine Systems
      • Core Systems
        • Events Manager
        • Input Manager
        • Localization Manager
          • LangText component
        • Music Player
        • Sounds Manager
        • Time Manager
        • Scenes Loader
        • Day Time Controller
        • Weather Controller
      • Gameplay Systems
        • Currencies Manager
        • Player Progression Manager
        • Quest Manager
        • Random Events Manager
        • Hittables Manager
        • Dungeon Generator
      • UI Systems
        • UI Controller
        • Countdown Controller
    • Editor Tools
      • Clear Saves
      • Mobile Build Optimizer
      • Create System
      • Icon from Prefab Generator
    • Engine Utilities
      • PoolSystem
      • DataSaver
      • ComponentExtensions
      • MaterialExtensions
      • SpriteUtils
      • SlowUpdate
      • StringUtils
      • TypeUtility
      • MathHelper
      • VectorUtils
      • TransformUtils
      • MeshUtils
    • Useful Components
      • Floating Item
      • Fly Up Text
      • Label Scaler
      • Ragdoll
      • Rotate To Camera
      • Orbital Camera
      • Rotator
      • Texture Mover
      • Hittable
      • Projectile
      • Projectile2D
      • LifetimeObject
      • Spawner
      • Colorized Particles
      • Draggable2D
      • SaveableTransform
    • Useful Attributes
Powered by GitBook
On this page
  • Parameters in inspector
  • Available methods
  1. Basics
  2. Engine Systems
  3. Core Systems

Scenes Loader

Presented by ScenesLoader class, this system assists you in work with game scenes.

To use this system, inject ScenesLoader class into your class, as shown below:

[Inject] private ScenesLoader scenesLoader;

Parameters in inspector

mainMenuSceneName – main menu scene name. Scenes Loader will load this scene in case if you call ToMainMenu() method. Default value: "MainMenuScene".

loadingLabel – TextMeshProUGUI text label on loading screen, where loading progress will be displayed.

loadingBar – Image of loading bar, which indicates scene loading progress.

minLoadingTime – minimal loading time in seconds; time delay between scenes will not be lesser than this amount. Default value: 2 seconds.

Available methods

void ToMainMenu()

This method returns user to main menu scene. Scene loading process is asynchronous.


void LoadSceneAsync(string name)

This method asynchronously loads scene with name.

Example:

scenesLoader.LoadSceneAsync("Level00");

void LoadSceneAsync(string name, Action callback)

This method asynchronously loads scene with name and invokes callback action afterwards.

Example:

scenesLoader.LoadSceneAsync(levelName, () => { uiController.ShowUIParts(UIPartType.InGameHUD); });

bool IsSceneLoading()

This method returns true if some scene is loading at the moment.


PreviousTime ManagerNextDay Time Controller

Last updated 3 months ago