Beispiel #1
0
    public void CheckForCollectable(PuzzlePivot puzzlePivot, bool hasCollectedCollectable)
    {
        if (!LevelView.IsCollectableLayerOn || hasCollectedCollectable || puzzlePivot.collectableObject == null)
        {
            return;
        }
        if (puzzlePivot.collectableObject.activeSelf)
        {
            return;
        }
        if (collectableKeyPieceDictionary.IsPiecesPlacedCorrectly(puzzlePivot))
        {
            var collectableSnapablePoint = SnapablePoint.GetSnapablePointWithPieceId(puzzlePivot, collectableKeyPieceDictionary.keyPiece.id);
            var offset = collectableKeyPieceDictionary.originalPosition - collectableSnapablePoint.piece.transform.localPosition;
            offset.z = 0;
            puzzlePivot.collectableObject.transform.localPosition -= offset;
            puzzlePivot.collectableObject.SetActive(true);

            foreach (var piece in puzzlePivot.pieces)
            {
                piece.CollectableLayerRenderer.gameObject.SetActive(false);
            }
        }
    }
 internal virtual bool CheckForWin()
 {
     return(goalKeyPieceDictionary.IsPiecesPlacedCorrectly(this));
 }