Beispiel #1
0
        public override void OnInspectorGUI()
        {
            QuantumConsole consoleInstance = FindQuantumConsoleInstance();

            if (consoleInstance == null)
            {
                GUILayout.Label(m_MissingConsoleInstanceContent, Styles.DescriptionLabelWarning);
                using (new GUILayout.HorizontalScope())
                {
                    if (GUILayout.Button("Visit Github"))
                    {
                    }
                    if (GUILayout.Button("Open Readme"))
                    {
                    }
                }

                return;
            }

            if (consoleInstance is ChirpQuantumConsole == false)
            {
                GUILayout.Label(m_ConsoleNotConvertedContent, Styles.DescriptionLabelWarning);
                if (GUILayout.Button("Perform Conversion"))
                {
                    consoleInstance = ChirpQuantumConsoleConverter.ConvertQuantumConsole(consoleInstance);
                    ChirpQuantumConsoleConfigurator.ConfigureForChirp(consoleInstance);
                }

                return;
            }

            if (consoleInstance is ChirpQuantumConsole chirpQuantumInstance)
            {
                bool isValid = ChirpQuantumConsoleConfigurator.VerifyConfiguration(chirpQuantumInstance, out string error);

                if (isValid)
                {
                    GUILayout.Label("Console instance has been found and is configured correctly.");
                    GUILayout.Label(error, Styles.DescriptionLabel);
                }
                else
                {
                    GUILayout.Label(m_ConsoleNotConfiguredContent, Styles.DescriptionLabelWarning);
                    GUILayout.Label(error, Styles.DescriptionLabel);
                    if (GUILayout.Button("Configure Automatically"))
                    {
                        ChirpQuantumConsoleConfigurator.ConfigureForChirp(consoleInstance);
                    }
                }
            }
        }
        private static void ConvertQuantumConsole(MenuCommand command)
        {
            QuantumConsole source = command.context as QuantumConsole;

            if (source == null)
            {
                return;
            }

            source = ConvertQuantumConsole(source);

                        #if CHIRP
            if (EditorUtility.DisplayDialog("Chirp Logging Framework Integration",
                                            $"It appears you have the Chirp Logging Framework enabled in your project. Would you like to configure the console for it?",
                                            "Yes", "Not Now"))
            {
                ChirpQuantumConsoleConfigurator.ConfigureForChirp(source);
            }
                        #endif
        }