Heroic Engine
  • Welcome
  • Getting Started
    • Quickstart
    • Example Games
      • Tic Tac Toe
      • Turn based duel
  • Basics
    • Injection Manager
    • Engine Systems
      • Core Systems
        • Events Manager
        • Input Manager
        • Localization Manager
          • LangText component
        • Music Player
        • Sounds Manager
        • Time Manager
        • Scenes Loader
        • Day Time Controller
        • Weather Controller
      • Gameplay Systems
        • Currencies Manager
        • Player Progression Manager
        • Quest Manager
        • Random Events Manager
        • Hittables Manager
        • Dungeon Generator
      • UI Systems
        • UI Controller
        • Countdown Controller
    • Editor Tools
      • Clear Saves
      • Mobile Build Optimizer
      • Create System
      • Icon from Prefab Generator
    • Engine Utilities
      • PoolSystem
      • DataSaver
      • ComponentExtensions
      • MaterialExtensions
      • SpriteUtils
      • SlowUpdate
      • StringUtils
      • TypeUtility
      • MathHelper
      • VectorUtils
      • TransformUtils
      • MeshUtils
    • Useful Components
      • Floating Item
      • Fly Up Text
      • Label Scaler
      • Ragdoll
      • Rotate To Camera
      • Orbital Camera
      • Rotator
      • Texture Mover
      • Hittable
      • Projectile
      • Projectile2D
      • LifetimeObject
      • Spawner
      • Colorized Particles
      • Draggable2D
      • SaveableTransform
    • Useful Attributes
Powered by GitBook
On this page
  • Parameters in inspector
  • Available methods
  1. Basics
  2. Engine Systems
  3. Core Systems

Weather Controller

PreviousDay Time ControllerNextGameplay Systems

Last updated 4 months ago

Presented by IWeatherController interface, this system allows to start or stop raining, start or stop wind and change their intensity.

To use this system, just drag WeatherController prefab onto your game scene and set it up as you wish:

Parameters in inspector

Rain Particles – reference to rain object. Plese, don't change it.

Initial Weather – initial rain state. It can be None, RainingLight, RainingMedium or RainingHeavy.

Initial Wind State – initial wind power. It can be None, Light, Medium or Heavy.


You can also use this system via code. For this, inject IWeatherController interface into your class and call needed methods.

Available methods

void SetWeatherState(WeatherState weatherState, float fadeDuration = 3f)

This method allows to set current weather state. It can be None, RainingLight, RainingMedium or RainingHeavy. You can also set certain weather change time by fadeDuration parameter.

Example:

weatherController.SetWeatherState(WeatherState.RainingHeavy, 5f);

void SetWindState(WindState windState)

This method allows to set current wind power. It can be None, Light, Medium or Heavy.

Example:

weatherController.SetWindState(WindState.Medium);

You can see how it works on the WeatherTestScene, which is situated in Assets/Heroic Engine/Example/Scenes directory.

WeatherController prefab
Parameters in inspector