void ShelfDragOld() { if (!LayerJudge()) { hold = false; shelf.EndDrag(); return; } if (hold) { shelf.Slide(Input.mousePosition.x - mouseX); } if (Input.GetMouseButtonDown(0)) { shelf.BeginDrag(); hold = true; mouseX = Input.mousePosition.x; } if (Input.GetMouseButtonUp(0)) { hold = false; shelf.EndDrag(); } }
void SlideRight() { // 下面这一步是用来做到头拉不动的动画的 shelfList.BeginDrag(); shelfList.Slide(-40); shelfList.EndDrag(); shelfList.Slide(true); }