internal SelectorLayout(SelectorView selectorView, float windowTop, ScaleSettings scaling)
            : base(selectorView, windowTop, scaling)
        {
            _selectorView = selectorView;

            float leftMost  = _localViewRange.xMin;
            float rightMost = _localViewRange.xMax;

            _dragArea = new XRange(leftMost, scaling.dragHandleWidth);
            leftMost += scaling.dragHandleWidth;

            rightMost  -= scaling.anchorAreaWidth;
            _anchorArea = new XRange(rightMost, scaling.anchorAreaWidth);
            _toggleArea = new XRange(rightMost, scaling.toggleAreaWidth);

            if (EditorApplication.isPlaying)
            {
                var remainder      = rightMost - leftMost;
                var scoreAreaWidth = remainder * 0.25f;

                rightMost -= scoreAreaWidth;
                _scoreArea = new XRange(rightMost, scoreAreaWidth);
            }

            _contentArea = new XRange(leftMost, rightMost - leftMost);
        }
Beispiel #2
0
        internal AILinkLayout(AILinkView linkView, float windowTop, ScaleSettings scaling)
            : base(linkView, windowTop, scaling)
        {
            var zoom = scaling.scale;

            _containerHeight = scaling.aiLinkBodyHeight;
            _nameArea        = new XRange(_localViewRange.xMin + (10f * zoom), _localViewRange.width - ((_showAreaWidth + 10f) * zoom));
            _showArea        = new XRange(_nameArea.xMax, _showAreaWidth * zoom);
        }
Beispiel #3
0
        public ViewLayout(TopLevelView view, float windowTop, ScaleSettings scaling)
        {
            _viewRect = view.viewArea;
            _scaling  = scaling;

            _localViewRange = new XRange(scaling.selectorResizeMargin, _viewRect.xMax - _viewRect.xMin - (2f * scaling.selectorResizeMargin));

            var ymin = Mathf.Max(_viewRect.y, windowTop);

            _leftResizeArea  = new Rect(_viewRect.xMin, ymin, scaling.selectorResizeMargin, _viewRect.height);
            _rightResizeArea = new Rect(_viewRect.xMax - scaling.selectorResizeMargin, ymin, scaling.selectorResizeMargin, _viewRect.height);
        }
        internal VisualizedEntityLayout(Rect windowRect, float windowTop)
        {
            _windowTop = windowTop - 1f;

            _area = new Rect((windowRect.width - _visualizedEntityWidth) * 0.5f, _windowTop, _visualizedEntityWidth, _visualizedEntityHeight);

            float contentStart = _area.x + 5f;

            _resetArea  = new XRange(contentStart + (_visualizedEntityWidth - 25f), 20f);
            _stickyArea = new XRange(contentStart + (_visualizedEntityWidth - 45f), 20f);
            _nameArea   = new XRange(contentStart, _area.width - 40f);
        }