// return circle faceId
        private List <int> circleFaceIdCheck(FieldManager field, Pieces piece)
        {
            //何角形のますにいるかをint型で返す
            int        faceShape         = piece.GetShape();
            List <int> circleFaceIdCheck = new List <int>();
            //辞書型配列で受け取る
            Dictionary <int, List <int> > MovableRange = GameManager.ManagerStore.piecesManager.GetMoveRange(piece.GetKind());
            //辞書型配列で受け取った稼働範囲からforeachでそれぞれ検証
            List <int> movableFaces = MovableRange[faceShape];

            foreach (int movableFace in movableFaces)
            {
                //候補の面の相対idを絶対idに変換
                circleFaceIdCheck.Add(field.ConvertRelative2AbsId(piece.GetFaceId(), movableFace, piece.GetForwardDirection()));
            }
            return(circleFaceIdCheck);
        }
示例#2
0
        //駒をrotate辺回転する ex)rotateが-1で10角形なら-36度
        public void RotatePiece(int pieceId, int rotate)
        {
            Pieces piece = GetPieceById(pieceId);

            int        rotationAmount = (360 / piece.GetShape()) * rotate;
            Quaternion rot            = Quaternion.AngleAxis(rotationAmount, Vector3.up);
            Quaternion q = piece.transform.rotation;

            piece.transform.rotation = q * rot;

            int forwardFaceId = fieldManager.ConvertRelative2AbsId(piece.GetFaceId(), 0, piece.GetForwardDirection());

            piece.SetForwardFaceId(forwardFaceId);
        }