Beispiel #1
0
        private void InstallFightComponents()
        {
            if (mockFightInfo == null)
            {
                _logger.Log(ELogType.Error, "FightInfo is null on fight scene context");
                return;
            }

            Container.BindInterfacesTo <FightInfo>().AsSingle().WithArguments(mockFightInfo);
            Container.BindInterfacesTo <FightGameLoop>().AsSingle().NonLazy();
        }
Beispiel #2
0
        private void RemoveInputListenerInternal(KeyCode keyCode, Action callback)
        {
            var listenersContainer = GetOrCreateListenersForKey(keyCode);

            if (listenersContainer.Count == 0)
            {
                _logger.Log(ELogType.Error, $"Trying to remove input listener for key {keyCode}, but there are no listeners.");
            }

            if (!listenersContainer.Contains(callback))
            {
                _logger.Log(ELogType.Error, $"Trying to remove input listener that is not bound to key {keyCode}");
                return;
            }

            listenersContainer.Remove(callback);
            if (listenersContainer.Count == 0)
            {
                _inputListeners.Remove(keyCode);
                _trackedKeys.Remove(keyCode);
            }
        }