World Activity System

v1.0.0

Cozy Weather Integration

Use Cozy Weather's day/night cycle for time-of-day events and trigger weather changes from activities.

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.

Optional Integration: The World Activity System works without Cozy Weather using built-in time providers. This integration adds enhanced time-of-day and weather features.

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

  1. Select your WorldActivityManager in the scene
  2. In Inspector, find Time Provider Type
  3. Select CozyWeather
  4. 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:

  1. Create new GameObject: CozyWeatherController
  2. Add Component → Cozy Weather Controller
  3. Assign Cozy Weather reference
  4. Optionally assign default weather profiles
Setup Complete! Time-of-day events will now use Cozy Weather's time system. Use the Debug Window → Timeline to verify event scheduling.

Components

CozyWeatherTimeProviderITimeOfDayProvider

Reads time from Cozy Weather's dayPercentage property and implements ITimeOfDayProvider.

PropertyTypeDescription
CurrentHourfloatCurrent hour (0-24) from Cozy
CurrentTimeOfDayTimeOfDayDawn, Morning, Noon, etc.
IsConnectedboolWhether Cozy Weather is found

CozyWeatherControllerMonoBehaviour

Controls Cozy Weather by calling ecosystem.SetWeather(). Enables weather changes from events and GC2 actions.

PropertyTypeDescription
cozyWeatherCozyWeatherReference to Cozy Weather instance
defaultProfileWeatherProfileFallback 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

  1. 1
    Create TemporalActivity

    Create → World Activity System → Temporal Activity
    Name: Storm_Event, Duration: 60s

  2. 2
    Create ActivityInstructions

    New GameObject → Add Component → Activity Instructions
    Assign Storm_Event to Activity field

  3. 3
    Configure On Event Start

    Override On Event Start: ✓
    Add Action → Set Weather Profile → "Thunderstorm"

  4. 4
    Configure 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
Location: Assets/WorldActivitySystem/Examples/Scenes/06_Cozy_Weather.unity

Troubleshooting

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.