void Start() { eSlotState = E_PRECHARACTERSLOT_STATE.E_PRECSLOT_STATE_SCROOLSTOP; characterSlotPool.PreloadPool(); //캐릭터 정보 패널 초기화 InitToggle(); StartCoroutine(UpdateCharacterList_Type()); }
//타입에 따른 캐릭터 리스트 갱신 IEnumerator UpdateCharacterList_Type() { fLastValue = 0f; //초기화 한후 가지고 있는 슬롯의 개수 나중에 가지고 있는 영웅에 개수에 따라 바꿔야함 nCount = 4; float fInitRectYValue = rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y; yield return(new WaitForSeconds(0.1f)); while (true) { switch (curCharacterType) { case E_PREPAREBATTLE_CHARCTERTYPE.E_PREPAREBATTLE_CHARCTERTYPE_TOTAL: if (fLastValue > scrollRect_List [(int)curCharacterType].verticalNormalizedPosition) { //Debug.Log ("올릴때!!!"); eSlotState = E_PRECHARACTERSLOT_STATE.E_PRECSLOT_STATE_SCROOLUP; blockImage.SetActive(true); /* * float value = (UpRectTransformListY_Value [(int)curCharacterType] + fUpRectChangeSlotCheckValue) - rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y; * * if (value < 0 ) { * * * ResetCharacterSlot (true); * } * * * if (UpRectTransformListY_Value [(int)curCharacterType] + (fUpRectChangeSlotCheckValue * 2) < rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y) { * blockImage.SetActive (true); * ResetCharacterSlot (true); * } * if (UpRectTransformListY_Value [(int)curCharacterType] + (fUpRectChangeSlotCheckValue * 3 )< rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y) { * blockImage.SetActive (true); * ResetCharacterSlot (true); * } */ if (fInitRectYValue + (280f * (1 + nNextIndex[(int)curCharacterType])) <= fCurHeight[(int)curCharacterType]) { //Debug.Log ("SlotGoDown"); //fcurSlotPos = cInfoPanel.rectTransformList_Panel [(int)cInfoPanel.curCharacterType].anchoredPosition.y; nNextIndex [(int)curCharacterType]++; fPrevHeight[(int)curCharacterType] = rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y; ResetCharacterSlot(true); } } else if (fLastValue == scrollRect_List [(int)curCharacterType].verticalNormalizedPosition) { blockImage.SetActive(false); eSlotState = E_PRECHARACTERSLOT_STATE.E_PRECSLOT_STATE_SCROOLSTOP; //Debug.Log("멈췄을 때"); } else { //Debug.Log ("내릴때!!!!"); eSlotState = E_PRECHARACTERSLOT_STATE.E_PRECSLOT_STATE_SCROOLDOWN; blockImage.SetActive(true); if (fCurHeight[(int)curCharacterType] < fPrevHeight[(int)curCharacterType]) { //Debug.Log ("SlotGoUp"); fPrevHeight [(int)curCharacterType] -= 280f; nNextIndex [(int)curCharacterType]--; ResetCharacterSlot(false); } //맨위에 꺼에 대한 마무리 처리 if (nNextIndex [(int)curCharacterType] == -1) { //Debug.Log ("맨 위에 꺼 생성"); nNextIndex [(int)curCharacterType] = 0; ResetCharacterSlot(false); fPrevHeight [(int)curCharacterType] = fCurHeight [(int)curCharacterType]; break; } /* * if (DownRectTransformListY_Value [(int)curCharacterType] - 135f > rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y) { * //Debug.Log ("올릴때 한개 지나감"); * //rectTrasformListY_Value [(int)curCharacterType] = rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y; * * ResetCharacterSlot (false); * } */ } //yield return null; break; default: Debug.Log("Error"); break; } fLastValue = scrollRect_List[(int)curCharacterType].verticalNormalizedPosition; fCurHeight [(int)curCharacterType] = rectTransformList_Panel [(int)curCharacterType].anchoredPosition.y; //Debug.Log (fLastValue); yield return(null); } }