示例#1
0
 public void Reset()
 {
     whichTurn   = E_WhichTurn.NOT_TURN;
     whereToTurn = null;
     leftTurnChunks.SetActive(false);
     rightTurnChunks.SetActive(false);
 }
示例#2
0
 IEnumerator turnMap(E_WhichTurn whichTurn)
 {
     if (whereToTurn == null)
     {
         yield break;
     }
     if (whichTurn == E_WhichTurn.LEFT)
     {
         while (whereToTurn != null && whereToTurn.eulerAngles.y < 90)   //다 돌기전에 지나가버리는 사태를 대비해서whereToTurn != null 조건문 추가
         {
             whereToTurn.Rotate(0.0f, 15f, 0.0f);
             yield return(new WaitForSeconds(Mathf.Epsilon * 1f));
         }
     }
     else if (whichTurn == E_WhichTurn.RIGHT)
     {
         whereToTurn.Rotate(0.0f, -0.01f, 0.0f);//쿼터니언과 수 부분
         while (whereToTurn != null && whereToTurn.eulerAngles.y >= 270)
         {
             // print(turnChunks.transform.eulerAngles.y);
             whereToTurn.Rotate(0.0f, -15f, 0.0f);
             yield return(new WaitForSeconds(Mathf.Epsilon * 1f));
         }
     }
 }
示例#3
0
        public void GenerateTurnChunks(E_WhichTurn whichTurn, float turningPoint)
        {
            Vector3 pos = new Vector3(0f, 0f, turningPoint - (2 * MapObjManager.GetInstance().GetChunkMargin()));

            this.whichTurn    = whichTurn;
            this.turningPoint = turningPoint;
            if (whichTurn == E_WhichTurn.LEFT)
            {
                whereToTurn = leftTurnChunks.transform.Find("TurningPoint");
                leftTurnChunks.transform.position = pos;
                whereToTurn.transform.rotation    = originRot;
                leftTurnChunks.SetActive(true);
            }
            else if (whichTurn == E_WhichTurn.RIGHT)
            {
                whereToTurn = rightTurnChunks.transform.Find("TurningPoint");
                rightTurnChunks.transform.position = pos;
                whereToTurn.transform.rotation     = originRot;
                rightTurnChunks.SetActive(true);
            }
            else
            {
                Debug.Log("턴파트에서 오류001");
            }
        }
示例#4
0
        public void ChangeFloor(E_WhichTurn whichTurn)    //그냥 청크면 낙턴으로 보내줄것.
        {
            if (floorChunk == null)
            {
                ErrorManager.SpurtError("생성도 안됐는데 청크를 바꾸려함,");
            }
            if (this.whichTurn == whichTurn)
            {
                Debug.Log("똑같은 턴 반향임");
                return;
            }

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

            soa.spawnObjType[0] = E_SPAWN_OBJ_TYPE.NOTHING;
            soa.spawnObjType[1] = E_SPAWN_OBJ_TYPE.NOTHING;
            soa.spawnObjType[2] = E_SPAWN_OBJ_TYPE.NOTHING;

            this.whichTurn = whichTurn;
            //위치턴 따라서 플로어 청크 분기해오기.
            bornPos.z = floorChunk.transform.position.z;
            MapAndObjPool.GetInstance().TurnInPoolObj(floorChunk);

            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);
        }
示例#5
0
        public static void EnqueStageTurningPoint(float tp, E_WhichTurn wt)
        {
            if (tp < Constants.turningTerm || wt == E_WhichTurn.NOT_TURN || tp < lastTurningPoint + Constants.turningTerm)
            {
                return;                                                                                                              //터닝 포인트 조건 충족 못함.
            }
            StageTurnPointSet tempTPS = new StageTurnPointSet(tp, wt);

            turningPointQueue.Enqueue(tempTPS);
            lastTurningPoint = tp;
        }
示例#6
0
 void TurnCheck(float turningPoint, E_WhichTurn whichTurn)
 {
     Debug.Log("델리게이트 이벤트 호출 받음 매개변수 =" + turningPoint + whichTurn);
     if (this.whichTurn == whichTurn && this.turningPoint == turningPoint)
     {
         Debug.Log("터닝체크완료.");
         Turn();
     }
     else
     {
         Debug.Log("터닝 체크 매개변수 맞지 않음.");
     }
 }
