You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
369 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class VegetableSpawner : MonoBehaviour {
  5. public Vegetable thisVeg;
  6. public void OnCollisionEnter(Collision other)
  7. {
  8. if (other.gameObject.tag == "Player")
  9. {
  10. other.gameObject.GetComponent<LocalPlayer>().PickupVeggie(thisVeg);
  11. }
  12. }
  13. }