/* methods */
    protected override void DoEnable()
    {
        base.DoEnable();

        UiManager.Instance.backGround.switchBackGround("loginBackGround");
        initServerButtons(ServerManagerment.Instance.lastServer);
        List <Json_ServerInfo> serverList = ServerManagerment.Instance.getAllServer();

        foreach (Json_ServerInfo each in serverList)
        {
            GameObject   obj    = NGUITools.AddChild(ScrollContent.gameObject, serverButtonPrefab);
            ServerButton button = obj.GetComponent <ServerButton> ();
            button.initButton(each);
            button.fatherWindow = this;
            obj.AddComponent <UIDragScrollView> ();
        }
        UIGrid grid = ScrollContent.GetComponent <UIGrid> ();

        grid.enabled = true;
        grid.Reposition();
        if (GuideManager.Instance.guideUI != null)
        {
            GuideManager.Instance.hideGuideUI();
        }
        if (serverList.Count > 8)
        {
            downArrow.SetActive(true);
        }
        MaskWindow.UnlockUI();
    }
Beispiel #2
0
 void ChangeScroll(Vector2 perPos, Vector2 perOff, bool Add = false)
 {
     if (isChangePos)
     {
         if (tempChange < 20)
         {
             if (Add)
             {
                 scrollView.transform.localPosition             = new Vector2(scrollView.transform.localPosition.x + perPos.x, scrollView.transform.localPosition.y + perPos.y);
                 scrollView.GetComponent <UIPanel>().clipOffset = new Vector2(scrollView.GetComponent <UIPanel>().clipOffset.x + perOff.x, scrollView.GetComponent <UIPanel>().clipOffset.y + perOff.y);
             }
             else
             {
                 scrollView.transform.localPosition             = new Vector2(scrollView.transform.localPosition.x - perPos.x, scrollView.transform.localPosition.y - perPos.y);
                 scrollView.GetComponent <UIPanel>().clipOffset = new Vector2(scrollView.GetComponent <UIPanel>().clipOffset.x - perOff.x, scrollView.GetComponent <UIPanel>().clipOffset.y - perOff.y);
             }
             tempChange += 1;
         }
         else
         {
             tempChange  = 0;
             isChangePos = false;
         }
     }
 }
Beispiel #3
0
    public void ResetDeskGrid()
    {
        UIGrid       tempGrid = m_objDeskGrid.GetComponent <UIGrid>();
        UIScrollView tempScrollView = m_objDeskGrid.GetComponentInParent <UIScrollView>();
        int          viewWidth, cellWidth, cellHeight, widthInterval, heightInterval, cellColumn, cellRow;
        int          miniWidthInterval  = 5;
        int          miniHeightInterval = 40;

        cellWidth     = m_objCurDesk.GetComponent <UIWidget>().width;
        cellHeight    = m_objCurDesk.GetComponent <UIWidget>().height;
        viewWidth     = ((int)(tempScrollView.GetComponent <UIPanel>().GetWindowSize().x - 305));
        cellColumn    = ((int)(tempScrollView.GetComponent <UIPanel>().GetWindowSize().x - 305)) / (cellWidth);
        cellRow       = System.Convert.ToInt32(m_lstGameDeskList.Count / cellColumn);
        widthInterval = (viewWidth - cellWidth * cellColumn) / (cellColumn + 1);
        int tempColumn = 0;
        int tempRow    = 0;

        for (int i = 0; i < m_lstGameDeskList.Count; i++)
        {
            float tempX = widthInterval + (tempColumn * (widthInterval + cellWidth));
            float tempY = (miniHeightInterval + (tempRow * (miniHeightInterval + cellHeight))) * -1;
            m_lstGameDeskList [i].transform.localPosition = new Vector3(tempX, tempY, 0f);
            if (++tempColumn == cellColumn)
            {
                tempColumn = 0;
                tempRow++;
            }
        }
        Debug.LogWarning("deskReposition!!!!!!!" + viewWidth.ToString() + "  ");
//		uiConfig.page_roomDesk.transform.FindChild ("desk_scrollBar").GetComponent<UIScrollBar> ().value = 0;
        tempScrollView.ResetPosition();
    }
