public void Setup(GameObject _UIListPanel, GameObject _CreateObj, GameObject _UIGridPanel, int _CreateCount, int _FirstCreateCount, int _CreateMaxCount, float _BottomLimit, System.Action <int, GameObject> _CreateCallBack, eScrollType _ScrollType, bool _NotUpdate) { if (_UIListPanel.transform.localPosition != Vector3.zero) { Debug.LogError("페이징을 사용하려면 ListPanel의 localPosition이 zero여야 함"); } CreateObj = _CreateObj; NowGridPanel = _UIGridPanel.transform; NowListPanel = _UIListPanel.transform; CreateCallBack = _CreateCallBack; CreateCount = _CreateCount; cellHeight = NowGridPanel.GetComponent <UIGrid>().cellHeight; cellWidth = NowGridPanel.GetComponent <UIGrid>().cellWidth; BottomLimit = _BottomLimit; ScrollType = _ScrollType; NotUpdate = _NotUpdate; scrollView = NowListPanel.GetComponent <UIScrollView>(); //< 총 몇개까지 페이징 될것인가 MaxIndex = _CreateMaxCount - 1; //< 처음에 몇개를 생성할것인가. _FirstCreateCount--; //< 맥스카운트 보정 if (MaxIndex < _FirstCreateCount) { MaxIndex = _FirstCreateCount; } //< 현재 인덱스 NowIndex = FirstCreateCount = _FirstCreateCount; //< 오브젝트를 미리생성해둠 FirstCreateObj(); //< 처음 한번 생성 FirstCreate(); DeleteUpObjectCount = 0; Live = true; }
public static ObjectPaging CreatePagingPanel(GameObject Uipanel, GameObject Uigrid, GameObject CreateObj, int _CreateCount, int FirstCreateCount, int MaxCreateCount, float BottomLimit, System.Action <int, GameObject> _CallBack, eScrollType _ScrollType = eScrollType.Vertical, bool _NotUpdate = false) { ObjectPaging objectPaging = Uipanel.AddComponent <ObjectPaging>(); objectPaging.Setup(Uipanel, CreateObj, Uigrid, _CreateCount, FirstCreateCount, MaxCreateCount, BottomLimit, _CallBack, _ScrollType, _NotUpdate); return(objectPaging); }