19 lines
359 B
C#
19 lines
359 B
C#
using UnityEngine;
|
|
|
|
public class Pellet : MonoBehaviour
|
|
{
|
|
public int points = 10;
|
|
protected virtual void Eat()
|
|
{
|
|
FindObjectOfType<GameManager>().PelletEaten(this);
|
|
}
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if(other.gameObject.layer == LayerMask.NameToLayer("Pacman"))
|
|
{
|
|
Eat();
|
|
}
|
|
}
|
|
}
|