示例#1
0
    public void Drop()
    {
        if (c_MyBlock == null)
        {
            c_MyBlock = GetComponent <C_ImBlock>();
        }

        Clicked = false;


        joyVec = Vector3.zero;
    }
示例#2
0
 public void candy_special_setting(C_ImBlock c_Im, int get_num)
 {
     c_Im.VerticalBoom   = 0;
     c_Im.HorizontalBoom = 0;
     c_Im.BagBoom        = 0;
     c_Im.ColorBoom      = 0;
     if (get_num == 100)
     {
         c_Im.ColorBoom = 1;
     }
     else if (get_num == 5)
     {
         c_Im.VerticalBoom = 1;
     }
     else if (get_num == 10)
     {
         c_Im.HorizontalBoom = 1;
     }
     else if (get_num == 15)
     {
         c_Im.BagBoom = 1;
     }
 }
示例#3
0
        // 스왑기능
        public void Swap(int xLine, int yLine, int s_xLine, int s_yLine)
        {
            // 게임 로직이 2일때
            if (gm.Game_Logic_State == 2)
            {
                GameObject tempobj;
                tempobj = gm.GetBlockObject(xLine, yLine);
                gm.c_board.V[xLine].H[yLine].block.HereBlockObject     = gm.GetBlockObject(s_xLine, s_yLine);
                gm.c_board.V[s_xLine].H[s_yLine].block.HereBlockObject = tempobj;

                First  = gm.Get_ImBlock(xLine, yLine);
                Second = gm.Get_ImBlock(s_xLine, s_yLine);
                Special_BoomCount_Check();

                xy.X   = xLine;
                xy.Y   = yLine;
                s_xy.X = s_xLine;
                s_xy.Y = s_yLine;
                int Sum = 0;

                // 마우스 이동방향 오브젝트와 Swap 후
                // 3Match가능한지 검사
                // Sum값이 1 이상이면 바꾸기 가능이므로 애니메이션 실행
                // 0 이하일 경우 불가능 하므로 갔다오는 애니메이션을 실행한 후 다시 Swap (원상태)
                Sum = gm.match_Finder.GetThreeMatch();

                if (SpecialBoomCount == 2 || ColorBoomCount == 1)
                {
                    EventManager.Emit("MatchComplete");
                    Special_Swap();
                    gm.Game_Logic_State = 1;
                    gm.ChangeLogicTimer(0.3f);
                }
                // Sum > 0 바꾸기 가능
                else if (Sum > 0)
                {
                    EventManager.Emit("MatchComplete");
                    gm.Get_ImBlock(xLine, yLine).MoveEnQueue(xy);
                    gm.Get_ImBlock(s_xLine, s_yLine).MoveEnQueue(s_xy);
                    gm.ChangeLogicTimer(0.1f);
                    gm.Game_Logic_State = 0;
                }
                // Sum == 0 바꾸기 불가능
                // 다시 되돌리기.
                else
                {
                    gm.Get_ImBlock(xLine, yLine).MoveEnQueue(xy);
                    gm.Get_ImBlock(s_xLine, s_yLine).MoveEnQueue(s_xy);
                    tempobj = gm.GetBlockObject(xLine, yLine);
                    gm.c_board.V[xLine].H[yLine].block.HereBlockObject     = gm.GetBlockObject(s_xLine, s_yLine);
                    gm.c_board.V[s_xLine].H[s_yLine].block.HereBlockObject = tempobj;
                    gm.Get_ImBlock(xLine, yLine).MoveEnQueue(xy, 0.1f);
                    gm.Get_ImBlock(s_xLine, s_yLine).MoveEnQueue(s_xy, 0.1f);
                    gm.ChangeLogicTimer(0.2f);
                    gm.Game_Logic_State = 2;
                }

                // 스왑이 끝나면 다음 액션을 할 수 있도록 Logic Ready 값을 바꿔줌.
                // GameManager.CS 의 Game_Routine 코루틴 참조
                gm.Next_Logic_Ready = false;
            }
        }
示例#4
0
 // 조이스틱 CS 기능
 // 각 과일은 조이스틱 함수를 가지고있고
 // 클릭하면 PointDown, OnMouseDrag 함수가 실행됨.
 // 클릭한 상태로 일정거리 이상 움직이면 GameManager에서 Swap
 private void Start()
 {
     gm        = C_GameManager.Instance;
     c_MyBlock = GetComponent <C_ImBlock>();
 }