public DesktopUserInput(Material opaqueMaterial, BackendRouter backend, SavedViews savedViews)
        {
            _backend           = backend;
            _selectionMaterial = new Material(opaqueMaterial)
            {
                color = Color.magenta
            };
            _savedViews = savedViews;

            _camera          = Camera.main;
            _cameraTransform = _camera.transform;
        }
示例#2
0
        private void Start()
        {
            Physics.queriesHitBackfaces = true;

            // Address must match ProtobufRpcServer.ts
            _backend = new BackendRouter("ws://localhost:3005", () =>
            {
                _isBackendSetup = true;
                _coordinateUtility.CalculateOffsetFromProjectExtents();
                _savedViews.RequestViewsFromBackend();
            });
            _coordinateUtility = new CoordinateUtility(_backend);
            _savedViews        = new SavedViews(Camera.main, _coordinateUtility, _backend);
            _userInput         = new DesktopUserInput(OpaqueMaterial, _backend, _savedViews);

            _meshReader         = new ElementMeshReader(_coordinateUtility);
            _meshRequestManager = new ExportMeshRequestManager(_backend, _meshReader);
            _graphicsStreaming  = new GraphicsStreaming(_backend, _meshRequestManager, _coordinateUtility);

            _textureCache = new TextureCache(_backend);
            _meshHandler  = new ElementGameObjectCreator(OpaqueMaterial, TransparentMaterial, _textureCache);
        }