Beispiel #4
0
    public void ToggleSelectItem(List <int> items)
    {
        arrowUpDown[0].gameObject.SetActive(false);
        arrowUpDown[1].gameObject.SetActive(true);
        //ScView.enabled = false;
        //buyPackageHead.transform.parent.localPosition = orignalPos;
        //ScView.GetComponent<UIPanel>().baseClipRegion = orignalRangle;
        //ScView.GetComponent<UIPanel>().clipOffset = orginalOffset;
        //ScView.enabled = true;
        ScView.ResetPosition();
        ScView.enabled = false;
        buyPackageHead.transform.parent.localPosition  = orignalPos;
        ScView.GetComponent <UIPanel>().baseClipRegion = orignalRangle;
        ScView.GetComponent <UIPanel>().clipOffset     = orginalOffset;
        ScView.enabled = true;
        ItemsInUserInterface.Clear();

        ItemBuyList          = items;
        ItemsInUserInterface = SortItemByPrice(items);

        UIShop.Instance.itemDestribe.ShowItemDestribe(items.ElementAt(0));
        AutoCreateItems(ItemsInUserInterface.Count, buyPackageHead, GameDefine.GameConstDefine.BuyPackItemPath);
        this.OnShowItemInUserInterface();
        OnButtonClickFunc(0);
        turnPage.Reset();
    }
Beispiel #5
0
    void OnEnable()
    {
        UIPanel scrollPanel = m_Scroll.GetComponent <UIPanel>();

        scrollPanel.ResetAndUpdateAnchors();
        m_Scroll.ResetPosition();

        m_BG.ResizeCollider();
    }
Beispiel #6
0
        /// <summary>
        /// 重置滚动条状态
        /// </summary>
        private void ResetScoll()
        {
            if (ScrollView.GetComponent <SpringPanel>() != null)
            {
                Object.Destroy(ScrollView.GetComponent <SpringPanel>());
            }

            ScrollView.transform.localPosition = Vector3.zero;
            ScrollView.panel.clipOffset        = Vector2.zero;
        }
Beispiel #7
0
        /// <summary>
        /// ScrollView 位移表现
        /// </summary>
        /// <param name="mScroll"></param>
        /// <param name="dis"></param>
        /// 正数为从右到左、负数为从左到右
        public static void ScrollViewTweenPosition(UIScrollView mScroll, float dis)
        {
            Vector3 ls = mScroll.gameObject.transform.localPosition;
            float   px = ls.x + dis;

            mScroll.gameObject.transform.localPosition = new Vector3(px, ls.y, ls.z);
            Vector2 v2 = mScroll.GetComponent <UIPanel>().clipOffset;

            v2.x = -px + ls.x + v2.x;
            mScroll.GetComponent <UIPanel>().clipOffset = v2;
            mScroll.RestrictWithinBounds(false);
        }
    public void GoToCategoryScreen(GameObject go)
    {
        springPanel = UIScrollViewContainerCategory.GetComponent <SpringPanel>();
        UIScrollViewContainerCategory.transform.position = Vector3.zero;
        springPanel.target    = Vector3.zero;
        selectedPageItemIndex = 0;

        GetComponent <PageListBuilder>().Clear();
        UIScreensManager.Instance.ShowScreen(UIScreensManager.Instance.UICategoryScreenView);
        UIScreensManager.Instance.HideScreen(this);
        SFXManager.Instance.OnPressButton();
    }
Beispiel #9
0
    public void setText(string tu, string luc, string noidung)
    {
        textTitle.text = "TIN NHẮN";
        textTu.gameObject.SetActive(true);
        textLuc.gameObject.SetActive(true);
        iconMail.gameObject.SetActive(true);
        textTu.text      = tu;
        textLuc.text     = luc;
        textNoiDung.text = noidung;

        scroll.GetComponent <UICenterOnChild> ().enabled = true;
        scroll.GetComponent <UICenterOnChild> ().enabled = false;
    }
Beispiel #10
0
 /// <summary>
 /// 前一页
 /// </summary>
 /// <param name="go"></param>
 void OnClickLeftBtn(GameObject go)
 {
     if (scro != null)
     {
         SpringPanel sp = scro.GetComponent <SpringPanel>();
         if (sp == null)
         {
             sp = scro.gameObject.AddComponent <SpringPanel>();
         }
         if (sp.target.x < 0)
         {
             SpringPanel.Begin(scro.gameObject, new Vector3(270, 0, 0) + sp.target, 9.5f);
         }
     }
 }
