Apps
public static class AppsNamespace Sideload.Api
The Sideload framework’s modder API. Reference Sideload.Api.dll OR drop this single file into your mod. Register an app and Sideload renders your HTML/CSS/JS bundle as a real phone app - no uGUI assembly by hand, no layout arithmetic, hot-reloadable while the game runs.
Every call is a zero-overhead no-op when Sideload is not installed and lights up automatically when it is, so you can ship this unconditionally with no hard dependency. Check Available only if you want to fall back to your own UI.
using Sideload.Api;Apps.Register("prophunt", "PropHunt.App", title: "PropHunt", iconLabel: "PropHunt");The bundle prefix is the embedded-resource prefix of your web files inside your own assembly, so PropHunt/App/index.html embedded as PropHunt.App.index.html is reached with prefix "PropHunt.App". A file at Mods/<id>/index.html overrides the embedded copy.
All calls MUST be made from the Unity main thread.
Properties
Section titled “Properties”Available
Section titled “Available”public static bool Available { get; }True only when the Sideload host is installed AND bound. You rarely need this - the API is a safe no-op when absent; use it to decide whether to build a fallback UI instead.
Methods
Section titled “Methods”Register
Section titled “Register”public static AppHandle Register( string id, string bundlePrefix, string title = null, string iconLabel = null, Assembly hostAssembly = null)Declare an app. It appears on the in-game phone with its own icon and renders index.html from your bundle. Load-order-proof: registering before Sideload has loaded is fine, the call is replayed once the host appears.
| Parameter | |
|---|---|
id | Stable, unique id. Also the folder name under Mods/ that overrides the embedded files. |
bundlePrefix | Embedded-resource prefix of your web files inside the calling assembly. |
title | App title. Defaults to id. |
iconLabel | Caption under the home-screen icon. Defaults to the title. |
hostAssembly | The assembly holding the embedded bundle. Defaults to the caller’s assembly; pass it explicitly if you wrap this call in a helper of your own. |