Get current time:
int currentSecond = EnviroSky.instance.GameTime.Seconds;
int currentMinute = EnviroSky.instance.GameTime.Minutes;
int currentHour = EnviroSky.instance.GameTime.Hours;
int currentDay = EnviroSky.instance.GameTime.Days;
int currentYear = EnviroSky.instance.GameTime.Years;
float timeOfDay = EnviroSky.instance.internalHour;
Getcurrent sun and moon “time” based on position in sky (0-1):
float solarTime = EnviroSky.instance.GameTime.solarTime;
float lunarTime = EnviroSky.instance.GameTime.lunarTime;
Set time:
EnviroSky.instance.SetInternalTimeOfDay(float internalHour);
EnviroSky.instance.SetTime(int year,int day,int hour,int minute,int second);
EnviroSky.instance.SetTime(System.DateTime dateTime);
It looks like you're new here. If you want to get involved, click one of these buttons!
- Is Static: enable
- Class Name: EnviroSky
- FunctionName: instance.SetTime
Add 5 Int parameters for year, day, hour, minute and second, which can e.g. get their values from int or float variables.
To store one of EnviroSky's values into variables, use a Store Field node, e.g. for seconds:
- Is Static: enable
- Class Name: EnviroSky
- Field Name: instance.GameTime.Seconds
- Is Property: I'd guess they're properties, so try enabling them, if you get a warning/error in the Unity console that no property is found, disable it
It'll store the value into the defined variable, since these are int values, it'll automatically store them as int variables.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!