Пример #1
0
        public void UpdateLogTextFieldAmounts()
        {
            int infos    = 0;
            int warnings = 0;
            int errors   = 0;

            for (int i = 0; i < instantiatedMessageObjects.Count; i++)
            {
                VRConsoleConsoleMessage consoleMessage = instantiatedMessageObjects[i].GetComponent <VRConsoleConsoleMessage>();

                if (consoleMessage.messageLogType == LogType.Log)
                {
                    infos++;
                }
                else if (consoleMessage.messageLogType == LogType.Warning)
                {
                    warnings++;
                }
                else if (consoleMessage.messageLogType == LogType.Error)
                {
                    errors++;
                }
            }

            infoMessagesAmount_Text.text    = infos.ToString();
            warningMessagesAmount_Text.text = warnings.ToString();
            errorMessagesAmount_Text.text   = errors.ToString();
        }
Пример #2
0
        public void UpdateWholeLog()
        {
            for (int i = 0; i < instantiatedMessageObjects.Count; i++)
            {
                VRConsoleConsoleMessage messageScript = instantiatedMessageObjects[i].GetComponent <VRConsoleConsoleMessage>();

                switch (messageScript.messageLogType)
                {
                case LogType.Error:
                    if (showErrorMessagesToggle.isOn)
                    {
                        instantiatedMessageObjects[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        instantiatedMessageObjects[i].gameObject.SetActive(false);
                    }
                    break;

                case LogType.Warning:
                    if (showWarningMessagesToggle.isOn)
                    {
                        instantiatedMessageObjects[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        instantiatedMessageObjects[i].gameObject.SetActive(false);
                    }
                    break;

                case LogType.Log:
                    if (showInfoMessagesToggle.isOn)
                    {
                        instantiatedMessageObjects[i].gameObject.SetActive(true);
                    }
                    else
                    {
                        instantiatedMessageObjects[i].gameObject.SetActive(false);
                    }
                    break;
                }
            }
            UpdateLogTextFieldAmounts();
            UpdateConsoleMessageColliders();
        }