Exemple #1
0
        public void Submit(string message)
        {
            if (message.Length == 0)
            {
                return;
            }

            string[] tokens  = message.Split(' ');
            string   command = tokens[0];

            string[] args = new string[tokens.Length - 1];
            for (int i = 0; i < args.Length; ++i)
            {
                args[i] = tokens[i + 1];
            }

            message = Sanitize(message);

            Console.Log(message);
            string msg = ConsoleCommandDatabase.ExecuteCommand(command, args);

            if (msg != null && msg.Length != 0)
            {
                Console.Log(msg);
            }
        }
Exemple #2
0
        void Awake()
        {
            GenerateTexture();
            Application.logMessageReceived += Console.HandleLog;
            Console.onLogged += OnLogged;
            commands          = ConsoleCommandDatabase.commands;

            ConsoleCommandDatabase.FindAndRegisterCommands(System.Reflection.Assembly.GetCallingAssembly());
        }