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(); }
private void Init() { //TODO: Replace this with one activated from the core and figure out the min value. if (!G_FloatString.Inited || G_FloatString.MinValue > -1000f || G_FloatString.MaxValue < 16384f) { G_FloatString.Init ( minNegativeValue: -1001f, maxPositiveValue: 16386f ); } m_graphyManager = transform.root.GetComponentInChildren <GraphyManager>(); m_audioMonitor = GetComponent <G_AudioMonitor>(); UpdateParameters(); }
private void Init() { //TODO: Replace this with one activated from the core and figure out the min value. if (!G_FloatString.Inited || G_FloatString.MinValue > -1000f || G_FloatString.MaxValue < 16384f) { G_FloatString.Init ( minNegativeValue: -1001f, maxPositiveValue: 16386f ); } 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 = UnityEngine.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 + 10 ); m_backgroundImages[0].rectTransform.anchoredPosition = new Vector2 ( x: (preferredWidth + 15) / 2 * Mathf.Sign(m_backgroundImages[0].rectTransform.anchoredPosition.x), y: m_backgroundImages[0].rectTransform.anchoredPosition.y ); #endregion UpdateParameters(); }