35 lines
846 B
C#
Raw Permalink 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;
public bool SuperDot;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2025-03-17 21:56:02 +08:00
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"))
{
if (SuperDot && !collision.gameObject.GetComponent<PacMan>().invincible)
{
collision.gameObject.GetComponent<PacMan>().invincible = true;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޵<EFBFBD>
}
else if(SuperDot)
{
collision.gameObject.GetComponent<PacMan>().timer = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD>޵<EFBFBD>ʱ<EFBFBD><CAB1>
}
2025-03-17 21:56:02 +08:00
GameManager.instance.AddScore(Score);
2025-03-17 21:56:02 +08:00
Destroy(this.gameObject);
}
2025-03-16 21:57:56 +08:00
}
}