Ejemplo n.º 1
0
 public void CheckPuzzlePiece(Collider other)
 {
     if (other.GetComponent <PuzzlePiece>() == PuzzlePiece.GetComponent <PuzzlePiece>())
     {
         correctPiecePlaced = true;
         puzzleManager.CheckIfPuzzleIsSolved();
     }
 }
Ejemplo n.º 2
0
    bool IsSolution(PuzzlePiece otherPiece)
    {
        if (!(transform.parent != null &&
              transform.parent.name == "Solution" &&
              transform.childCount == 0))
        {
            return(false);
        }

        var spriteRenderer      = GetComponent <SpriteRenderer>();
        var otherSpriteRenderer = otherPiece.GetComponent <SpriteRenderer>();

        return(spriteRenderer.sprite == otherSpriteRenderer.sprite);
    }