Пример #1
0
        /// <summary>
        /// Uninitialize a service.
        /// </summary>
        /// <typeparam name="T">The interface type for the service to uninitialize.</typeparam>
        protected virtual void Uninitialize <T>() where T : IMixedRealityService
        {
            T serviceInstance = FindService <T>();

            if (serviceInstance != null)
            {
                registeredServices.Remove(typeof(T));
                MixedRealityServiceRegistry.RemoveService <T>(serviceInstance, this);
            }
        }
        /// <inheritdoc />
        public bool UnregisterService<T>(T serviceInstance) where T : IMixedRealityService
        {
            if (serviceInstance == null) { return false; }

            Type interfaceType = typeof(T);
            if (!registeredServices.ContainsKey(interfaceType)) { return false; }

            registeredServices.Remove(interfaceType);
            return MixedRealityServiceRegistry.RemoveService<T>(serviceInstance, this);
        }