// Diables the controls when the player is not active private void OnDisable() { controls.Disable(); puzzleModeUI.SetActive(false); currPiece = null; pieceDetector = null; isFastFall = false; beforeFastFally = 0f; }
private void SetPreviewImage() { if (nextPiecePreview.gameObject.activeInHierarchy == false) { nextPiecePreview.gameObject.SetActive(true); } PuzzleDetection futurePiece = listOfPossiblePieces[nextPieceIndex].GetComponentInChildren <PuzzleDetection>(); nextPiecePreview.sprite = futurePiece.previewImage; }
public void AssignPiece(GameObject newPiece) { currPiece = newPiece.GetComponent <Rigidbody2D>(); pieceDetector = newPiece.GetComponent <PuzzleDetection>(); }