Ejemplo n.º 1
0
        void OnDebugStateDataChanged(UIDebugStateData data)
        {
            if (!m_DialogWindow.open)
            {
                return;
            }

            if (m_CurrentStatsInfoData != data.statsInfoData)
            {
                if (m_CurrentStatsInfoData.fpsMax != data.statsInfoData.fpsMax)
                {
                    m_FpsMaxText.text  = k_StringDisplayCache[data.statsInfoData.fpsMax];
                    m_FpsMaxText.color = m_ColorGradient.Evaluate((float)data.statsInfoData.fpsMax / m_TargetFrameRate);
                }
                if (m_CurrentStatsInfoData.fpsAvg != data.statsInfoData.fpsAvg)
                {
                    m_FpsAvgText.text  = k_StringDisplayCache[data.statsInfoData.fpsAvg];
                    m_FpsAvgText.color = m_ColorGradient.Evaluate((float)data.statsInfoData.fpsAvg / m_TargetFrameRate);
                }
                if (m_CurrentStatsInfoData.fpsMin != data.statsInfoData.fpsMin)
                {
                    m_FpsMinText.text  = k_StringDisplayCache[data.statsInfoData.fpsMin];
                    m_FpsMinText.color = m_ColorGradient.Evaluate((float)data.statsInfoData.fpsMin / m_TargetFrameRate);
                }

                if (m_CurrentStatsInfoData.assetsCountData != data.statsInfoData.assetsCountData)
                {
                    m_AssetsAddedText.text   = data.statsInfoData.assetsCountData.addedCount.ToString();
                    m_AssetsChangedText.text = data.statsInfoData.assetsCountData.changedCount.ToString();
                    m_AssetsRemovedText.text = data.statsInfoData.assetsCountData.removedCount.ToString();
                }

                if (m_CurrentStatsInfoData.instancesCountData != data.statsInfoData.instancesCountData)
                {
                    m_InstancesAddedText.text   = data.statsInfoData.instancesCountData.addedCount.ToString();
                    m_InstancesChangedText.text = data.statsInfoData.instancesCountData.changedCount.ToString();
                    m_InstancesRemovedText.text = data.statsInfoData.instancesCountData.removedCount.ToString();
                }

                if (m_CurrentStatsInfoData.gameObjectsCountData != data.statsInfoData.gameObjectsCountData)
                {
                    m_GameObjectsAddedText.text   = data.statsInfoData.gameObjectsCountData.addedCount.ToString();
                    m_GameObjectsChangedText.text = data.statsInfoData.gameObjectsCountData.changedCount.ToString();
                    m_GameObjectsRemovedText.text = data.statsInfoData.gameObjectsCountData.removedCount.ToString();
                }

                m_CurrentStatsInfoData = data.statsInfoData;
            }
        }
Ejemplo n.º 2
0
        void OnStateDataChanged(UIStateData data)
        {
            m_StatsButton.selected            = data.activeDialog == DialogType.StatsInfo;
            m_StatsButton.button.interactable = data.toolbarsEnabled;

            if (m_CurrentStatsInfoData != data.statsInfoData)
            {
                if (m_CurrentStatsInfoData.fpsMax != data.statsInfoData.fpsMax)
                {
                    m_FpsMaxText.text  = data.statsInfoData.fpsMax.ToString();
                    m_FpsMaxText.color = m_ColorGradient.Evaluate((float)data.statsInfoData.fpsMax / m_TargetFrameRate);
                }
                if (m_CurrentStatsInfoData.fpsAvg != data.statsInfoData.fpsAvg)
                {
                    m_FpsAvgText.text  = data.statsInfoData.fpsAvg.ToString();
                    m_FpsAvgText.color = m_ColorGradient.Evaluate((float)data.statsInfoData.fpsAvg / m_TargetFrameRate);
                }
                if (m_CurrentStatsInfoData.fpsMin != data.statsInfoData.fpsMin)
                {
                    m_FpsMinText.text  = data.statsInfoData.fpsMin.ToString();
                    m_FpsMinText.color = m_ColorGradient.Evaluate((float)data.statsInfoData.fpsMin / m_TargetFrameRate);
                }

                m_AssetsAddedText.text   = data.statsInfoData.assetsCountData.addedCount.ToString();
                m_AssetsChangedText.text = data.statsInfoData.assetsCountData.changedCount.ToString();
                m_AssetsRemovedText.text = data.statsInfoData.assetsCountData.removedCount.ToString();

                m_InstancesAddedText.text   = data.statsInfoData.instancesCountData.addedCount.ToString();
                m_InstancesChangedText.text = data.statsInfoData.instancesCountData.changedCount.ToString();
                m_InstancesRemovedText.text = data.statsInfoData.instancesCountData.removedCount.ToString();

                m_GameObjectsAddedText.text   = data.statsInfoData.gameObjectsCountData.addedCount.ToString();
                m_GameObjectsChangedText.text = data.statsInfoData.gameObjectsCountData.changedCount.ToString();
                m_GameObjectsRemovedText.text = data.statsInfoData.gameObjectsCountData.removedCount.ToString();

                m_CurrentStatsInfoData = data.statsInfoData;
            }
        }