Пример #1
0
        public void Add(CameraComponent camera)
        {
            camera.Group?.Remove(camera);

            if (_cameras.Add(camera))
            {
                camera.Group             = this;
                camera.EnabledChanged   += OnCameraEnabledChanged;
                camera.DrawOrderChanged += OnCameraDrawOrderChanged;
                camera.Destroyed        += OnCameraComponentDestroyed;

                if (camera.Enabled)
                {
                    _enabledCameras.Add(camera);
                }
            }
        }