/// <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); } } } }
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); } }
/// <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); } }
void OnScroll(float delta) { print("sb"); scrollView.Scroll(delta); transform.parent.parent.GetComponentInChildren <UIScrollBar>().value -= delta; }
/// <summary> /// If the object should support the scroll wheel, do it. /// </summary> void OnScroll(float delta) { if (scrollView && NGUITools.GetActive(this)) { scrollView.Scroll(delta); } }
/// <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); } }
/// <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); } }
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); }
/// <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; } }
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); }
// 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); }
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)); } }
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)); } }
public void OnClick() { float delta = 0f;; switch (direction) { case Directions.Right: delta = amountToScroll; break; case Directions.Left: delta = -amountToScroll; break; } scrollView.Scroll(delta); }
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); }
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); }
//滚轮向上操作 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); } } } }
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)); } }
// Update is called once per frame void Update() { scrollView.Scroll(scrollSpeed); }
private void OnLeftClick() { mScrolV.Scroll(1.0f); }
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); }
public void OnRightArrow() { // scroll.MoveRelative(new Vector3(680f,0)); scroll.Scroll(0.5f); // scroll.RestrictWithinBounds(false, scroll.canMoveHorizontally, scroll.canMoveVertically); }