diff --git a/Assets/Scripts/Interaction/Harvestable.cs b/Assets/Scripts/Interaction/Harvestable.cs index 2d0663e..623392c 100644 --- a/Assets/Scripts/Interaction/Harvestable.cs +++ b/Assets/Scripts/Interaction/Harvestable.cs @@ -9,7 +9,7 @@ public abstract class Harvestable : Interactable [Tooltip("The time for how long the object needs to be harvested.")] [Range(0.1f, 99.9f)] [SerializeField] - float harvestDuration = 3f; + float harvestDuration = 1f; public ToolType toolType; diff --git a/Assets/Scripts/Interaction/TreeInteraction.cs b/Assets/Scripts/Interaction/TreeInteraction.cs index 9a0f289..876f046 100644 --- a/Assets/Scripts/Interaction/TreeInteraction.cs +++ b/Assets/Scripts/Interaction/TreeInteraction.cs @@ -1,11 +1,20 @@ +using System.Collections; +using System.Collections.Generic; using UnityEngine; public class TreeInteraction : Harvestable { + Inventory playerInv; + + [SerializeField] + List drops = new List(); + private void Start() { + playerInv = GameObject.Find("Player").GetComponent(); toolType = ToolType.AXE; + } @@ -19,6 +28,13 @@ public class TreeInteraction : Harvestable } public override void Interact() { + // TODO + // ADD DROPS TO INVENTORY + // START ANIMATION + // DURABILITY ON TOOL + Debug.Log("Harvest BAUM"); + + Destroy(gameObject); } } \ No newline at end of file diff --git a/Assets/Scripts/Inventory/Item.cs b/Assets/Scripts/Inventory/Item.cs index 2cbbac0..4a162fb 100644 --- a/Assets/Scripts/Inventory/Item.cs +++ b/Assets/Scripts/Inventory/Item.cs @@ -9,6 +9,7 @@ public abstract class Item : ScriptableObject public int id; public bool isStackable; public Sprite sprite; + public bool isSelected; public abstract void OnSelect(); diff --git a/Assets/Scripts/Inventory/Items/Lumber.asset b/Assets/Scripts/Inventory/Items/Lumber.asset index 4ba876b..1c5a186 100644 --- a/Assets/Scripts/Inventory/Items/Lumber.asset +++ b/Assets/Scripts/Inventory/Items/Lumber.asset @@ -9,10 +9,11 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: de55e2e3081d4ee4a9d0737e718a5b3b, type: 3} + m_Script: {fileID: 11500000, guid: 0fae7bba50a98204883e78d8d6c96fc2, type: 3} m_Name: Lumber m_EditorClassIdentifier: - name: Lumber - id: 3 - isStackable: 1 - sprite: {fileID: 21300000, guid: 636c61591a702914dadb6abf17d92f6f, type: 3} + name: + id: 0 + isStackable: 0 + sprite: {fileID: 0} + isSelected: 0 diff --git a/Assets/Scripts/Inventory/Items/Wood.asset b/Assets/Scripts/Inventory/Items/Wood.asset index 22176e0..3a25e38 100644 --- a/Assets/Scripts/Inventory/Items/Wood.asset +++ b/Assets/Scripts/Inventory/Items/Wood.asset @@ -9,10 +9,11 @@ MonoBehaviour: m_GameObject: {fileID: 0} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: de55e2e3081d4ee4a9d0737e718a5b3b, type: 3} + m_Script: {fileID: 11500000, guid: 0fae7bba50a98204883e78d8d6c96fc2, type: 3} m_Name: Wood m_EditorClassIdentifier: - name: Wood - id: 2 - isStackable: 1 - sprite: {fileID: 21300000, guid: 30728ae26107dfe438d180ab175fdaca, type: 3} + name: + id: 0 + isStackable: 0 + sprite: {fileID: 0} + isSelected: 0 diff --git a/Assets/Scripts/Inventory/ResourceItem.cs b/Assets/Scripts/Inventory/ResourceItem.cs index 3e75a4d..5541c34 100644 --- a/Assets/Scripts/Inventory/ResourceItem.cs +++ b/Assets/Scripts/Inventory/ResourceItem.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -[CreateAssetMenu(fileName = "FoodItem", menuName = "Items/FoodItem", order = 2)] +[CreateAssetMenu(fileName = "ResourceItem", menuName = "Items/ResourceItem", order = 2)] public class ResourceItem : Item { public override void OnSelect()