Exemplo n.º 1
0
        private void OnGUI()
        {
            if (!_isOpened || _context == null)
            {
                return;
            }

            if (!_context.Style.IsInitialized)
            {
                _context.Style.Initialize();
            }

            // Start from 0
            _context.Y     = _scroll;
            _context.Index = 0;
            _context.Depth = 0;

            if (Event.current.type == EventType.Repaint)
            {
                _context.MouseCursorIsOverUI = false;
            }

            // Draw
            _root.Draw(_context);

            // Reset context
            _context.CollapseRequested = false;
            _context.ActionRequested   = false;
            _context.CursorIndex       = Mathf.Clamp(_context.CursorIndex, 0, _context.Index - 1);
        }
Exemplo n.º 2
0
        void OnGUI()
        {
            if (!_isOpened || _context == null)
            {
                return;
            }

            if (!_context.Style.IsInitialized)
            {
                _context.Style.Initialize();
            }

            // Start from 0
            _context.Y     = _scroll;
            _context.Index = 0;
            _context.Depth = 0;

            // Draw
            _root.Draw(_context);

            // Reset context
            _context.CollapseRequested = false;
            _context.ActionRequested   = false;
            _context.CursorIndex       = Mathf.Clamp(_context.CursorIndex, 0, _context.Index - 1);
        }