Beispiel #1
0
        /// <summary>
        /// 방향 지정 복사)
        /// </summary>
        /// <param name="direction">결과물 복사 방향</param>
        /// <param name="td">결과물 블록 타입</param>
        void Copy(MoveDirection direction, BlockType.TypeDetail td)
        {
            if (direction == MoveDirection.None)
            {
                return;
            }

            Tool.Targeting();

            // 복사 대상이 없을 경우
            if (target == null)
            {
                return;
            }

            // 위치 및 회전값 설정
            Vector3 pos = target.transform.position;

            if (direction == MoveDirection.Left)
            {
                pos.x -= gridSpace.x;
            }
            else if (direction == MoveDirection.Right)
            {
                pos.x += gridSpace.x;
            }
            else if (direction == MoveDirection.Up)
            {
                pos.z += gridSpace.z;
            }
            else if (direction == MoveDirection.Down)
            {
                pos.z -= gridSpace.z;
            }


            // 타겟 방향 재설정
            int yRot = (int)direction - 1;

            target.GetComponent <DynamicBlock>().ReDirection(yRot);

            // 타겟 재설정 및 생성
            target = blockManager.Create(pos, yRot + 2, td).gameObject;

            // 네임박스 재설정
            targetName.text = target.name;

            // 카메라 이동
            MoveCamera(direction);
            MoveCamera(direction);
        }