Jump to content

Referencing TIme of Day in code


NoobsGaming

Recommended Posts

Hi there, 

I am working on a game that incorporates calorie usage and other survival mechanics into the game play. I would like to be able to reference the Time of Day with the scripts in my game to do two things: 

  • I want to be able to reference Time Scale to allow it to be changed in a settings screen. 
  • I want to be able to read the Hours and Minutes to use as a counter for how fast calories and hydration are depleted, along with some other like survival mechanics. 

I am using the Time of Day that is native to Gaia Pro 2021. Because my project is currently in Universal Render Pipeline.  

I would very much appreciate the appropriate coding references. I tried to self-serve, but I couldn't find anything in the documentation that is currently available. 

Link to comment
Share on other sites

I would imagine that you are going to need to tie into the HDRPTimeOfDay.CS
Then I would take a look around the Variables Region - line 570. 

Or better yet, take a look at HDRPTimeOfDayAPI.CS 
Line 58 Public static float GetCurrentTime(). 

Either one of these I think is what you are after. 
 

Link to comment
Share on other sites

On 2/23/2023 at 4:12 PM, Bryan said:

I would imagine that you are going to need to tie into the HDRPTimeOfDay.CS
Then I would take a look around the Variables Region - line 570. 

Or better yet, take a look at HDRPTimeOfDayAPI.CS 
Line 58 Public static float GetCurrentTime(). 

Either one of these I think is what you are after. 
 

that sounds right, thanks! I'll respond later if i'm having any trouble with it. 

~Keith

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...