Пример #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);
                }
            }
        }
Пример #2
0
 public void PrintError(ConsoleCommand consoleCommand)
 {
     Debug.LogErrorFormat("Incorrect number of arguments for {0}. Requires {1}", consoleCommand.Command, consoleCommand.Help);
 }
Пример #3
0
 public void RegisterElevatedCommand(ConsoleCommand action)
 {
     action.MakeElevated();
     Commands.Add(action);
 }
Пример #4
0
 public void RegisterCommand(ConsoleCommand action)
 {
     Commands.Add(action);
 }
Пример #5
0
 void Execute(ConsoleCommand consoleCommand, string[] args)
 {
     consoleCommand.Action(consoleCommand, args);
 }