// 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; }
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)); }
public void ClientSetPuzzleTexture(Texture2D PuzzleTexture) { InternalSetMesh(PuzzleMeshRandomizer.GetPuzzleMesh(ShapeEnum), Rotation); InternalSetMaterialInfo(PuzzleTexture, MatScaleX, MatScaleY, MatOffsetX, MatOffsetY); }