示例#7
0
        public void MakeTurnSetQueNode(int number = 1)
        {
            if (number < 1)
            {
                number = 1;
            }
            for (int i = 0; i < number; i++)
            {
                float tp = exTurnPoint + Random.Range(Constants.turningTerm, Constants.turningTerm + 10);    //10~ 20 후에 터닝포인트 생성
                exTurnPoint = tp;
                E_WhichTurn wt = (Random.Range(0, 2) == 0) ? wt = E_WhichTurn.LEFT : wt = E_WhichTurn.RIGHT;

                StageST.EnqueStageTurningPoint(tp, wt);
            }
        }
        public void OnChunkChangeClick(Button btn)
        {
            E_WhichTurn whichTurn = E_WhichTurn.NOT_TURN;

            switch (btn.name)
            {
            case "Btn_Left":
                whichTurn = E_WhichTurn.LEFT;
                break;

            case "Btn_NotTurn":
                whichTurn = E_WhichTurn.NOT_TURN;
                break;

            case "Btn_Right":
                whichTurn = E_WhichTurn.RIGHT;
                break;
            }
            sem.ChangeFloorChunk(whichTurn);
            ShowReset();
        }
示例#9
0
        public void ChangeFloorChunk(E_WhichTurn whichTurn)
        {
            if (CanItBeTurnChunks() == false)
            {
                Debug.Log("회전 조건 충족 못함");
                return;
            }

            StageEditorST sest = FindEditSTByPos(position);

            if (sest == null)
            {
                ErrorManager.SpurtError("절대 있을 수 없는 , 호출을 잘못한 듯.");
            }

            sest.ChangeFloor(whichTurn);

            if (whichTurn != E_WhichTurn.NOT_TURN)   //회전 청크로 바꿨다면 조정
            {
                ModerateListForTurnChunks(position);
            }

            ClearAndShowChunks();   //청크를 바꿨으면 빈공간 나가리가 쭉 생기게 되니까.
        }
示例#10
0
 public void DisableThisSet()
 {
     turningPoint = -1;
     whichTurn    = E_WhichTurn.NOT_TURN;
     Init         = true;
 }
示例#11
0
 public StageTurnPointSet(float tp, E_WhichTurn wt)
 {
     turningPoint = tp;
     whichTurn    = wt;
     Init         = false;
 }
示例#12
0
 public StageEditorST(int pos, E_WhichTurn whichTurn, StageObjArr soa)
 {
     this.pos       = pos;
     this.whichTurn = whichTurn;
     this.soa       = soa;
 }
示例#13
0
 public StageEditorST(int pos, E_WhichTurn whichTurn)
 {
     this.pos       = pos;
     this.whichTurn = whichTurn;
 }
示例#14
0
    // Update is called once per frame
    void Update()
    {
        if (turningpoint == 0)
        {
            isTurn = false;
        }

        if (ObjEat.Invincible)
        {
            ThisTurn = GetWhichTurnInUI();
            SwipeToTurn();
        }
        // 일시정지이거나 클리어 했을 경우 터치 안되게 조절
        if (!UIManager.isPause && !CharacterAnimation.Win)
        {
            CanMove = !ObjEat.unityChanDie && !ObjEat.HitInvincible && !ObjEat.Invincible;
            if (Input.GetMouseButtonDown(0))
            {
                //if (Input.mousePosition.y > (height / 2.5))
                //마우스 클릭시 포지션 저장
                ButtonDownMousePos = Input.mousePosition;
                TapCount           = 1;
            }
            // 마우스 클릭 유지시
            if (Input.GetMouseButton(0))
            {
                MousePosX = Input.mousePosition.x;
                MousePosY = Input.mousePosition.y;
                ////하단 부분 클릭 했을 경우
                //if (TapCount == 0 && CanMove) { if (MousePosY < (height / 2.5)) {
                //        //좌측으로 이동
                //        if (MousePosX < (width / 2)) { cMove.turningPoint = false; cMove.Move(true); }
                //        //우측으로 이동
                //        else { cMove.turningPoint = false; cMove.Move(false); } }
                //}
            }
            //마우스 클릭 종료시
            else if (Input.GetMouseButtonUp(0))
            {
                if (TapCount == 1 && CanMove)
                {
                    float MoveXLength = ButtonDownMousePos.x - MousePosX;
                    float MoveYLength = ButtonDownMousePos.y - MousePosY;

                    //위로 스와이프
                    if (-MoveYLength > (height / 10))
                    {
                        cMove.Jump();
                    }
                    //아래로 스와이프
                    else if (MoveYLength > (height / 10))
                    {
                        cMove.SlideDown();
                    }

                    //좌로 스와이프
                    if (MoveXLength > (width / 5))
                    {
                        ThisTurn = E_WhichTurn.LEFT;
                        SwipeToTurn();
                    }
                    //우로 스와이프
                    else if (-MoveXLength > (width / 5))
                    {
                        ThisTurn = E_WhichTurn.RIGHT;
                        SwipeToTurn();
                    }

                    TapCount = 0;
                }
            }
        }
    }
示例#15
0
 public void SetWhichTurnToUI(E_WhichTurn whichTurn)
 {
     this.whichTurn = whichTurn;
 }