Beispiel #11
0
 public void Init()
 {
     gameObject.SetActive(true);
     Drag.transform.localPosition             = Vector3.zero;
     Drag.GetComponent <UIPanel>().clipOffset = Vector2.zero;
     _closeTime = 4.5f;
     StartCoroutine("DefaultShow");
     _isHit       = false;
     Drag.enabled = true;
     if (_dragScrollView != null)
     {
         _dragScrollView.enabled = true;
     }
     InitFourCard();
 }
Beispiel #12
0
    public bool RefreshTable()
    {
        bool result = false;

        if (table == null)
        {
            return(false);
        }
        UIScrollView scrollView = NGUITools.FindInParents <UIScrollView>(table.gameObject);

        UIPanel panel        = scrollView.GetComponent <UIPanel>();
        Vector3 pretablePos  = table.transform.localPosition;
        Vector3 preScrollPos = scrollView.transform.localPosition;
        Vector2 preOffset    = panel.clipOffset;

        if (items != null && datas.Count >= itemCount + 1)
        {
            for (int i = 0; i < items.Count; i++)
            {
                items[i].UpdateItem();
                result = true;
            }
            table.Reposition();
            table.transform.localPosition      = pretablePos;
            scrollView.transform.localPosition = preScrollPos;
        }

        return(result);
    }
Beispiel #13
0
    private void InitPosAndScroll()
    {
        m_scrollView = transform.parent.GetComponent <UIScrollView>();

        if (m_scrollView == null)
        {
            //Debug.LogException(new Exception("父节点必须有ScrollView这个组件"));
        }
        m_panel = m_scrollView.GetComponent <UIPanel>();

        if (m_panel == null)
        {
            //Debug.LogException(new Exception("父节点必须有UIPanel这个组件"));
        }

        m_panelInitPos = m_scrollView.transform.localPosition;
        m_initOffset   = m_panel.clipOffset;
        m_moveType     = m_scrollView.movement;
        EnableDestory();
        if (m_uiRoot == null)
        {
            if (UIRoot.list.Count <= 0)
            {
                throw new Exception("必须要有一个没被隐藏的UIRoot");
            }
            m_uiRoot = UIRoot.list[0];
        }
        if (itemTemplate != null)
        {
            itemTemplate.SetActive(false);
        }
        m_initiated = true;
    }
Beispiel #14
0
    static private void SetScrollViewDragNoFit(UIScrollView scrollView, UIGrid grid)
    {
        if (scrollView.disableDragIfFits)
        {
            return;
        }
        int     childCount = Mathf.FloorToInt((float)grid.GetChildList().Count / (float)grid.maxPerLine);
        int     fillCount  = 0;    //当前scrollView被填满的格子数
        UIPanel panel      = scrollView.GetComponent <UIPanel>();

        if (scrollView.movement == UIScrollView.Movement.Vertical)
        {
            fillCount = Mathf.RoundToInt(panel.height / grid.cellHeight);
        }
        else if (scrollView.movement == UIScrollView.Movement.Horizontal)
        {
            fillCount = Mathf.RoundToInt(panel.width / grid.cellWidth);
        }
        if (childCount < fillCount)
        {
            Vector3 lastPos = panel.transform.localPosition;
            scrollView.onMomentumMove = () => {
                SpringPanel.Begin(panel.gameObject, lastPos, 13f).strength = 8f;
            };
        }
    }
Beispiel #15
0
    private void InitPosAndScroll()
    {
        m_scrollView = transform.parent.GetComponent <UIScrollView>();
        if (m_scrollView == null)
        {
            Debug.LogException(new Exception("父节点必须有ScrollView这个组件"));
        }
        m_scrollView.momentumAmount = 100;

        m_panel = m_scrollView.GetComponent <UIPanel>();
        if (m_panel == null)
        {
            Debug.LogException(new Exception("父节点必须有UIPanel这个组件"));
        }

        m_panelInitPos = m_scrollView.transform.localPosition;
        m_initOffset   = m_panel.clipOffset;
        m_moveType     = m_scrollView.movement;
        EnableDestory();

        if (itemTemplate != null)
        {
            itemTemplate.gameObject.SetActive(false);
        }
        m_initiated = true;
    }
