22 lines
		
	
	
		
			505 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			505 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System.Collections;
 | 
						|
using System.Collections.Generic;
 | 
						|
using UnityEngine;
 | 
						|
 | 
						|
public class Consumable : MonoBehaviour
 | 
						|
{
 | 
						|
    public int regenAmount;
 | 
						|
    GameObject player;
 | 
						|
 | 
						|
    public void UseConsumable() {
 | 
						|
        player = GameObject.FindWithTag("Player");
 | 
						|
        if (this.name.Contains("health"))
 | 
						|
        {
 | 
						|
            Debug.LogWarning("Health consumable used");
 | 
						|
        }
 | 
						|
        if (this.name.Contains("essence"))
 | 
						|
        {
 | 
						|
            Debug.LogWarning("Essence consumable used");
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 |