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); }
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); }