Beispiel #16
0
    void Awake()
    {
        itemPrefab = transform.parent.parent.FindChild("ChatItem").gameObject;

        //itemPrefab.GetComponent<UIWidget>().pivot = UIWidget.Pivot.Bottom;

        scrollView = GetComponent <UIScrollView>();
        itemParent = transform.FindChild("Parent").gameObject;

        if (itemPrefab == null || scrollView == null || itemParent == null)
        {
            Debug.LogError("Lzh_LoopScrollView.Awake() 有属性没有在inspector中赋值");
        }

        arrangeDirection = ArrangeDirection.Down_to_Up;
        gapDis           = 10f;
        panelHeight      = scrollView.GetComponent <UIPanel>().height;
        itemStartPos     = new Vector3(0, -panelHeight / 2 + gapDis, 0);


        // 设置scrollview的movement
        if (arrangeDirection == ArrangeDirection.Up_to_Down ||
            arrangeDirection == ArrangeDirection.Down_to_Up)
        {
            scrollView.movement = UIScrollView.Movement.Vertical;
        }
        else
        {
            scrollView.movement = UIScrollView.Movement.Horizontal;
        }


        InitScrollView();
    }
Beispiel #17
0
 void Start()
 {
     CacheScrollView();
     if (useItemPrefab != null)
     {
         useItemPrefab.SetActive(false);
         for (int i = 0; i < useItemCount; i++)
         {
             NGUITools.AddChild(gameObject, useItemPrefab);
         }
     }
     m_FirstTime = true;
     if (itemCount > 0)
     {
         if (negative)
         {
             minIndex = 1 - itemCount;
             maxIndex = 0;
         }
         else
         {
             minIndex = 0;
             maxIndex = itemCount - 1;
         }
     }
     SortBasedOnScrollMovement();
     if (m_Scroll != null)
     {
         m_Scroll.GetComponent <UIPanel>().onClipMove = OnMove;
     }
     m_FirstTime   = false;
     m_PanelTrans  = m_Panel.transform.localPosition;
     m_PanelOffset = m_Panel.clipOffset;
 }
Beispiel #18
0
    /// <summary>
    /// Cache the scroll view and return 'false' if the scroll view is not found.
    /// </summary>
    public void InitGrid()
    {
        mTrans  = transform;
        mPanel  = NGUITools.FindInParents <UIPanel>(gameObject);
        mScroll = mPanel.GetComponent <UIScrollView>();

        if (mScroll != null)
        {
            mScroll.GetComponent <UIPanel>().onClipMove = OnMove;
        }

        mChildren.Clear();
        for (int i = 0; i < mTrans.childCount; ++i)
        {
            mChildren.Add(mTrans.GetChild(i));
        }

        // Sort the list of children so that they are in order
        mChildren.Sort(UIGrid.SortByName);

        if (mScroll == null)
        {
            return;
        }
        if (mScroll.movement == UIScrollView.Movement.Horizontal)
        {
            mHorizontal = true;
        }
        else if (mScroll.movement == UIScrollView.Movement.Vertical)
        {
            mHorizontal = false;
        }

        WrapContent();
    }
Beispiel #19
0
 void Awake()
 {
     if (Scro != null)
     {
         panel = Scro.GetComponent <UIPanel>();
     }
     friendItems.gameObject.SetActive(false);
 }
Beispiel #20
0
    public static void leftShiftScrollView(UIScrollView scrollView, UIGrid grid)
    {
        float   weight          = grid.cellWidth;
        Vector3 currentPosition = scrollView.transform.localPosition;

        scrollView.transform.localPosition             = new Vector3(currentPosition.x - weight, currentPosition.y, currentPosition.z);
        scrollView.GetComponent <UIPanel>().clipOffset = new Vector3(currentPosition.x - weight, currentPosition.y, currentPosition.z);
    }
Beispiel #21
0
    void SetSaleMode(bool is_salemode)
    {
        m_SaleSelected.Clear();
        m_HeroSaleBtn.SetActive(!is_salemode);
        m_HeroSaleCancelBtn.SetActive(is_salemode);
        m_HeroSalePanel.SetActive(is_salemode);
        if (is_salemode)
        {
            m_HeroScroll.GetComponent <UIPanel>().baseClipRegion = new Vector4(0f, 40f, 900f, 440f);
        }
        else
        {
            m_HeroScroll.GetComponent <UIPanel>().baseClipRegion = new Vector4(0f, 0f, 900f, 520f);
        }

        m_SortInfo.SetSaleMode(is_salemode);
    }
