Modules

Not all projects are the same, and COZY is designed with this in mind

The COZY Modules System is the cornerstone of the COZY: Stylized Weather ecosystem, designed to provide flexibility, extensibility, and ease of customization to Unity developers and creators. This modular system empowers you to tailor your weather and environment management precisely to your project's needs, ensuring that your virtual worlds come to life with stunning style and artistic control.

What are Modules?

In the COZY ecosystem, modules are individual components that manage specific aspects of your environment, weather, and atmospheric conditions. Each module is designed to offer a set of features, controls, and APIs that allow you to fine-tune and enhance your scenes. Modules can be seamlessly integrated into your projects, working in harmony to create immersive experiences.

Key Features and Benefits

Adding Modules

Adding existing modules to your scene is simple! In the settings module click the Add New Module button:

Next, select the module that you want to add from the dropdown list:

COZY will automatically check for any dependencies or conflicts and attempt to add the module that you select. If the module can be added, you will see it appear next to the settings module. After clicking on the module tab in the top of the editor, you can begin managing the settings!

API Reference

Access Modules

This code will allow you to access the Atmosphere Module. You can replace the type parameter with any other module that you want to access:

CozyWeather.instance.GetModule<CozyAtmosphereModule>();

Remove Modules

This code will allow you to access the Atmosphere Module. You can replace the type parameter with any other module that you want to access:

CozyWeather.instance.GetModule<CozyAtmosphereModule>();

Execution Order

In COZY 3, modules will now use 5 different update methods to split functionality and allow proper timings while communicating between modules.

  • Frame Reset will run on all modules at the beginning of the logic for that frame. It is normally used to reset values to their defaults before they are edited at runtime

  • Update Weather Weights runs when all of the weather profile weights are calculated for that frame

  • Update FX Weights runs when FX profiles are updated based on the new values of the weather profile weights

  • Propagate Variables runs when all the values are accumulated and propagated to the individual modules

  • Cozy Update Loop handles all calculations that happen after the weather sphere is in a stable state. Think of this as the COZY equivalent to LateUpdate

Last updated