From 665f89954ae0cc4459254f76189cb12f430a931f Mon Sep 17 00:00:00 2001 From: Anonymous Raccoon <32224410+AnonymusRaccoon@users.noreply.github.com> Date: Mon, 13 Aug 2018 20:15:11 +0200 Subject: [PATCH] Adding board clear function. --- Assets/Script/InventoryManager.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/Script/InventoryManager.cs b/Assets/Script/InventoryManager.cs index 39d328d..6769b5c 100644 --- a/Assets/Script/InventoryManager.cs +++ b/Assets/Script/InventoryManager.cs @@ -322,6 +322,17 @@ public class InventoryManager : MonoBehaviour return true; } + public void ClearBoard() + { + for (int i = 0; i < 25; i++) + { + if(plots[i].treePlaced != TreeType.Nothing) + DeleteTreeAt(i); + + plots[i].treePlaced = TreeType.Nothing; + } + } + public void StartDraggin(int index) { if (items[index].count > 0)