Skip to content

GameLoader

namespace Griff.Runtime;
public static class GameLoader

Loads an exported game folder (or a project folder) for the player.

public static Task<LoadedGame> LoadAsync(string gameFolder)

Loads a game folder (an export’s, or a project’s): the modules it carries first (ModulesFolder, so its scenes read with their components), then its scripts and its start scene. Its games run the modules it uses.

public static Scene LoadScene(Project project, ComponentRegistry components, string nameOrPath)
public static void RegisterComponents(Assembly assembly, ComponentRegistry registry, ICollection<string> warnings)
public static void UseProjectSettings(Game game, Project project)

Sets game up as project says, before it starts: its controls (the game’s own input actions), its step rate, its save version, its tables (every .table file in Assets, see Tables) and its balance simulations (every .sim file, see Game.Simulate). Every host does this, so a game plays the same in the editor, exported and in a browser.