Beispiel #1
0
        void SubscribeInternal(SignalSubscriptionId id, Action <object> callback)
        {
            Assert.That(!_subscriptionMap.ContainsKey(id),
                        "Tried subscribing to the same signal with the same callback on Zenject.SignalBus");

            var declaration  = GetDeclaration(id.SignalId, true);
            var subscription = _subscriptionPool.Spawn(callback, declaration);

            _subscriptionMap.Add(id, subscription);
        }
Beispiel #2
0
        void SubscribeInternal(SignalSubscriptionId id, Action <object> callback)
        {
            Assert.That(!_subscriptionMap.ContainsKey(id),
                        "Tried subscribing to the same signal with the same callback on Zenject.SignalBus");

            var declaration = GetDeclaration(id.SignalId);

            if (declaration == null)
            {
                throw Assert.CreateException("Tried subscribing to undeclared signal '{0}'!", id.SignalId);
            }

            var subscription = _subscriptionPool.Spawn(callback, declaration);

            _subscriptionMap.Add(id, subscription);
        }