Example #1
0
        /// <inheritdoc/>
        public override void Enable()
        {
            base.Enable();

            if (observers.Count != 0)
            {
                // todo: ensure this is a clean pattern
                Debug.LogWarning("The spatial awareness system is already enabled.");
                return;
            }

            // Get the collection of registered observers.
            IReadOnlyList <IMixedRealitySpatialAwarenessObserver> services = Registrar.GetServices <IMixedRealitySpatialAwarenessObserver>();

            for (int i = 0; i < services.Count; i++)
            {
                observers.Add(services[i] as IMixedRealitySpatialAwarenessObserver);
            }
        }