mirror of
				https://github.com/DerTyp7/example-top-down-unity.git
				synced 2025-11-03 22:38:58 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			759 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			759 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System.Collections;
 | 
						|
using System.Collections.Generic;
 | 
						|
using UnityEngine;
 | 
						|
 | 
						|
public class TreeInteraction : Harvestable
 | 
						|
{
 | 
						|
 | 
						|
    Inventory playerInv;
 | 
						|
 | 
						|
    [SerializeField]
 | 
						|
    List<Item> drops = new List<Item>();
 | 
						|
 | 
						|
    private void Start()
 | 
						|
    {
 | 
						|
        playerInv = GameObject.Find("Player").GetComponent<Inventory>();
 | 
						|
        toolType = ToolType.AXE;
 | 
						|
 | 
						|
    }
 | 
						|
 | 
						|
 | 
						|
 | 
						|
    public override string GetDescription()
 | 
						|
    {
 | 
						|
        if (isInRange())
 | 
						|
            return "Baum muss weg";
 | 
						|
        else  
 | 
						|
            return "Tree is not in range";
 | 
						|
    }
 | 
						|
    public override void Interact()
 | 
						|
    {
 | 
						|
        // TODO
 | 
						|
        // ADD DROPS TO INVENTORY
 | 
						|
        // START ANIMATION
 | 
						|
        // DURABILITY ON TOOL
 | 
						|
 | 
						|
        Debug.Log("Harvest BAUM");
 | 
						|
 | 
						|
        Destroy(gameObject);
 | 
						|
    }
 | 
						|
} |