Пример #1
0
        void ReleaseCommands()
        {
            IBaseCommand[] clone = new IBaseCommand[_retained.Count];
            _retained.CopyTo(clone);

            for (int i = 0, cloneLength = clone.Length; i < cloneLength; i++)
            {
                IBaseCommand command = clone[i];
                command.Release();
                command.onFinish -= OnFinish;
            }
        }
Пример #2
0
        void ExecuteCommand(Type type, Action <IBaseCommand> executeCommand)
        {
            IBaseCommand command = GetCommand(type);

            executeCommand(command);

            if (command.isRetained)
            {
                _retained.Add(command);
            }
            else
            {
                command.Release();
            }
        }