Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private void HandleInProgressCommandFinished()
 {
     inProgressCommand_ = null;
 }