Class WaitScreenHandler
A handler for registering mod loading actions to be performed during the loading screen.
public static class WaitScreenHandler
- Inheritance
-
WaitScreenHandler
- Inherited Members
Methods
RegisterAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string)
Register a task for doing something midway through the loading screen.
The task will execute just after the Main scene has finished loading in, meaning any GameObjects created during this task will not be destroyed by a unity scene switch.
However, nothing in the game exists yet. You cannot access in-game concepts like Player.main, EscapePod.main or similar at this time during the loading process. For that purpose, consider using RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string).
The task will execute just after the Main scene has finished loading in, meaning any GameObjects created during this task will not be destroyed by a unity scene switch.
However, nothing in the game exists yet. You cannot access in-game concepts like Player.main, EscapePod.main or similar at this time during the loading process. For that purpose, consider using RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string).
public static void RegisterAsyncLoadTask(string modName, Func<WaitScreenHandler.WaitScreenTask, IEnumerator> loadingFunction, string description = null)
Parameters
modName
string- The name of your mod. Will be displayed while this task is being worked on.
loadingFunction
Func<WaitScreenHandler.WaitScreenTask, IEnumerator>- The function that will be called.
description
string- An optional description to give users detailed information about what your task is doing. Can be updated even while your task is executing by setting WaitScreenHandler.WaitScreenTask.Status.
RegisterEarlyAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string)
Register a task for doing something very early during the loading screen.
The task will execute almost immediately after the user presses the button to start a game, once the loading screen fades in. This makes the timing ideal for loading save data or other data that does not directly depend on objects in the game.
Do not use this task to set up GameObjects for your mod, as at this point the game is still in the MainMenu scene and any GameObjects you create now will be destroyed once the in-game Main scene is loaded. Consider using RegisterAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) or RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) for that instead.
The task will execute almost immediately after the user presses the button to start a game, once the loading screen fades in. This makes the timing ideal for loading save data or other data that does not directly depend on objects in the game.
Do not use this task to set up GameObjects for your mod, as at this point the game is still in the MainMenu scene and any GameObjects you create now will be destroyed once the in-game Main scene is loaded. Consider using RegisterAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) or RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) for that instead.
public static void RegisterEarlyAsyncLoadTask(string modName, Func<WaitScreenHandler.WaitScreenTask, IEnumerator> loadingFunction, string description = null)
Parameters
modName
string- The name of your mod. Will be displayed while this task is being worked on.
loadingFunction
Func<WaitScreenHandler.WaitScreenTask, IEnumerator>- The function that will be called.
description
string- An optional description to give users detailed information about what your task is doing. Can be updated even while your task is executing by setting WaitScreenHandler.WaitScreenTask.Status.
RegisterEarlyLoadTask(string, Action<WaitScreenTask>, string)
Register a task for doing something very early during the loading screen.
The task will execute almost immediately after the user presses the button to start a game, once the loading screen fades in. This makes the timing ideal for loading save data or other data that does not directly depend on objects in the game.
Do not use this task to set up GameObjects for your mod, as at this point the game is still in the MainMenu scene and any GameObjects you create now will be destroyed once the in-game Main scene is loaded. Consider using RegisterAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) or RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) for that instead.
The task will execute almost immediately after the user presses the button to start a game, once the loading screen fades in. This makes the timing ideal for loading save data or other data that does not directly depend on objects in the game.
Do not use this task to set up GameObjects for your mod, as at this point the game is still in the MainMenu scene and any GameObjects you create now will be destroyed once the in-game Main scene is loaded. Consider using RegisterAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) or RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string) for that instead.
public static void RegisterEarlyLoadTask(string modName, Action<WaitScreenHandler.WaitScreenTask> loadingFunction, string description = null)
Parameters
modName
string- The name of your mod. Will be displayed while this task is being worked on.
loadingFunction
Action<WaitScreenHandler.WaitScreenTask>- The function that will be called.
description
string- An optional description to give users detailed information about what your task is doing. Can be updated even while your task is executing by setting WaitScreenHandler.WaitScreenTask.Status.
RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string)
Register a task for doing something just before the loading screen ends and the player gains control.
The task will execute at the last possible moment before the loading screen ends. The game has finished all its setup at this point and is only waiting for any tasks registered through this method. Use this method for tasks that heavily rely on other GameObjects or singletons to be present, such as the Player, Inventory, or other mods.
The task will execute at the last possible moment before the loading screen ends. The game has finished all its setup at this point and is only waiting for any tasks registered through this method. Use this method for tasks that heavily rely on other GameObjects or singletons to be present, such as the Player, Inventory, or other mods.
public static void RegisterLateAsyncLoadTask(string modName, Func<WaitScreenHandler.WaitScreenTask, IEnumerator> loadingFunction, string description = null)
Parameters
modName
string- The name of your mod. Will be displayed while this task is being worked on.
loadingFunction
Func<WaitScreenHandler.WaitScreenTask, IEnumerator>- The function that will be called.
description
string- An optional description to give users detailed information about what your task is doing. Can be updated even while your task is executing by setting WaitScreenHandler.WaitScreenTask.Status.
RegisterLateLoadTask(string, Action<WaitScreenTask>, string)
Register a task for doing something just before the loading screen ends and the player gains control.
The task will execute at the last possible moment before the loading screen ends. The game has finished all its setup at this point and is only waiting for any tasks registered through this method. Use this method for tasks that heavily rely on other GameObjects or singletons to be present, such as the Player, Inventory, or other mods.
The task will execute at the last possible moment before the loading screen ends. The game has finished all its setup at this point and is only waiting for any tasks registered through this method. Use this method for tasks that heavily rely on other GameObjects or singletons to be present, such as the Player, Inventory, or other mods.
public static void RegisterLateLoadTask(string modName, Action<WaitScreenHandler.WaitScreenTask> loadingFunction, string description = null)
Parameters
modName
string- The name of your mod. Will be displayed while this task is being worked on.
loadingFunction
Action<WaitScreenHandler.WaitScreenTask>- The function that will be called.
description
string- An optional description to give users detailed information about what your task is doing. Can be updated even while your task is executing by setting WaitScreenHandler.WaitScreenTask.Status.
RegisterLoadTask(string, Action<WaitScreenTask>, string)
Register a task for doing something midway through the loading screen.
The task will execute just after the Main scene has finished loading in, meaning any GameObjects created during this task will not be destroyed by a unity scene switch.
However, nothing in the game exists yet. You cannot access in-game concepts like Player.main, EscapePod.main or similar at this time during the loading process. For that purpose, consider using RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string).
The task will execute just after the Main scene has finished loading in, meaning any GameObjects created during this task will not be destroyed by a unity scene switch.
However, nothing in the game exists yet. You cannot access in-game concepts like Player.main, EscapePod.main or similar at this time during the loading process. For that purpose, consider using RegisterLateAsyncLoadTask(string, Func<WaitScreenTask, IEnumerator>, string).
public static void RegisterLoadTask(string modName, Action<WaitScreenHandler.WaitScreenTask> loadingFunction, string description = null)
Parameters
modName
string- The name of your mod. Will be displayed while this task is being worked on.
loadingFunction
Action<WaitScreenHandler.WaitScreenTask>- The function that will be called.
description
string- An optional description to give users detailed information about what your task is doing. Can be updated even while your task is executing by setting WaitScreenHandler.WaitScreenTask.Status.