private void ExecuteCommandAtIndex(int index) { if (!objects_.ContainsIndex(index)) { Debug.LogError("Can't execute command with index because out-of-bounds: " + index); return; } ICommand command = objects_[index]; EditorApplication.delayCall += () => { ICommandWithArguments commandWithArguments = command as ICommandWithArguments; if (commandWithArguments != null && commandWithArguments.Arguments.Length > 0) { inProgressCommand_ = new InProgressCommand(commandWithArguments, HandleInProgressCommandFinished); } else { command.Execute(); } }; CloseIfNotClosing(); }
private void HandleInProgressCommandFinished() { inProgressCommand_ = null; }