コード例 #1
0
        private void Init()
        {
            G_IntString.Init(-80, 0);   // dB range

            m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>();

            m_audioMonitor = GetComponent <G_AudioMonitor>();

            UpdateParameters();
        }
コード例 #2
0
        private void Init()
        {
            G_IntString.Init(0, 2000);    // Max fps expected
            G_FloatString.Init(0, 100);   // Max ms expected per frame

            m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>();

            m_fpsMonitor = GetComponent <G_FpsMonitor>();

            UpdateParameters();
        }
コード例 #3
0
        private void Init()
        {
            // We assume no game will consume more than 16GB of RAM.
            // If it does, who cares about some minuscule garbage allocation lol.
            G_IntString.Init(0, 16386);

            m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>();

            m_ramMonitor = GetComponent <G_RamMonitor>();

            UpdateParameters();
        }
コード例 #4
0
ファイル: G_FpsText.cs プロジェクト: merc37/TBDB
        private void Init()
        {
            //TODO: Replace this with one activated from the core and figure out the min value.
            if (!G_IntString.Inited || G_IntString.MinValue > m_minFps || G_IntString.MaxValue < m_maxFps)
            {
                G_IntString.Init
                (
                    minNegativeValue: m_minFps,
                    maxPositiveValue: m_maxFps
                );
            }

            m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>();

            m_fpsMonitor = GetComponent <G_FpsMonitor>();

            UpdateParameters();
        }
コード例 #5
0
 private void OnDestroy()
 {
     G_IntString.Dispose();
     G_FloatString.Dispose();
 }
コード例 #6
0
        private void Init()
        {
            G_IntString.Init(0, 7680);

            m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>();

            m_sb = new StringBuilder();

            m_rectTransform = GetComponent <RectTransform>();

            #region Section -> Text

            m_processorTypeText.text
                = "CPU: "
                  + SystemInfo.processorType
                  + " ["
                  + SystemInfo.processorCount
                  + " cores]";

            m_systemMemoryText.text
                = "RAM: "
                  + SystemInfo.systemMemorySize
                  + " MB";

            m_graphicsDeviceVersionText.text
                = "Graphics API: "
                  + SystemInfo.graphicsDeviceVersion;

            m_graphicsDeviceNameText.text
                = "GPU: "
                  + SystemInfo.graphicsDeviceName;

            m_graphicsMemorySizeText.text
                = "VRAM: "
                  + SystemInfo.graphicsMemorySize
                  + "MB. Max texture size: "
                  + SystemInfo.maxTextureSize
                  + "px. Shader level: "
                  + SystemInfo.graphicsShaderLevel;

            Resolution res = Screen.currentResolution;

            m_screenResolutionText.text
                = "Screen: "
                  + res.width
                  + "x"
                  + res.height
                  + "@"
                  + res.refreshRate
                  + "Hz";

            m_operatingSystemText.text
                = "OS: "
                  + SystemInfo.operatingSystem
                  + " ["
                  + SystemInfo.deviceType
                  + "]";

            float preferredWidth = 0;

            // Resize the background overlay

            List <Text> texts = new List <Text>()
            {
                m_graphicsDeviceVersionText,
                m_processorTypeText,
                m_systemMemoryText,
                m_graphicsDeviceNameText,
                m_graphicsMemorySizeText,
                m_screenResolutionText,
                m_gameWindowResolutionText,
                m_operatingSystemText
            };

            foreach (var text in texts)
            {
                if (text.preferredWidth > preferredWidth)
                {
                    preferredWidth = text.preferredWidth;
                }
            }

            #endregion

            #region Section -> Background Images

            m_backgroundImages[0].rectTransform.SetSizeWithCurrentAnchors
            (
                axis: RectTransform.Axis.Horizontal,
                size: preferredWidth + 25
            );

            m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2
                                                                   (
                x: (preferredWidth + 25) / 2 * Mathf.Sign(m_backgroundImages[0].rectTransform.anchoredPosition.x),
                y: m_backgroundImages[0].rectTransform.anchoredPosition.y
                                                                   );

            #endregion

            UpdateParameters();
        }