예제 #1
0
            public void Shutdown()
            {
                IsMoving   = false;
                IsRotating = false;

                if (IsMoving)
                {
                    GameManager.ClearSpace(m_destPos);
                }
                else
                {
                    GameManager.ClearSpace(m_startPos);
                }
            }
예제 #2
0
            public void Move(Direction dirToMove)
            {
                if (IsMoving)
                {
                    return;
                }

                Vector3 axisToMove = AxisFromDirection(dirToMove);
                Vector3 dest       = m_viewObj.transform.position + (axisToMove * GameManager.s_GridCellSize);

                if (!GameManager.IsClear(dest))
                {
                    return;
                }

                if (GameManager.TakeSpace(dest))
                {
                    m_destPos = dest;
                    GameManager.ClearSpace(m_startPos);
                    IsMoving = true;
                }
            }