Creating and Bundling Custom Weather
Custom weather in WeatherRegistry is distributed through Unity AssetBundles with a special .weatherbundle extension. This allows for easy distribution and loading of weather assets.
Creating a Weather Bundle
Section titled “Creating a Weather Bundle”Follow these steps to bundle your custom weather:
1. Create a WeatherDefinition
Section titled “1. Create a WeatherDefinition”First, create a WeatherDefinition asset in your Unity project. This ScriptableObject contains all the configuration for your custom weather, including:
- Weather name and type
- Visual effects and parameters
- Weather variables (if applicable)
- Associated effects and behaviors
2. Build the AssetBundle
Section titled “2. Build the AssetBundle”Create an AssetBundle in Unity with the .weatherbundle extension:
- Select your WeatherDefinition asset in the Unity Editor
- In the Inspector, set the AssetBundle name at the bottom (e.g.,
YourWeather.weatherbundle) - Build the AssetBundle using Unity’s build pipeline or a custom build script
- Ensure the WeatherDefinition is included as the primary asset in the bundle
3. Deploy the Bundle
Section titled “3. Deploy the Bundle”Place your compiled .weatherbundle file anywhere within the BepInEx/plugins directory, for example:
BepInEx/plugins/YourWeatherMod/YourWeather.weatherbundleBepInEx/plugins/YourWeather.weatherbundle- Any subdirectory within
plugins/
WeatherRegistry will automatically scan and load all .weatherbundle files when the game starts.
Bundle Structure
Section titled “Bundle Structure”A typical weather bundle should contain:
- WeatherDefinition
- ImprovedWeatherEffect (auto-included)
The rest of the assets should be automatically included as dependencies of the WeatherDefinition, i.e.:
- Prefabs
- Materials
- Audio Clips
Best Practices
Section titled “Best Practices”- Keep bundle sizes reasonable by optimizing textures and audio
- Test your weather in-game before distribution
- Include fallback assets for missing dependencies
- Document any special requirements or compatibility notes