Overview
The Cozy Weather integration enables two powerful features for your World Activity System:
🕐 Time-of-Day Events
Use Cozy Weather's day/night cycle to trigger events at Dawn, Noon, Dusk, or Midnight. Events sync with Cozy's dayPercentage property.
🌩️ Weather Control
Trigger weather profile changes from events. Create storm events, blizzards, or weather-based boss encounters.
Requirements
- ✓Cozy Weather 3.x
From Distant Lands on the Unity Asset Store
- ✓World Activity System 1.0+
With TimeProvider system
- ✓COZY_WEATHER define
Automatically set when Cozy Weather is detected
Setup Guide
Step 1: Verify Cozy Weather Installation
Ensure Cozy Weather is installed and working in your project. You should see the Cozy Weather Sphere prefab in your scene.
The COZY_WEATHER symbol is automatically defined via the assembly definition when Cozy Weather is detected.
Step 2: Configure Time Provider
- Select your WorldActivityManager in the scene
- In Inspector, find Time Provider Type
- Select
CozyWeather - The manager will automatically find the Cozy Weather instance
Step 3: Add Weather Controller (Optional)
Only needed if you want to change weather from events:
- Create new GameObject:
CozyWeatherController - Add Component →
Cozy Weather Controller - Assign Cozy Weather reference
- Optionally assign default weather profiles
Components
CozyWeatherTimeProviderITimeOfDayProvider
Reads time from Cozy Weather's dayPercentage property and implements ITimeOfDayProvider.
| Property | Type | Description |
|---|---|---|
| CurrentHour | float | Current hour (0-24) from Cozy |
| CurrentTimeOfDay | TimeOfDay | Dawn, Morning, Noon, etc. |
| IsConnected | bool | Whether Cozy Weather is found |
CozyWeatherControllerMonoBehaviour
Controls Cozy Weather by calling ecosystem.SetWeather(). Enables weather changes from events and GC2 actions.
| Property | Type | Description |
|---|---|---|
| cozyWeather | CozyWeather | Reference to Cozy Weather instance |
| defaultProfile | WeatherProfile | Fallback weather profile |
Game Creator 2 Actions
Set Weather Profile
World Activity System → Cozy Weather → Set Weather
- • Weather Profile: The profile to activate
- • Transition Time: Blend duration in seconds
Clear Weather
World Activity System → Cozy Weather → Clear Weather
- • Clear Weather Profile: Target profile (optional)
- • If empty: Cozy's Forecast system selects next weather
Creating Weather Events
Use ActivityInstructions to trigger weather changes when events start or end.
Example: Storm Event
- 1Create TemporalActivity
Create → World Activity System → Temporal Activity
Name:Storm_Event, Duration: 60s - 2Create ActivityInstructions
New GameObject → Add Component → Activity Instructions
AssignStorm_Eventto Activity field - 3Configure On Event Start
Override On Event Start: ✓
Add Action → Set Weather Profile → "Thunderstorm" - 4Configure On Event End
Override On Event End: ✓
Add Action → Clear Weather → (leave empty for random)
Triggering the Event
- 🖱️Code:
WorldActivityManager.Instance.TriggerEvent("Storm_Event") - 🛠️Debug Window: Tools Tab → Manual Triggers → Click "Trigger"
- ⏰Scheduled: Add to Event Scheduler with TimeOfDay trigger
- 🎮GC2 Action: Use "Trigger Event" instruction
Demo Scene: 06_Cozy_Weather
The demo scene demonstrates the complete Cozy Weather integration:
- ✓Time-of-Day Events: Dawn patrol, noon market, dusk ritual, midnight haunting
- ✓Weather Events: Storm event with thunder VFX, blizzard boss encounter
- ✓UI Buttons: Manual weather triggers for testing
- ✓Debug Window: Timeline shows all scheduled events
Assets/WorldActivitySystem/Examples/Scenes/06_Cozy_Weather.unityTroubleshooting
COZY_WEATHER symbol not defined
Check Project Settings → Player → Scripting Define Symbols. If missing, add COZY_WEATHER manually or reimport WAS package.
CozyWeatherTimeProvider not found
Ensure Cozy Weather is installed before WAS. The TimeProvider only compiles when COZY_WEATHER is defined.
Weather not changing
Verify CozyWeatherController has a valid CozyWeather reference. Check that the Weather Profile assets exist.
Time-of-day events not triggering
Confirm TimeProvider is set to 'CozyWeather' in WorldActivityManager. Check Debug Window → Timeline to see scheduled times.