Scroll() 공개 메소드

If the object should support the scroll wheel, do it.
public Scroll ( float delta ) : void
delta float
리턴 void
예제 #1
0
    /// <summary>
    /// Drag the object along the plane.
    /// </summary>

    void OnDrag(Vector2 delta)
    {
        if (MouseDrag)
        {
            if (scrollView && NGUITools.GetActive(this))
            {
                scrollView.Drag();
            }
        }
        else
        {
            if (scrollView && NGUITools.GetActive(this))
            {
                if (scrollView.movement == UIScrollView.Movement.Horizontal)
                {
                    scrollView.Scroll(delta.x);
                }
                else if (scrollView.movement == UIScrollView.Movement.Vertical)
                {
                    scrollView.Scroll(delta.y);
                }
                else
                {
                    scrollView.Scroll(delta.x);
                    scrollView.Scroll(delta.y);
                }
            }
        }
    }
예제 #2
0
 public void SetRoleList(ref List <RoleData> list)
 {
     while (roleTable.transform.childCount > 0)
     {
         DestroyImmediate(roleTable.transform.GetChild(0).gameObject);
     }
     if (list != null)
     {
         roleViewTable = new Hashtable();
         for (int i = 0; i < list.Count; i++)
         {
             RoleData   r   = list[i] as RoleData;
             GameObject obj = Instantiate(rolePrefabe);
             obj.SetActive(true);
             HeadRole pop = obj.GetComponent <HeadRole>();
             pop.InitData(r, true);
             obj.name                 = r.sort.ToString();
             pop.transform.parent     = roleTable.transform;
             pop.transform.position   = Vector3.zero;
             pop.transform.localScale = Vector3.one;
             roleViewTable.Add(r.csv_id, pop);
         }
         roleTable.Reposition();
         roleScrollView.ResetPosition();
         roleScrollView.Scroll(0);
         roleTable.repositionNow = true;
     }
 }
    /// <summary>
    /// If the object should support the scroll wheel, do it.
    /// </summary>

    void OnScroll(float delta)
    {
        if (enabled && NGUITools.GetActive(gameObject) && scrollView != null)
        {
            scrollView.Scroll(delta);
        }
    }
	private void OnScroll(float delta)
	{
		if (Object.op_Implicit(scrollView) && NGUITools.GetActive(this))
		{
			scrollView.Scroll(delta);
		}
	}
예제 #5
0
        /// <summary>
        /// Drag the object along the plane.
        /// </summary>

        //void OnDrag(Vector2 delta)
        //{
        //    if (scrollView && NGUITools.GetActive(this))
        //        scrollView.Drag();
        //}

        /// <summary>
        /// If the object should support the scroll wheel, do it.
        /// </summary>

        public virtual void OnScroll(float delta)
        {
            if (scrollView && NGUITools.GetActive(this))
            {
                scrollView.Scroll(-delta);
            }
        }
예제 #6
0
    void OnScroll(float delta)
    {
        print("sb");
        scrollView.Scroll(delta);

        transform.parent.parent.GetComponentInChildren <UIScrollBar>().value -= delta;
    }
예제 #7
0
    /// <summary>
    /// If the object should support the scroll wheel, do it.
    /// </summary>

    void OnScroll(float delta)
    {
        if (scrollView && NGUITools.GetActive(this))
        {
            scrollView.Scroll(delta);
        }
    }
예제 #8
0
    /// <summary>
    /// If the object should support the scroll wheel, do it.
    /// </summary>

    void OnScroll(float delta)
    {
        if (scrollView && enabled && NGUITools.GetActive(gameObject))
        {
            scrollView.Scroll(delta);
        }
    }
예제 #9
0
    /// <summary>
    /// If the object should support the scroll wheel, do it.
    /// </summary>

    void OnScroll(float delta)
    {
        if (scrollView && NGUITools.GetActive(this))
        {
            scrollView.Scroll(delta);
            scrollView.gameObject.transform.localPosition = new Vector3(scrollView.gameObject.transform.localPosition.x, scrollView.gameObject.transform.localPosition.y, 0);
        }
    }
예제 #10
0
    static int Scroll(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        UIScrollView obj  = (UIScrollView)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIScrollView");
        float        arg0 = (float)LuaScriptMgr.GetNumber(L, 2);

        obj.Scroll(arg0);
        return(0);
    }
예제 #11
0
    /// <summary>
    /// Create a plane on which we will be performing the dragging.
    /// </summary>

    /*void OnPress (bool pressed)
     * {
     *
     *      // If the scroll view has been set manually, don't try to find it again
     *      if (mAutoFind && mScroll != scrollView)
     *      {
     *              mScroll = scrollView;
     *              mAutoFind = false;
     *      }
     *
     *      if (scrollView && enabled && NGUITools.GetActive(gameObject))
     *      {
     *              scrollView.Press(pressed);
     *
     *              if (!pressed && mAutoFind)
     *              {
     *                      scrollView = NGUITools.FindInParents<UIScrollView>(mTrans);
     *                      mScroll = scrollView;
     *              }
     *      }
     * }*/

    /// <summary>
    /// Drag the object along the plane.
    /// </summary>

    /*void OnDrag (Vector2 delta)
     * {
     *      if (scrollView && NGUITools.GetActive(this))
     *              scrollView.Drag();
     * }
     *
     * /// <summary>
     * /// If the object should support the scroll wheel, do it.
     * /// </summary>*/

    void OnScroll(float delta)
    {
        if (scrollView && NGUITools.GetActive(this))
        {
            scrollView.Scroll(delta);

            GameObject.Find(transform.parent.parent.parent.parent.name + "/Win/Scroll Bar").GetComponent <UIScrollBar>().value -= delta;
        }
    }
