Loading Scene

Overview

Initializing SDKs and loading dynamic data in a Loading Scene is mandatory before entering your main game scene. This helps separate initialization code from game code and prevents race conditions by ensuring all SDK dependencies are loaded before the game code attempts to call or reference those services.

LionSDK provides a loading scene that you can use out-of-the-box.

Features:

  • Display the new animated logo of LionStudios (optional)
  • Display the logo of the developing studio (optional)
  • Initialize all SDKs

Example



Installation

Implementation

  1. Open the LionStudios/Settings Manager/Loading Scene
  2. Click Setup Loading Scene
  1. A scene will be automatically added at index 0 in your Build Settings
  1. Once everything is initialized, it will automatically load the scene at index 1

Settings

  • Use Second Logo - This menu option enables/disables showing your company logo on the splash screen.

Example of a second logo

  • Second Logo Length - The second logo features a fade-in effect. This variable determines how fast or slow the image takes to fade in. By default, this is set to 1.5. (The larger the number, the slower the animation is).
  • Second Logo - Insert your sprite image here to display your company logo. The recommended dimensions for the image are 512 x 512.
  • Force Load After Timeout - The Lion splash screen waits until all classes using the ILionSDK interface are finished initializing before loading the next screen (More info in Add custom initialization code section below). If an issue occurs or an SDK takes too long to initialize, this option moves the game to the next screen regardless of whether all initialization of third-party SDKs is done (Initialization of these ILionSDK classes will still continue).
  • Force Load Timeout - This variable determines how long the splash screen will wait before loading the next scene if the “Force Load After Timeout” option is enabled.
  • Use Async Loading - Depending on the type of data in your main game scene, the loading time may be better with or without async loading. You can test on the device to see what works better in your case.
  • Disable Lion Logo - Enable this if the game is still in Soft Launch and not in Lion Studios account

Add custom initialization code

If you want to add additional initialization code to this Loading Scene, you have to implement the ILionModule interface.

The ILionModule interface is a part of the Lion Studios Core package.

Classes implementing this interface are automatically detected and initialized during LionCore initialization.

using System.Threading.Tasks;
using Data;
using LionStudios.Suite.Core;
using Utility.Dispatcher;

public class CustomModule : ILionModule
{
    //Determines in what order ILionModules are initialized (in ascending order)
    public int Priority => 0; 

    public Task Initialize(Dispatcher dispatcher, CoreData coreData)
    {
        Debug.Log("custom module initialization");
        return Task.CompletedTask;
    }

    public void OnInitialize(LionCoreContext ctx){}
    
}

Put your initialization code in the Initialize Method.

The Priority int is used to determine what ILionModule class is initialized first. This will only matter if you have more than 1 class that is using the ILionModule interface. By default it should be 0. You can decide priority based on how quickly during loading you want your custom module to be loaded.

The setup is now complete. Please get in touch with Lion SDK Support for any issues or questions.

Resulting Console Output

Getting Help

For further issues or concerns, please check Support