예제 #1
0
        public void ChangeObj(int objNum, E_SPAWN_OBJ_TYPE changingType)
        {
            if (floorChunk == null)
            {
                ErrorManager.SpurtError("생성도 안됐는데 오브젝트를 바꾸려함.");
            }

            if (false == UpperHuddleCheck(objNum, changingType, soa))
            {
                Debug.Log("어퍼허들 체크에서 삑살.");
                return;
            }

            if (whichTurn != E_WhichTurn.NOT_TURN)
            {
                Debug.Log("회전 청크인데 오브젝트를 체인지 하려고함.");
                return;
            }

            for (int i = 0; i < objs.Count; i++)
            {
                if (objs[i] != null)
                {
                    MapAndObjPool.GetInstance().TurnInPoolObj(objs[i]);
                }
            }
            objs.Clear();//참조만 날라감. 괜찮음.

            soa.spawnObjType[objNum] = changingType;

            spg = floorChunk.transform.GetChild(3);

            FixedObjGenerator.FixedObjGen(spg, soa.spawnObjType, ref objs);
        }
예제 #2
0
        public void showThisToEditor(int standardPos, float chunkMargin)
        {
            bornPos.z = (pos - standardPos) * chunkMargin;  //이렇게 하면 기준 점기준으로 현재 pos가 가리키는 위치를 얻을 수 있어.

            //Debug.Log(bornPos.ToString() + "에 생성!!");

            switch (whichTurn)
            {
            case E_WhichTurn.LEFT:
                //왼쪽 으로 청크 풀링 해오기.
                floorChunk =
                    MapAndObjPool.GetInstance().GetTurnLeftChunksInPool();
                break;

            case E_WhichTurn.RIGHT:
                //오른쪽으로 청크 풀링
                floorChunk =
                    MapAndObjPool.GetInstance().GetTurnRightChunksInPool();
                break;

            case E_WhichTurn.NOT_TURN:
                floorChunk
                    = MapAndObjPool.GetInstance().GetChunkInPool();
                break;

            default: ErrorManager.SpurtError("위치턴이 아무것도 아닌 심각한 오류.");
                break;
            }
            floorChunk.transform.position = bornPos;
            floorChunk.SetActive(true);

            if (whichTurn == E_WhichTurn.NOT_TURN)
            {
                spg = floorChunk.transform.GetChild(3);
                FixedObjGenerator.FixedObjGen(spg, soa.spawnObjType, ref objs);
            }
            isNowShowed = true;
        }
예제 #3
0
        public static void ObjGen(E_STAGE whatStage, Transform spawnPointGroup, ref List <GameObject> objs)
        {
            if (objs == null || spawnPointGroup == null)
            {
                return;
            }

            if (StageST.objQueue.Count == 0)
            {
                if (whatStage == E_STAGE.INFINITY)
                {
                    InfinityFactory.GetInstance().MakeObjQueNode();
                }

                else
                {
                    return;
                }
            }

            StageObjArr soa = StageST.objQueue.Dequeue();

            FixedObjGenerator.FixedObjGen(spawnPointGroup, soa.spawnObjType, ref objs);
        }