public void AddToInventory(PuzzlePiece piece) { if (piece != null) { Items.Add(piece); piece.MovePiece(this.transform, false, false); InventoryItemChanged.Invoke(); } }
private void SetCurrentPiece(int index) { if (CurrentPiece != null) { CurrentPiece.MovePiece(this.transform, false, false); } if (Pieces.Length > 0) { CurrentPiece = Pieces[index]; CurrentPiece.MovePiece(this.transform, true, false); } }
public void UsePuzzleSlot(Inventory inventory) { if (!puzzle.Rewarded) { if (currentPiece != null) { inventory.AddToInventory(currentPiece); currentPiece = null; } if (inventory.CurrentPuzzlePiece != null) { if (puzzle.PuzzleID == inventory.CurrentPuzzlePiece.PuzzleID) { currentPiece = inventory.TakeCurrentItem(); currentPiece.MovePiece(this.transform, true, false); } } puzzle.CheckSolution(); } }