API and Extensibility¶
Use this reference after configuring a working context. Functional guides explain authoring workflows; this section identifies the integration surface and contracts useful to customer code. It is a curated reference, not a promise that every public helper or serialized snapshot field is a stable extension hook.
Access a context¶
Use Sital.Tunal.Core.TunalContext and an explicit scene reference where possible. Initialize() returns success and is idempotent after initial success; IsInitialized does not certify every optional system. The read-only system properties are Time, Calendar, Astronomy, DayPhases, Seasons, and Lunar; each optional module can be null or unavailable.
DiscoverSystems() fills missing owned references without replacing valid explicit ones. RefreshSystems() refreshes optional modules and publishes its separate refresh event. Ownership remains hierarchical and excludes nested-context systems. Do not assign systems from another world through reflection or private serialized field access.
For objects instantiated at runtime, initialize before issuing state-changing commands and subscribe/query state in a lifecycle-safe way. A scene reference being non-null is not proof that its Start has run.
Namespace map¶
| Namespace | Integration roles |
|---|---|
Sital.Tunal.Core |
Context, context switching, optional singleton |
Sital.Tunal.Systems |
Six simulation systems |
Sital.Tunal.Data, .Enums |
Dates/time values, profiles, modes |
Sital.Tunal.Presentation, .Clouds |
Presentation consumers and cloud shape assets |
Sital.Tunal.Objects |
Reactive response base and fixed condition evaluator |
Sital.Tunal.Lifecycle |
Lifecycle components, state, chronology policies |
Sital.Tunal.Persistence |
Context/world orchestration, snapshots, catalog, storage/results |
Sital.Tunal.UI |
Runtime command facade and view bindings |
Your assembly definition must reference Sital.Tunal. Keep UnityEditor code in an Editor assembly; do not reference Tunal's Editor/Demo assemblies to run ordinary gameplay. Required engine/UI dependencies are described in Requirements.
Supported extension patterns¶
- Query initialized systems and subscribe to public state events.
- Control time/calendar/location/profile selections with system APIs.
- Derive a custom reactive response from
SystemBasedObject. - Supply a custom condition policy through manual influence; the built-in condition class is sealed.
- Create a presentation adapter using the binding lifecycle.
- Compose lifecycle gameplay with public control methods/events; the sealed lifecycle component is not a virtual stage-engine base.
- Use persistence orchestrators and portable JSON for your backend, keeping validation/ordering intact.
The UI, lifecycle and persistence API tables collect command signatures, result types and side effects for those integrations.
Public does not always mean an authoring hook¶
Avoid obsolete World* aliases on the context switcher; use Context-named APIs. Editor catalog/registration repair methods, hidden compatibility fields, backend material configuration helpers, raw persistence restore primitives, and mutable snapshot records are not interchangeable with higher-level setup commands. Some exist for serialization/orchestration rather than routine gameplay extension.
The examples in this manual use real signatures and have passed standalone compilation against the current runtime source and available Unity references. Unity import, Inspector wiring and Play Mode/player execution still require validation in your project. Public visibility alone does not guarantee API compatibility, platform support or performance.