// Use this for initialization

    void Awake()
    {
        Debug.Assert(ipcControllerInstances == 0, "Two instances of IPCController were created, only one is allowed.");
        Debug.Assert(singleton == null, "Two instances of IPCController were created, only one is allowed.");

        ipcControllerInstances = 1;
        singleton = this;
    }
示例#2
0
        /// <summary>
        /// Инициализирует новый экземпляр класса <see cref="Application"/>.
        /// </summary>
        /// <param name="settings">Настройки приложения.</param>
        /// <param name="pcController">Контроллер Producer-Consumer.</param>
        public Application(Settings settings, IPCController <string> pcController)
        {
            _settings = settings
                        ?? throw new ArgumentNullException(nameof(settings));

            _pcController = pcController
                            ?? throw new ArgumentNullException(nameof(pcController));

            _delayTime = TimeSpan.FromSeconds(_settings.DelayTimeInSec);
        }