Events Module
Last updated
Was this helpful?
Last updated
Was this helpful?
Use the COZY system to directly impact your world in a quick manner. The lightweight Events Module will provide you with access to many simple hooks that you can use to link functions to various events that can happen in the COZY system.
For more advanced control. see the .
Run an event at dawn.
Run an event at morning.
Run an event at day.
Run an event at afternoon.
Run an event at evening.
Run an event at twilight.
Run an event at night.
Run an event when an in-game minute passes.
Run an event when the hour changes.
Run an event when the day changes.
Run an event when the year changes.
Run an event when the weather changes.
Run events when a weather profile with a certain Event FX profile is playing.
This is incredibly simple within the Events Module! Simply create a point light in your scene and in the Events Module add two events. In the OnMorning section, add an event that disables the point light, and in the OnTwilight section add an event that enables it:
In this example, we use the OnMorning event instead of the OnDawn event because we want the light to stay on for a bit longer. Dawn will typically run right before the sun rises. Similarly, we use the OnTwilight event instead of the OnNight event because there will be a little bit of natural light left during twilight. These will combine to give your scene a very natural lighting system that keep your game well lit!
Click the Add New Event FX Reference button
Once your Event FX Reference is set, you can assign your events using the OnStart and OnStop Unity Events
For basic events, follow this C# script example. You can replace onDawn with any other COZY event that you want to listen to
For events that play based on Event FX, you will need to follow this for your C# script
Now select your FX reference. This is an profile that is assigned to several weather profiles that all fit a certain type. By default, COZY ships with 3 Event FX types for rainy, snowy, and foggy weather but you can create your own Event FX Profiles using the right-click context menu.