25 lines
449 B
C#
Raw Normal View History

2025-03-16 21:57:56 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Dot : MonoBehaviour
{
2025-03-17 21:56:02 +08:00
public float Score;
private void Awake()
{
}
2025-03-16 21:57:56 +08:00
private void OnTriggerEnter2D(Collider2D collision)
{
2025-03-17 21:56:02 +08:00
if(collision.gameObject.layer == LayerMask.NameToLayer("PacMan"))
{
GameManager.instance.AddScore(Score);
Destroy(this.gameObject);
}
2025-03-16 21:57:56 +08:00
}
}