Jump to content

GaiaAPI "GetTimeOfDayEnabled()" returns false with HDRP Time of Day enabled


mroshaw
Go to solution Solved by Josh,

Recommended Posts

Hi!

I'm trying to make us of timed spawns in the awesome new "Soul Link Procedural Spawner" asset. It uses the "GaiaAPI" to get the state of both "time of day" and "weather conditions" from Gaia.

What I've found is that with the HDRP Time of Day system enabled, the GaiaAPI call to "GetTimeOfDayEnabled" returns false. I assume that, because I have HDRP Time of Day enabled, this should return true? I'm using the latest Gaia Pro 2021 (3.2.5).

Thanks for your thoughts!

Oli

 

Link to comment
Share on other sites

  • Solution
On 7/3/2022 at 8:12 PM, mroshaw said:

Hi!

I'm trying to make us of timed spawns in the awesome new "Soul Link Procedural Spawner" asset. It uses the "GaiaAPI" to get the state of both "time of day" and "weather conditions" from Gaia.

What I've found is that with the HDRP Time of Day system enabled, the GaiaAPI call to "GetTimeOfDayEnabled" returns false. I assume that, because I have HDRP Time of Day enabled, this should return true? I'm using the latest Gaia Pro 2021 (3.2.5).

Thanks for your thoughts!

Oli

 

Hey, yes it seems that HDRP Time Of Day was not added to this gaia API yet, i have added it now and will be added in a Gaia update. For now you can replace the function with this updated version just select all the function and just paste the new code i have sent below.

        /// <summary>
        /// Gets if time of day is enabled
        /// </summary>
        /// <returns></returns>
        public static bool GetTimeOfDayEnabled()
        {
            if (GaiaUtils.GetActivePipeline() != GaiaConstants.EnvironmentRenderer.HighDefinition)
            {
                if (GaiaUtils.CheckIfSceneProfileExists())
                {
                    return GaiaGlobal.Instance.GaiaTimeOfDayValue.m_todEnabled;
                }
            }
            else
            {
#if HDPipeline && UNITY_2021_2_OR_NEWER
                HDRPTimeOfDayAPI.GetAutoUpdateMultiplier(out bool autoUpdate, out float value);
                return autoUpdate;
#endif
            }

            return false;
        }

 

  • Like 1
Link to comment
Share on other sites

  • Bryan locked this topic
Guest
This topic is now closed to further replies.
  • 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...