Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TMPro;
- using UnityEngine.UI;
- public class HarvestNode : Interactable {
- [SerializeField]
- private int minAmount;
- [SerializeField]
- private int maxAmount;
- [SerializeField]
- private float timeToHarvest = 2f;
- [SerializeField]
- private bool isInteracted = false;
- private float harvestingtime = 0f;
- [SerializeField] private TextMeshProUGUI harvestBar;
- public GameObject droppedObject;
- public override void Interact()
- {
- base.Interact();
- Harvest();
- }
- private void Harvest()
- {
- isInteracted = true;
- }
- private void Update()
- {
- if(isInteracted)
- Destroy(gameObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement