Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Food : MonoBehaviour {
- public float Weight;
- public GameObject foodholder;
- public void Eaten(float t)
- {
- Weight -= t;
- if (Weight <= 0)
- {
- foodholder.GetComponent<FoodHolder>()._foodList.Remove(gameObject); ;
- Destroy(gameObject);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement