Esempio n. 1
0
        public static void Remove(IBoundsProvider boundsProvider)
        {
            Debug.Log("Removing bounds provider " + boundsProvider.BoundsProviderKey);

            if (!BoundsProviders.Contains(boundsProvider))
            {
                throw new InvalidOperationException("This BoundsProvider is not registered.");
            }

            BoundsProviders.Remove(boundsProvider);

            BoundsProviderRemoved(boundsProvider);
        }
Esempio n. 2
0
        public static void Add(IBoundsProvider boundsProvider)
        {
            if (BoundsProviders.Contains(boundsProvider))
            {
                throw new InvalidOperationException("This BoundsProvider is already registered. Key " + boundsProvider.BoundsProviderKey);
            }

            if (BoundsProviders.Any(p => p.BoundsProviderKey == boundsProvider.BoundsProviderKey))
            {
                Debug.LogWarning("A different BoundsProvider with the same key is already registered. Key " + boundsProvider.BoundsProviderKey + ". Proceeding to register second BoundsProvider.");
            }
            //    throw new InvalidOperationException("A different BoundsProvider with the same key is already registered. Key " + boundsProvider.BoundsProviderKey );

            BoundsProviders.Add(boundsProvider);

            BoundsProviderAdded(boundsProvider);
        }