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.
| Member | For |
|---|---|
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 PreviewLayer | The 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:
| Marker | Phase |
|---|---|
DevCore.Input | Reading devices and dispatching events |
DevCore.Reactivity | Ticks, effects, template updates |
DevCore.Animation | Transitions and animations |
DevCore.Style | Restyling dirty elements |
DevCore.Layout | Laying out dirty boxes |
DevCore.Paint | Painting what changed |
DevCore.Mesh | Writing and uploading GPU records |
DevCore.Draw | Issuing draw calls |
DevCore.Content | Unity 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.