Ejemplo n.º 1
0
        public void Update()
        {
            if (m_SkyProfile == null || m_SkyProfile.IsFeatureEnabled(ProfileFeatureKeys.LightningFeature) == false)
            {
                ClearLightningRenderers();
                return;
            }

            if (m_SkyProfile.lightningArtSet == null || m_SkyProfile.lightningArtSet.lightingStyleItems == null ||
                m_SkyProfile.lightningArtSet.lightingStyleItems.Count == 0)
            {
                return;
            }

            if (m_SkyProfile.lightningArtSet.lightingStyleItems.Count != m_LightningRenderers.Count)
            {
                ClearLightningRenderers();
                CreateLightningRenderers();
            }

            // Assign a style to each renderer.
            for (int i = 0; i < m_SkyProfile.lightningArtSet.lightingStyleItems.Count; i++)
            {
                LightningArtItem  style = m_SkyProfile.lightningArtSet.lightingStyleItems[i];
                LightningRenderer lr    = m_LightningRenderers[i];

                lr.UpdateForTimeOfDay(m_SkyProfile, m_TimeOfDay, style);
            }
        }
Ejemplo n.º 2
0
        public void UpdateForTimeOfDay(SkyProfile skyProfile, float timeOfDay, LightningArtItem artItem)
        {
            m_SkyProfile = skyProfile;
            m_TimeOfDay  = timeOfDay;
            m_Style      = artItem;

            if (m_SkyProfile == null)
            {
                Debug.LogError("Assigned null sky profile!");
                return;
            }

            if (m_Style == null)
            {
                Debug.LogError("Can't render lightning without an art item");
                return;
            }

            SyncDataFromSkyProfile();
        }