예제 #12
0
    private static int Scroll(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        UIScrollView uIScrollView = (UIScrollView)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIScrollView");
        float        delta        = (float)LuaScriptMgr.GetNumber(L, 2);

        uIScrollView.Scroll(delta);
        return(0);
    }
예제 #13
0
//	Vector3 offsetPosition;
//	float offset;

    protected void Forward()
    {
        /*
         * if (!scrollView.shouldMove) return;
         *
         * offsetPosition = Vector3.zero;
         *
         * if (scrollView.movement == UIScrollView.Movement.Horizontal)
         * {
         *      offset = scrollView.panel.baseClipRegion.x;
         *      offsetPosition = new Vector3(-_spacing - offset, 0, 0);
         * }
         * else if (scrollView.movement == UIScrollView.Movement.Vertical)
         * {
         *      offset = scrollView.panel.baseClipRegion.y;
         *      offsetPosition = new Vector3(0,_spacing - offset, 0);
         * }
         */
        scrollView.Scroll(-1);
        //scrollView.Scroll(offsetPosition);
        EventDelegate.Execute(onScroll);
    }
예제 #14
0
 static public int Scroll(IntPtr l)
 {
     try {
         UIScrollView  self = (UIScrollView)checkSelf(l);
         System.Single a1;
         checkType(l, 2, out a1);
         self.Scroll(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #15
0
 static int Scroll(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UIScrollView obj  = (UIScrollView)ToLua.CheckObject <UIScrollView>(L, 1);
         float        arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.Scroll(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #16
0
    public void OnClick()
    {
        float delta = 0f;;

        switch (direction)
        {
        case Directions.Right:
            delta = amountToScroll;
            break;

        case Directions.Left:
            delta = -amountToScroll;
            break;
        }
        scrollView.Scroll(delta);
    }
예제 #17
0
    private static int Scroll(IntPtr L)
    {
        int result;

        try
        {
            ToLua.CheckArgsCount(L, 2);
            UIScrollView uIScrollView = (UIScrollView)ToLua.CheckObject(L, 1, typeof(UIScrollView));
            float        delta        = (float)LuaDLL.luaL_checknumber(L, 2);
            uIScrollView.Scroll(delta);
            result = 0;
        }
        catch (Exception e)
        {
            result = LuaDLL.toluaL_exception(L, e, null);
        }
        return(result);
    }
예제 #18
0
    public static int Scroll(IntPtr l)
    {
        int result;

        try
        {
            UIScrollView uIScrollView = (UIScrollView)LuaObject.checkSelf(l);
            float        delta;
            LuaObject.checkType(l, 2, out delta);
            uIScrollView.Scroll(delta);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
예제 #19
0
 //滚轮向上操作
 public void MouseUpScroll(float delta)
 {
     //仅纯avg状态下可以打开BackLog
     if (panels["Avg"].activeSelf && !panels["Phone"].activeSelf)
     {
         GameObject backCon = panels["System"].transform.Find("Backlog_Container").gameObject;
         //Backlog关闭时 且 未被锁定才能打开
         if (!backCon.activeSelf && !DataManager.GetInstance().IsBacklogBlocked())
         {
             OpenBacklog();
         }
         else
         {
             //如果已经打开了Backlog 则向上滚动条
             if (backCon.GetComponent <BacklogUIManager>().IsEnoughRow())
             {
                 UIScrollView scroll = backCon.transform.Find("Scroll View").GetComponent <UIScrollView>();
                 scroll.Scroll(delta * 10);
             }
         }
     }
 }
예제 #20
0
        static int _m_Scroll(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UIScrollView gen_to_be_invoked = (UIScrollView)translator.FastGetCSObj(L, 1);



                {
                    float _delta = (float)LuaAPI.lua_tonumber(L, 2);

                    gen_to_be_invoked.Scroll(_delta);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #21
0
 // Update is called once per frame
 void Update()
 {
     scrollView.Scroll(scrollSpeed);
 }
예제 #22
0
 private void OnLeftClick()
 {
     mScrolV.Scroll(1.0f);
 }
예제 #23
0
 private void OnLeft()
 {
     mScrolV.Scroll(-1);
     SoundManager.Instance.Play(15);
 }
 /// <summary>
 ///	The following methods can be used to manually handle the cycler.
 /// See PickerScrollButton for an example.
 /// </summary>
 public void Scroll(float delta)
 {
     _draggablePanel.Scroll(delta);
 }
예제 #25
0
    public void OnRightArrow()
    {
//		scroll.MoveRelative(new Vector3(680f,0));
        scroll.Scroll(0.5f);
//		scroll.RestrictWithinBounds(false, scroll.canMoveHorizontally, scroll.canMoveVertically);
    }