Example #1
0
        void Help(ConsoleCommand command, string[] args)
        {
            Debug.LogFormat("Available Commands:");

            foreach (var c in Commands)
            {
                if (c.Elevated)
                {
                    Debug.LogFormat("\t*{0} {1}", c.Command, c.Help);
                }
                else
                {
                    Debug.LogFormat("\t*{0} {1}", c.Command, c.Help);
                }
            }
        }
Example #2
0
 public void PrintError(ConsoleCommand consoleCommand)
 {
     Debug.LogErrorFormat("Incorrect number of arguments for {0}. Requires {1}", consoleCommand.Command, consoleCommand.Help);
 }
Example #3
0
 public void RegisterElevatedCommand(ConsoleCommand action)
 {
     action.MakeElevated();
     Commands.Add(action);
 }
Example #4
0
 public void RegisterCommand(ConsoleCommand action)
 {
     Commands.Add(action);
 }
Example #5
0
 void Execute(ConsoleCommand consoleCommand, string[] args)
 {
     consoleCommand.Action(consoleCommand, args);
 }