//アイテムの両端と境界線の位置関係をチェック void CheckClip() { float margineOuter = 0.25f; //アイテムの両端と、境界線の外側の許容マージン float margineInner = 1.0f; //アイテムの両端と、境界線の内側の許容マージン float margine; switch (Type) { case LitViewType.Holizon: margine = margineOuter * itemSize.x; isOuterMin = (DistLeft < -margine); isOuterMax = (margine < DistRight); isInnerMin = (DistLeft > 0); isInnerMax = (DistLeft < 0 && DistRight < 0); margine = margineInner * itemSize.x; isInnerMargineMin = (margine < DistLeft) && (0 < DistRight); isInnerMargineMax = (DistRight < -margine); break; case LitViewType.Vertical: margine = margineOuter * itemSize.y; isOuterMin = (margine < DistTop); isOuterMax = (DistBottom < -margine); isInnerMin = (DistTop < 0); isInnerMax = (DistTop > 0 && DistBottom > 0); margine = margineInner * itemSize.y; isInnerMargineMin = (DistTop < -margine) && (DistBottom < 0); isInnerMargineMax = (margine < DistBottom); break; } //アロー表示をON・OFFする if (null != MinArrow) { MinArrow.SetActive(isOuterMin); } if (null != MaxArrow) { MaxArrow.SetActive(isOuterMax); } }
void RefreshArrow() { if (IsContentInnerScrollRect()) { if (null != MinArrow) { MinArrow.SetActive(false); } if (null != MaxArrow) { MaxArrow.SetActive(false); } } else { float normal; switch (ScrollType) { case Type.Horizontal: normal = ScrollRect.horizontalNormalizedPosition; if (null != MinArrow) { MinArrow.SetActive(normal > 0); } if (null != MaxArrow) { MaxArrow.SetActive(normal < 1); } break; case Type.Vertical: normal = ScrollRect.verticalNormalizedPosition; if (null != MinArrow) { MinArrow.SetActive(normal < 1); } if (null != MaxArrow) { MaxArrow.SetActive(normal > 0); } break; } } }