예제 #1
0
        private void OnPreviewContentStageMouseWheel(object sender, MouseWheelEventArgs e)
        {
            var obj = e.OriginalSource as DependencyObject;

            do
            {
                if (obj == null)
                {
                    break;
                }

                var scrollViewer = obj as ScrollViewer;
                if (scrollViewer != null)
                {
                    if (scrollViewer.Equals(ContentStage))
                    {
                        ContentStage.ScrollToHorizontalOffset(ContentStage.ContentHorizontalOffset - e.Delta);
                        e.Handled = true;
                    }

                    break;
                }

                obj = VisualTreeHelper.GetParent(obj);
            }while (obj != null);
        }
예제 #2
0
    private void OnLineCreated(Vector3[] linePoints, GeometryPoint[] points)
    {
        var sortedPoints = points.Select(p => p.Name).OrderBy(p => p);
        var key          = string.Join("-", sortedPoints);
        var content      = geometry.Contents.FirstOrDefault(c => c.Key == key);

        if (content == null || content.ContentPrefab == null)
        {
            OnLineDestroyed();
            return;
        }

        foreach (var ui in userInterfaces)
        {
            ui.SetActive(false);
        }

        if (_zoomedIn)
        {
            StartCoroutine(OpenContent(0.5f));
        }

        _currentStage = Instantiate(content.ContentPrefab, contentContainer.position, Quaternion.identity);
        _currentStage.transform.SetParent(contentContainer);
        _currentStage.Inject(geometry);
    }