コード例 #1
0
 // Updates mesh, rotates UV coordinates, and updates world rotation to match
 public void SetMesh(PuzzleMeshRandomizer.PuzzleShape Shape, float CW_Rotation = 0.0f)
 {
     ShapeEnum = Shape;
     Rotation  = CW_Rotation;
     InternalSetMesh(PuzzleMeshRandomizer.GetPuzzleMesh(Shape), CW_Rotation);
     transform.rotation = Quaternion.AngleAxis(CW_Rotation, Vector3.up) * transform.rotation;
 }
コード例 #2
0
    private void Start()
    {
        if (StaticJigsawData.PuzzleWidth >= 2)
        {
            GridWidth = StaticJigsawData.PuzzleWidth;
        }
        if (StaticJigsawData.PuzzleHeight >= 2)
        {
            GridHeight = StaticJigsawData.PuzzleHeight;
        }

        PuzzleRandomizer = (PuzzleMeshRandomizer)FindObjectOfType(typeof(PuzzleMeshRandomizer));
        GeneratePuzzlePieces(StaticJigsawData.PuzzleTexture);
        FindObjectOfType <BoardScalingHandler>().SetBoardDimensions(new Vector2(PuzzleSpaceGridScale * GridWidth, PuzzleSpaceGridScale * GridHeight));
    }
コード例 #3
0
 public void ClientSetPuzzleTexture(Texture2D PuzzleTexture)
 {
     InternalSetMesh(PuzzleMeshRandomizer.GetPuzzleMesh(ShapeEnum), Rotation);
     InternalSetMaterialInfo(PuzzleTexture, MatScaleX, MatScaleY, MatOffsetX, MatOffsetY);
 }