https://clipchamp.com/watch/Zc33Ke27TrP
데이터는 52MB라서, 용량이 53MB인데 문제는 50MB 이내만 올릴 수 있어서...
void TriggerCheck(Collider other, List<Transform> list, ItemMode itemMode) {
int index = -1;
string modelname="";
for(int i = 0; i < list.Count ; i++) {
if(other.gameObject == list[i].gameObject){
index = i;
modelname = list[index].gameObject.name;
break;
}
}
if (modelname.Length == 0) {
Debug.LogWarning("modelname not found");
return;
}
stage2map.RemoveModel(index, list);//
if (itemMode == ItemMode.SmallStarMode)
Score += 20;
if (itemMode == ItemMode.BigStarMode)
Score += 50;
if (itemMode == ItemMode.SmallCoinMode)
Coin += 30;
if (itemMode == ItemMode.BigCoinMode)
Coin += 70;
}
void TriggerCheckAlphabet(Collider other, List<Transform> list, ItemMode itemMode) {
int index = -1;
string modelname="";
for(int i = 0; i < list.Count ; i++) {
if(other.gameObject == list[i].gameObject){
index = i;
modelname = list[index].gameObject.name;
break;
}
}
if (modelname.Length == 0) {
Debug.LogWarning("modelname not found");
return; //아그리고 이게 기억나네 return 하고 return 0 하고 void에서 는 차이가 있음. 그래서 헤맸던 기억이남 return은 void 타입에서 필수
// 가령 void 타입이 아니고, int 이면 return 0이 되야 하는데, 타입이 void 잖아... 이런거는 malloc alloc realloc 할때 동적할당 할때 타입에 대해서나올텐데, 내가 C를 잘 몰라
}
stage2map.RemoveModel(index, list);//포르투갈어로 posicao 이거 보여줄께
if(itemMode == ItemMode.W_ColorMode)
ColorItemUp(1, W_Color);
else if(itemMode == ItemMode.E_ColorMode)
ColorItemUp(1, E_Color);
else if(itemMode == ItemMode.A_ColorMode)
ColorItemUp(1, A_Color);
else if(itemMode == ItemMode.P_ColorMode)
ColorItemUp(1, P_Color);
else if(itemMode == ItemMode.O_ColorMode)
ColorItemUp(1, O_Color);
else if(itemMode == ItemMode.N_ColorMode)
ColorItemUp(1, N_Color);
else if(itemMode == ItemMode.F_ColorMode)
ColorItemUp(1, F_Color);
else if(itemMode == ItemMode.L_ColorMode)
ColorItemUp(1, L_Color);
else if(itemMode == ItemMode.Y_ColorMode)
ColorItemUp(1, Y_Color);
}
//OnTriggerEnter
void OnTriggerEnter(Collider other) {
if (other.gameObject.tag == "W")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.W_ColorMode);
if (other.gameObject.tag == "E")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.E_ColorMode);
if (other.gameObject.tag == "A")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.A_ColorMode);
if (other.gameObject.tag == "P")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.P_ColorMode);
if (other.gameObject.tag == "O")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.O_ColorMode);
if (other.gameObject.tag == "N")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.N_ColorMode);
if (other.gameObject.tag == "F")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.F_ColorMode);
if (other.gameObject.tag == "L")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.L_ColorMode);
if (other.gameObject.tag == "Y")
TriggerCheckAlphabet(other, stage2map.AlphabetList, ItemMode.Y_ColorMode);
if (other.gameObject.tag == "Change")
StartCoroutine("TurboMode", other);
if (other.gameObject.tag == "SmallStar")
TriggerCheck(other, stage2map.SmallStarList, ItemMode.SmallStarMode);
if (other.gameObject.tag == "BigStar")
TriggerCheck(other, stage2map.BigStarList, ItemMode.BigStarMode);
if (other.gameObject.tag == "SmallCoin")
TriggerCheck(other, stage2map.SmallCoinList, ItemMode.SmallCoinMode);
if (other.gameObject.tag == "BigCoin")
TriggerCheck(other, stage2map.BigCoinList, ItemMode.BigCoinMode);
}
/// TriggerCheck
이 댓글은 게시물 작성자가 삭제하였습니다.
이 댓글은 게시물 작성자가 삭제하였습니다.
이게 뭐 하는거임?
배열
List
알고리즘
MapLoading
먼지 잘 모르겟어 ㅜ
생성되는 구조가 큐라서...
처음에 맵이 없어지고, 두번째 맵 나올 때, 자연스럽게 나오는게 아니라, 큐의 알고리즘 원리에 의해서 나옵니다.
큐 형식으로 저장된 맵을 로딩한다는거야?
네 그렇습니다.
지울 때는 직접 찾아서 지워주고,
근데 그래픽이 먼가 2002년 스타일 같아
유니티로 만든거라서,
저거 다 애셋산거에요.... 웨폰플라이 빼고
돈 주고 삿다고?! 흠
리소스를 샀었죠. 거너 애셋은 친구가 산건데 만원 주엇어요 제가 2014년에...
코인은 애셋 친구가산건데,
나머지 맵이랑 디자인은 샀어요...
TriggerCheck 지우는 알고리즘 첨부했어요...
https://www.instagram.com/p/CuN-43FPoji/
알고리즘이 큐 기반임
오브젝트 지울때 좀 까다롭게 지웁니다.