protected override void SetupCommands() { // add a single command to the root commands rootCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 1")); // added parallel commands to the root ParallelCommands parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 2")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 3")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 4")); rootCommands.AddCommand(parallelCommands); parallelCommands = new ParallelCommands(); // add serial commmands to parallel commands then add to root SerialCommands serialCommands = new SerialCommands(); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 5")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 6")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 7")); parallelCommands.AddCommand(serialCommands); // add serial commmands to parallel commands then add to root serialCommands = new SerialCommands(); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 8")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 9")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 10")); parallelCommands.AddCommand(serialCommands); // add serial commmands to parallel commands then add to root rootCommands.AddCommand(parallelCommands); serialCommands = new SerialCommands(); // Add parallel commands to serial commands then add to root parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 11")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 12")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 13")); serialCommands.AddCommand(parallelCommands); // Add parallel commands to serial commands then add to root parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 14")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 15")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 16")); serialCommands.AddCommand(parallelCommands); // Add parallel commands to serial commands then add to root rootCommands.AddCommand(serialCommands); // add parallel commands to the root parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 17")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 18")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 19")); rootCommands.AddCommand(parallelCommands); // add the lighter commands that don't have the built in reference to a MonoBehaviour Object rootCommands.AddCommand(new ExampleCommand().Init(null, "Command 20")); }
protected override void SetupCommands() { // add a single command to the root commands rootCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 21")); // added parallel commands to the root ParallelCommands parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 22")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 23")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 24")); rootCommands.AddCommand(parallelCommands); parallelCommands = new ParallelCommands(); // add serial commmands to parallel commands then add to root SerialCommands serialCommands = new SerialCommands(); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 25")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 26")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 27")); parallelCommands.AddCommand(serialCommands); // add serial commmands to parallel commands then add to root serialCommands = new SerialCommands(); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 28")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 29")); serialCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 30")); parallelCommands.AddCommand(serialCommands); // add serial commmands to parallel commands then add to root rootCommands.AddCommand(parallelCommands); serialCommands = new SerialCommands(); // Add parallel commands to serial commands then add to root parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 31")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 32")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 33")); serialCommands.AddCommand(parallelCommands); // Add parallel commands to serial commands then add to root parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 34")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 35")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 36")); serialCommands.AddCommand(parallelCommands); // Add parallel commands to serial commands then add to root rootCommands.AddCommand(serialCommands); // add parallel commands to the root parallelCommands = new ParallelCommands(); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 37")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 38")); parallelCommands.AddCommand(new ExampleMonoBehaviourCommand().Init(monoBehaviourObject, null, "Command 39")); rootCommands.AddCommand(parallelCommands); // add the lighter commands that don't have the built in reference to a MonoBehaviour Object rootCommands.AddCommand(new ExampleCommand().Init(null, "Command 40")); // This shows a basic concrete command using other commands. rootCommands.AddCommand(new ExampleWrapperCommand().Init()); // This shows a basic concrete command using a Serial Command. It's probably best to not create child classes of SerialCommands and ParrellelComands to avoid too much polymorphing. // Instead try encapsulating them in a child of a basic Command, look at the above ExampleWrapperCommand example. rootCommands.AddCommand(new ExampleSerialCommand().Init()); }