Biome Manager

v1.1.0

Components

Reference for every runtime component and data asset.

BiomeManager

Singleton

Central registry and lock-state authority. Zones register with it, unlock evaluation runs through it, and all global events (enter/exit, unlock/lock) are raised here. One per game - it survives scene loads.

Properties

PropertyTypeDescription
Instancestatic BiomeManagerGlobal access point
OnBiomeEnter / OnBiomeExitstatic eventRaised when a tracked object enters/leaves a zone
OnBiomeUnlocked / OnBiomeLockedstatic eventRaised on lock-state changes
GetCurrentBiome(target)BiomeDefinitionBiome a given object is currently inside
IsBiomeLocked(id)boolCurrent lock state by biome ID
GetUnlockedBiomeIds() / LoadUnlockedSet()APIPersistence endpoints used by the Biome Unlocks memory
Unlock requirements are re-evaluated on start, on every grant, after loading a save, and when late-loading scenes register zones — a biome can never get "stuck locked" because a grant happened early.

BiomeZone

Scene Component

The boundary of a biome in a scene. Collider shape uses the attached trigger collider; Polygon shape uses an authored XZ outline with Scene-view handle editing. Spawns/despawns the barrier on lock changes.

Properties

PropertyTypeDescription
Biome DefinitionBiomeDefinitionThe biome this zone belongs to
PriorityintNesting: when zones overlap, the highest priority provides the current biome
ShapeCollider | PolygonBoundary source
Polygon Points / HeightList<Vector2>, floatOutline in local XZ + vertical extent
Tracked TagstringTag polled by polygon zones (default: Player)
Blend DistancefloatSpatial environment blend near the border (0 = off)
ContainsPoint(worldPos)boolPolygon containment test
GetDistance(worldPos)floatDistance to the zone boundary (0 inside)
GetClosestPoint(worldPos)Vector3Nearest boundary point - anchor for direction indicators

BiomeBarrier

Auto-Spawned

Solid wall raised on locked zone boundaries. Generates its own holographic shield visual (continuous outline ribbon on polygons) tinted with the biome’s barrier color. Contact fires the OnBarrierHit event, cooldown-gated.

Properties

PropertyTypeDescription
OnBarrierHitstatic event(biome, worldPos) - raised on entrant contact
Hit CooldownfloatMinimum seconds between feedback events
Hit VFX / Floating Text PrefabGameObjectOptional feedback prefabs
LockedMessage / UnlockHintstringDisplay texts read from the biome definition

RequirementDatabase

Player Component

Holds the set of granted requirement tokens. Granting the last missing token of a biome unlocks it automatically. May live on the player root or a child object - all lookups search parents, children, then the static Main fallback.

Properties

PropertyTypeDescription
Grant(requirement) / Revoke(requirement)methodModify the granted set
Has(requirement)boolMembership test
OnGranted / OnRevokedstatic eventRaised on changes
Mainstatic RequirementDatabaseFirst enabled instance (used by UI proximity checks)
GetGrantedIds() / LoadGrantedSet()APIPersistence endpoints used by the Biome Requirements memory

RequirementAutoGrant

Player Component

Single observer that sweeps all pending self-evaluating requirements (e.g. "Level ≥ 5" conditional requirements) on an interval and grants them when their conditions hold. Replaces per-requirement scene triggers.

Properties

PropertyTypeDescription
IntervalfloatSweep frequency (default 0.5 s)
Evaluation TargetGameObjectArgs target for Self/Target-based conditions (set to the character root when the database lives on a child)
Additional WatchRequirementAsset[]Extra requirements beyond those referenced by registered biomes
Sweep()methodForce an immediate re-check after a known event

BiomeDiscoveryDatabase

Player Component

Tracks discovered biomes and visit counts, independent of unlock state. Entering a biome records a visit automatically; manual reveals (map purchase) use the Mark Biome Discovered instruction.

Properties

PropertyTypeDescription
IsDiscovered(biome)boolHas the player found this biome
GetVisitCount(biome)intNumber of recorded visits
DiscoveredCountintTotal discovered biomes
OnDiscoveredeventRaised on first discovery

Controllers (one each per scene)

BiomeEnvironmentController

Cross-fades skybox, ambient light, fog, URP post-processing volume weight and terrain distances between environment profiles. Holds the Default Profile used outside all biomes and drives spatial border blending.

BiomeWeatherController

Spawns/cross-fades weather particles, tints the sun, drives wind and weather audio. Maintains the Available Profiles registry used by the Cycle Weather instruction, runs weather-table schedules, and raises the static OnWeatherChanged event.

BiomeAudioController

Two-source music cross-fade plus a randomized ambient one-shot pool with configurable intervals.

BiomeCozyBridge (optional)

Forwards weather changes to COZY: Stylized Weather by mapping WeatherTypes to COZY profiles. Binds via reflection — zero dependency when COZY is absent, and it warns once per unmapped weather type instead of failing silently.

Profile & Data Assets

AssetCreate MenuContains
Biome DefinitionBiome Manager → Biome DefinitionIdentity, lock settings, requirements, profile references, GC2 event lists
Environment ProfileBiome Manager → Environment → Environment ProfileSkybox, ambient, fog, post-processing, terrain distances, transition time
Weather ProfileBiome Manager → Environment → Weather ProfileWeatherType, particles, wind, light tint, audio loop
Weather TableBiome Manager → Environment → Weather TableWeighted weather entries with min/max hold times
Audio ProfileBiome Manager → Environment → Audio ProfileMusic clip, ambient one-shot pool, volumes, fade time
RequirementBiome Manager → RequirementToken identity, description, icon, player-facing hint
Requirement (GC2 Conditions)Biome Manager → Requirement (GC2 Conditions)A requirement that self-evaluates via an embedded GC2 ConditionList
All assets carry auto-generated GUID identities. Duplicating one in the Project window regenerates the copy's ID automatically so save data never collides.