API reference

Unity content and fonts

The Unity-side helpers: what pages may show from the scene, the fonts used when your own lack a character, and the numbers overlay.

UnityElements

DevCore.UiEngine.Unity.Elements.UnityElements registers what the Unity content elements show, by the name the markup uses. Without a registration, a camera is found by its GameObject's name, and models and materials are loaded from Resources.

MemberFor
static void RegisterCamera(string name, Camera camera)<unity-camera camera="name">
static void RegisterModel(string name, GameObject prefab)<unity-model src="name">
static void RegisterVideo(string name, VideoClip clip)<video src="name">
static void RegisterMaterial(string url, Material material)-unity-material: url(...)
static int PreviewLayerThe layer model previews are drawn on, 31 by default. Keep your cameras from drawing it
using DevCore.UiEngine.Unity.Elements;

void Awake()
{
    UnityElements.RegisterCamera("minimap", minimapCamera);
    UnityElements.RegisterModel("sword", swordPrefab);
}
<unity-camera camera="minimap" fps="30"></unity-camera>
<unity-model src="sword" autorotate></unity-model>

FontFallbackSettings

A ScriptableObject (Assets → Create → DevCore UI → Font Fallback Settings) that lists font packs per script and says whether system fonts may be used. The one saved as Resources/DevCoreUi/FontFallbackSettings is applied at start; Apply applies another at runtime.

Packs are keyed by ISO 15924 script code: Arab, Hebr, Deva, Thai, Hans, Hant, Jpan, Kore, plus Emoji, Symbols, Math and Default. They are searched before the platform's own fonts, for each character your fonts do not have.

UIStatsOverlay

A component that shows the engine's numbers of the last frame on screen. The same numbers are available from code as UiSystem.Stats (all views) and UIView.FrameStats (one view).

Profiler markers

The Unity Profiler shows one marker per phase of the engine's frame:

MarkerPhase
DevCore.InputReading devices and dispatching events
DevCore.ReactivityTicks, effects, template updates
DevCore.AnimationTransitions and animations
DevCore.StyleRestyling dirty elements
DevCore.LayoutLaying out dirty boxes
DevCore.PaintPainting what changed
DevCore.MeshWriting and uploading GPU records
DevCore.DrawIssuing draw calls
DevCore.ContentUnity content elements

On-screen keyboard

On phones and consoles, focusing a text control opens the system's on-screen keyboard; nothing has to be called. env(safe-area-inset-*) keeps content clear of notches and system bars.