Beispiel #22
0
    // private List<int> listUnlock;
    void OnEnable()
    {
        CommonObjectScript.isViewPoppup = true;
        if (TownScenesController.isHelp)
        {
            if (VariableSystem.mission == 11 || VariableSystem.mission == 50)
            {
                ScrollItem.GetComponent <UIScrollView>().enabled = false;
                ScrollForm.GetComponent <UIScrollView>().enabled = false;
            }
        }
        else
        {
            ScrollItem.GetComponent <UIScrollView>().enabled = true;
            ScrollForm.GetComponent <UIScrollView>().enabled = true;
        }

        if (audioControl == null)
        {
            audioControl = GameObject.Find("AudioControl").GetComponent <AudioControl>();
        }
        listSpriteItem = Resources.LoadAll <Texture>("Town/ImageMaketReseach");

        StartData();
    }
Beispiel #23
0
        public override void Start()
        {
            mPanel     = scrollView.GetComponent <UIPanel>();
            mPanelSize = mPanel.GetViewSize();
            mPanelOrigionClipOffset = mPanel.clipOffset;
            mLastScrollOffset       = mPanelOrigionClipOffset;

            Dirty = true;
        }
Beispiel #24
0
 protected override void OnStart()
 {
     base.OnStart();
     if (mScroll != null)
     {
         mScroll.GetComponent <UIPanel>().onClipMove = OnMove;
     }
     mFirstTime = false;
 }
    void SetVisibleGridItem()
    {
        if (IDAllowViewProduct.Count > 6)
        {
            scrollView.GetComponent <UIScrollView>().enabled = true;
        }
        else
        {
            scrollView.GetComponent <UIScrollView>().enabled = false;
        }

        int countListAllow = (IDAllowViewProduct.Count - 1) / 3;

        for (int count = 0; count <= countListAllow; count++)
        {
            gridItem[count].gameObject.SetActive(true);
        }
    }
Beispiel #26
0
    // Use this for initialization
    void Start()
    {
        //AddAllButton();
        //AddAllButton2();

        WrapSetting();

        scrollView.GetComponent <UIPanel>().depth = panel.depth + 5;
        dropDown.depth = panel.depth + 6;
    }
Beispiel #27
0
 protected virtual void Start()
 {
     SortBasedOnScrollMovement();
     WrapContent();
     if (mScroll != null)
     {
         mScroll.GetComponent <UIPanel>().onClipMove = OnMove;
     }
     mFirstTime = false;
 }
Beispiel #28
0
        public void initFlowMenu(Action <int> action, TrainUI.TrainMode currentTrainMode)
        {
            if (!isShowGrid)
            {
                showGrid();
            }
            isCircuit      = false;
            isShowToolMenu = false;
            showFlowMenu();
            flows = new Dictionary <int, FlowItem>();
            rest();
            this.action           = action;
            this.currentTrainMode = currentTrainMode;
            TrainingBigFlow bigFlow = TrainingManager.getTrainingBigFlow(UIManager.getInstance().trainUI.CurrentTrainFlow);

            for (int i = 0; i < bigFlow.getFlowIndexs().Count; i++)
            {
                TrainingFlow flow = bigFlow.getTrainingFlow(i);
                GameObject   obj  = ResourceManager.getInstance().loadUISpawnPool(flowItemPrefab, null);
                obj.transform.position = Vector3.zero;
                obj.name = i.ToString();
                grid.AddChild(obj.transform);
                UIEventListener.Get(obj).onClick = flowItemClick;
                FlowItem flowItem = new FlowItem();
                flowItem.index = i;
                flowItem.obj   = obj;
                flowItem.arrow = obj.transform.Find("arrow").gameObject;
                flowItem.arrow.gameObject.SetActive(false);
                flowItem.name      = obj.transform.Find("name").GetComponent <UILabel>();
                flowItem.name.text = flow.name;
                flows.Add(i, flowItem);
                setCurrentFlow(0, currentTrainMode);
            }
            flowOperateTitle.spriteName = getFlowTitleSprite(currentTrainMode, isShowToolMenu);
            flowOperateTitle.GetComponent <UIButton>().normalSprite = flowOperateTitle.spriteName;

            scrollView.gameObject.SetActive(false);
            scrollView.gameObject.SetActive(true);
            grid.repositionNow = true;
            grid.Reposition();
            scrollBar.value = 0;
            scrollView.GetComponent <UIPanel>().Invalidate(true);
        }
