public void CommandCompleted(ICommand command)
 {
     if (command == exampleRandomBoolCommand)
     {
         ICommand          resultCommand;
         ExampleDataObject resultData = (ExampleDataObject)exampleRandomBoolCommand.data;
         if (resultData.result)
         {
             resultCommand = new ExampleResultTrueCommand();
         }
         else
         {
             resultCommand = new ExampleResultFalseCommand();
         }
         resultCommand.Init();
         resultCommand.AddCallback(this);
         resultCommand.Execute();
     }
     else
     {
         Debug.Log("<ExampleWrapperCommand> Complete!");
         command.Dispose();
         Complete();
     }
 }
Пример #2
0
        protected override void ExecuteVirtual()
        {
            ExampleDataObject exampleCommandData = (ExampleDataObject)data;

            exampleCommandData.result = (Random.value > 0.5f);

            Debug.Log("<ExampleRandomBoolCommand> Complete!");

            Complete();
        }