Skip to content

Instantly share code, notes, and snippets.

@just-ero
Last active March 10, 2023 10:11
Show Gist options
  • Save just-ero/ee657bb73ecf97c87351ecb30bb859ab to your computer and use it in GitHub Desktop.
Save just-ero/ee657bb73ecf97c87351ecb30bb859ab to your computer and use it in GitHub Desktop.
An example class for developers to put into their games to make life of ASL creators easier.
// This is a minimum example for adding autosplitter support to a game written in C# - including all Unity games.
// This class should be excluded from any potential obfuscation.
public static class AutoSplitterData
{
// This could for example match any in-game timer.
public static double inGameTime = 0d;
// Set to true if the game is currently loading; otherwise, false.
// Do not add both inGameTime and isLoading. One suffices.
public static bool isLoading = false;
// This should update every time the level changes.
public static int levelID = 0;
// This could be set to 1 when an attempt was started (e.g. when the user loads the first level,
// when the in-game time starts, when the user clicks a button on the main menu).
// This could be set to 2 when the game ended (e.g. when the user loads the credits,
// when the in-game time is finally stopped, when the user does the final action of the game).
// This could be set to 0 when an attempt is ended early (e.g. when the user quits to the main menu).
public static int isRunning = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment