Example #1
0
        public List <ChunkObjST> ChunkLoad(float nowPos, float turningPoint)
        {
            rtChunkObjSTList.Clear();

            CleanCrtDelLists();
            CandidateReadyForTurn(nowPos, turningPoint);
            posList = DataOfMapObjMgr.GetInstance().GetPosList();

            CandidateCheck(nowPos);   //터닝 포인트 들어온 대로 후보군 체크
            ChunkCreateAndDel();

            return(rtChunkObjSTList);
        }
Example #2
0
        public List <ChunkObjST> ChunkLoad(float nowPos)
        {
            rtChunkObjSTList.Clear();

            CleanCrtDelLists();
            CandidateReady();
            posList = DataOfMapObjMgr.GetInstance().GetPosList();


            CandidateCheck(nowPos);   //후보군 체크
            ChunkCreateAndDel();

            return(rtChunkObjSTList);
        }
Example #3
0
        void ChunkCreateAndDel()
        {
            foreach (float pos in crtAndDelPosLists[(int)E_CHUNK_CREATE_DEL.DEL])   //삭제할 청크
            {
                if (posList.Contains(pos))
                {
                    DataOfMapObjMgr.GetInstance().TurnInChunkObjSTPool(pos);
                }
                else
                {
                    Debug.Log("청크 삭제 중 오류 001");
                }
            }

            foreach (float pos in crtAndDelPosLists[(int)E_CHUNK_CREATE_DEL.CREATE])    //생성할 청크
            {
                Vector3    createPos = new Vector3(0, 0, pos);
                GameObject crtChunk  = MapAndObjPool.GetInstance().GetChunkInPool();
                ChunkObjST temp;
                if (crtChunk != null)
                {
                    crtChunk.transform.SetPositionAndRotation(createPos, Quaternion.identity);
                    crtChunk.SetActive(true);
                    temp = DataOfMapObjMgr.GetInstance().GetEmptyChunkObjSTFromPool(crtChunk, pos);
                    if (temp != null)
                    {
                        rtChunkObjSTList.Add(temp);
                    }
                    else
                    {
                        ErrorManager.SpurtError("청크자료구조 받아오던중 에러");
                    }
                }
                else
                {
                    Debug.Log("청크 풀 부족");
                }
            }
        }