Beispiel #29
0
        private void SetContent(int index)
        {
            LTUIUtil.SetText(contentGameObj.GetComponent <UILabel>(), Notices[index].notice);
            LTUIUtil.SetText(contentGameObj.transform.Find("ContentTitle/Label").GetComponent <UILabel>(),
                             Notices[index].type);

            float panelHeight = contentScrollView.GetComponent <UIPanel>().GetViewSize().y;

            contentScrollView.ResetPosition();
            contentScrollView.enabled = (contentGameObj.GetComponent <UILabel>().height + TitleWidth) > panelHeight;
        }
Beispiel #30
0
    /// <summary>
    /// 停止移动
    /// </summary>
    public void onStoppedMoving()
    {
        UIPanel panel = mSingleScroll.GetComponent <UIPanel>();

        if (panel.clipOffset.y > 0)
        {
            mScroll.transform.localPosition = mScrollPos;
            UIPanel sc = mScroll.GetComponent <UIPanel>();
            sc.clipOffset = new Vector2(0, 0);
        }
    }
        /// <summary>
        /// Cache the scroll view and return 'false' if the scroll view is not found.
        /// </summary>
        public void InitGrid() {
            mTrans = transform;
            mPanel = NGUITools.FindInParents<UIPanel>(gameObject);
            mScroll = mPanel.GetComponent<UIScrollView>();

            if (mScroll != null) {
                mScroll.GetComponent<UIPanel>().onClipMove = OnMove;
            }

            mChildren.Clear();
            for (int i = 0; i < mTrans.childCount; ++i)
                mChildren.Add(mTrans.GetChild(i));

            // Sort the list of children so that they are in order
            mChildren.Sort(UIGrid.SortByName);

            if (mScroll == null) return;
            if (mScroll.movement == UIScrollView.Movement.Horizontal) mHorizontal = true;
            else if (mScroll.movement == UIScrollView.Movement.Vertical) mHorizontal = false;

            WrapContent();
        }
Beispiel #32
0
	// Use this for initialization
	void Start ()
	{
		_swipeState = SwipeState.None;

		_isFirstTouch = true;

		_uiScrollView = GetComponentInChildren<UIScrollView>();

		if (null == _uiScrollView)
		{
			throw new MissingComponentException("TestSwipeScripts.Start - can't get UIScrollView component for _uiScrollView");
		}

		_startingMomentum = _uiScrollView.momentumAmount;
		_uiScrollView.panel.clipping = UIDrawCall.Clipping.None;

		_panel = _uiScrollView.GetComponent<UIPanel>();

		if (null == _panel)
		{
			throw new MissingComponentException("TestSwipeScripts.Start - can't get UIPanel component for _panel");
		}

		DynamicScrollView2 dynamicScrollView = FindObjectOfType<DynamicScrollView2>();

		if (null == dynamicScrollView)
		{
			throw new NullReferenceException("TestSwipeScripts.Start - can't find DynamicScrollView object");
		}

		_thresholdDistanceToCloseCard = dynamicScrollView.closeDetailCardThresholdHorizontal;
		_thresholdDistanceVerticalToCloseCard = dynamicScrollView.closeDetailCardThreshold;


		ScrollViewContainer = NGUITools.FindInParents<UIWidget>(_uiScrollView.transform);

		if (null == ScrollViewContainer)
		{
			throw new MissingComponentException("TestSwipeScripts.Start - can't get UIWidget component for _scrollViewContainer");
		}

		_currentScale = Vector3.one;

		_previousMovementState = UIScrollView.Movement.Custom;

	}
 public static void leftShiftScrollView(UIScrollView scrollView, UIGrid grid)
 {
     float weight = grid.cellWidth;
     Vector3 currentPosition = scrollView.transform.localPosition;
     float maxWeight = (grid.GetChildList().Count) * grid.cellWidth / 2;
     scrollView.transform.localPosition = new Vector3(currentPosition.x - weight, currentPosition.y, currentPosition.z);
     scrollView.GetComponent<UIPanel>().clipOffset = new Vector3(currentPosition.x - weight, currentPosition.y, currentPosition.z);
 }