public override bool Init()
        {
            Instance = this;

            try
            {
                InitConsole();

                AutoCompleter.Init();

                ResetConsole(false);
                // Make sure compiler is supported on this platform
                Evaluator.Compile("new object();");

                return(true);
            }
            catch (Exception e)
            {
                string info = "The C# Console has been disabled because";
                if (e is NotSupportedException && e.TargetSite?.Name == "DefineDynamicAssembly")
                {
                    info += " Reflection.Emit is not supported.";
                }
                else
                {
                    info += $" of an unknown error.\r\n({e.ReflectionExToString()})";
                }

                ExplorerCore.LogWarning(info);

                this.RefNavbarButton.GetComponentInChildren <Text>().text += " (disabled)";

                return(false);
            }
        }
Пример #2
0
        public override bool Init()
        {
            Instance = this;

            try
            {
                InitConsole();

                AutoCompleter.Init();
#if MONO
                DummyBehaviour.Setup();
#endif

                ResetConsole(false);
                // Make sure compiler is supported on this platform
                Evaluator.Compile("");

                return(true);
            }
            catch (Exception e)
            {
                string info = "The C# Console has been disabled because";
                if (e is NotSupportedException && e.TargetSite?.Name == "DefineDynamicAssembly")
                {
                    info += " Reflection.Emit is not supported.";
                }
                else
                {
                    info += $" of an unknown error.\r\n({e.ReflectionExToString()})";
                }

                ExplorerCore.LogWarning(info);

                return(false);
            }
        }