mirror of
				https://github.com/DerTyp7/example-top-down-unity.git
				synced 2025-10-31 13:27:06 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			535 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			535 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
 | |
| using UnityEngine;
 | |
| 
 | |
| public class TreeInteraction : Harvestable
 | |
| {
 | |
|     [SerializeField]
 | |
|     Item dropItem;
 | |
| 
 | |
|     
 | |
|     public override string GetDescription()
 | |
|     {
 | |
|         if (isInRange())
 | |
|             return "Baum muss weg";
 | |
|         else  
 | |
|             return "Tree is not in range";
 | |
|     }
 | |
|     public override void Interact()
 | |
|     {
 | |
|         if (!isHarvested)
 | |
|         {
 | |
|             Debug.Log("Harvest BAUM");
 | |
|             Inventory.PlayerInstance.Add(dropItem, Random.Range(1, 10));
 | |
|             isHarvested = true;
 | |
|         }
 | |
|         
 | |
|     }
 | |
| } | 
