我正在练习制作游戏,但不断出现此错误=找不到类型或名称空间名称'Enemy'(您是否缺少using指令或程序集引用?]
using UnityEngine;
public class Emeny : MonoBehaviour
{
private void OnCollisionEnter2D(Collision2D collision)
{
Bird bird = collision.collider.GetComponent<Bird>();
if (bird != null)
{
Destroy(gameObject);
return;
}
Enemy enemy = collision.collider.GetComponent<Enemy>();
if (enemy != null)
{
return;
}
if (collision.contacts[0].normal.y < -0.5)
{
Destroy(gameObject);
}
}
}