본문 바로가기

정리 카테고리/Memo

특정 개수 만큼 몬스터 출력 페이지 관련

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
        List<UIMonster> monsterList = new List<UIMonster>();//몬스터 담아둘 리스트 선언
        monsterList.add();//몬스터 추가
 
        
        int listHere = 0;//현재 출력되어있는 리스트 번호(페이지 마지막)
        string checkwhere = "back";
 
        if (checkwhere == "back") listHere = (listHere/15)*15-1;//뒤로가기 버튼일시 15 줄이고 출력 실행
        for (int i =0; i < 15; i++){
            monsterList[listHere];
            listHere++;
        }
 
        if ((listHere - 15> 0) SetActive();//뒤로 가기 버튼 활성화 조건
        if (listHere > (monsterList.count - 1)) SetActive();//다음 버튼 활성화 조건
 
 
cs


-monsterList 안에 몬스터 생성시 추가.


-listHere 통해 내가 출력한 배열 위치 확인.


-checkwhere은(버튼이 주는 메시지 대신 예시로 적음)

  위로 가기 버튼일시 15개(이전 페이지 시작 배열 위치로 바꿈)


-if 뒤로가기 활성화 조건

-if 다음가기 활성화 조건