UniStorm API - Black-Horizon-Studios/UniStorm-Weather-System GitHub Wiki

UniStorm API

UniStorm offers tons of useful API to make customizing and altering UniStorm easy. UniStormโ€™s API is accessible from 2 different scripts. Be sure to use the proper instance when accessing the API.

If you would like to include the UniStorm namespace, so you don't have to reference the manager with UniStorm.UniStormManager, you will need to include the following namespace at the top of your script.

using UniStorm;

Table of Contents

Weather

ChangeWeatherWithTransition

Changes UniStorm's weather, regardless of conditions, with the transition speed to the weather type parameter.

UniStorm.UniStormManager.Instance.ChangeWeatherWithTransition(UniStorm.WeatherType weatherType);

ChangeWeatherInstantly

Changes UniStorm's weather instantly, regardless of conditions, to the weather type parameter.

UniStorm.UniStormManager.Instance.ChangeWeatherInstantly(WeatherType weatherType);

RandomWeather

Generates a random weather type, regardless of conditions, from UniStorm's All Weather Type list

UniStorm.UniStormManager.Instance.RandomWeather();

CurrentWeatherType

Get the name of the current weather type

string CurrentWeatherTypeName = UniStorm.UniStormSystem.Instance.CurrentWeatherType.WeatherTypeName;

GetWeatherForecastName

Gets the forecasted weather type's name

string WeatherForecastName = UniStorm.UniStormManager.Instance.GetWeatherForecastName();

GetWeatherForecastHour

Gets the hour that the forecasted weather will change

int WeatherForecastHour = UniStorm.UniStormManager.Instance.GetWeatherForecastHour();

ChangeWeatherEffectsState

Disables or enables all UniStorm particle effects depending on the ActiveState bool, but does not affect their emission amount.

UniStorm.UniStormManager.Instance.ChangeWeatherEffectsState(bool ActiveState);

ChangeWeatherSoundsState

Disables or enables all UniStorm weather sounds depending on the ActiveState bool, but does not affect their current volume.

UniStorm.UniStormManager.Instance.ChangeWeatherSoundsState(bool ActiveState);

Temperature

Get the current UniStorm temperature

int CurrentTemperature = UniStorm.UniStormSystem.Instance.Temperature;

โ€ƒ

Time

Minute

Get the current UniStorm Minute

int CurrentMinute = UniStorm.UniStormSystem.Instance.Minute;

Hour

Get the current UniStorm Hour

int CurrentHour = UniStorm.UniStormSystem.Instance.Hour;

Date

Sets UniStorm's Date

UniStorm.UniStormManager.Instance.SetDate(int Year, int Month, int Day);

Time

Sets UniStorm's Time

UniStorm.UniStormManager.Instance.SetTime (int Hour, int Minute);

CurrentTimeOfDayState

Get the current time of day state

UniStorm.UniStormSystem.CurrentTimeOfDayEnum CurrentTimeOfDayState = UniStorm.UniStormSystem.Instance.CurrentTimeOfDay;

SetDayLength

Sets the length, in minutes, of UniStorm's days

UniStorm.UniStormManager.Instance.SetDayLength(int MinuteLength);

SetNightLength

Sets the length, in minutes, of UniStorm's nights

UniStorm.UniStormManager.Instance.SetNightLength(int MinuteLength);

CurrentDayOfWeek

Gets the current UniStorm day of the week such as Monday, Tuesday, Wednesday, etc.

System.DayOfWeek CurrentDayOfWeek =  UniStorm.UniStormManager.Instance.GetDate().DayOfWeek;

CurrentDate

Gets the current UniStorm date

System.Date CurrentDate =  UniStorm.UniStormManager.Instance.GetDate().Date;

โ€ƒ

Volume

SetMusicVolume

Set UniStorm's Music volume using a value from 0 (Fully muted) to 1 (Full volume).

UniStorm.UniStormManager.Instance.SetMusicVolume(float Volume);

SetAmbienceVolume

Set UniStorm's Ambience volume using a value from 0 (Fully muted) to 1 (Full volume).

UniStorm.UniStormManager.Instance.SetAmbienceVolume(float Volume);

SetWeatherVolume

Set UniStorm's Weather volume using a value from 0 (Fully muted) to 1 (Full volume).

UniStorm.UniStormManager.Instance.SetWeatherVolume(float Volume);

โ€ƒ

Seasons

CurrentSeason

Get the current season

UniStorm.UniStormSystem.CurrentSeasonEnum currentSeason = UniStorm.UniStormSystem.Instance.CurrentSeason;

โ€ƒ

System

ChangeCameraSource

Changes the player camera and player transform UniStorm uses. This is useful if you need to change or update your player's camera.

UniStorm.UniStormManager.Instance.ChangeCameraSource(Transform PlayerTransform, Camera CameraSource);

โ€ƒ

Events

It is recommended that events be assigned on start and not used in update functions.

OnHourChangeEvent

Sets an event for the OnHourChangeEvent that can call functions each hour.

UniStorm.UniStormSystem.Instance.OnHourChangeEvent.AddListener(() => YourFunctionEvent());

OnDayChangeEvent

Sets an event for the OnDayChangeEvent that can call functions each day.

UniStorm.UniStormSystem.Instance.OnDayChangeEvent.AddListener(() => YourFunctionEvent());

OnMonthChangeEvent

Sets an event for the OnMonthChangeEvent that can call functions each month

UniStorm.UniStormSystem.Instance.OnMonthChangeEvent.AddListener(() => YourFunctionEvent());

OnYearChangeEvent

Sets an event for the OnYearChangeEvent that can call functions each year

UniStorm.UniStormSystem.Instance.OnYearChangeEvent.AddListener(() => YourFunctionEvent());

OnWeatherChangeEvent

Sets an event for the OnWeatherChangeEvent that can call functions each time the weather changes

UniStorm.UniStormSystem.Instance.OnWeatherChangeEvent.AddListener(() => YourFunctionEvent());

โ€ƒ

Other

ChangeMoonPhaseColor

Changes UniStorm's moon phase color. The updated color will be applied at noon when UniStorm's moon is updated.

UniStorm.UniStormManager.Instance.ChangeMoonPhaseColor(Color MoonPhaseColor)