xirang/Assets/scripts/Bullet.cs

28 lines
574 B
C#
Raw Normal View History

2024-11-26 22:01:14 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bullet : MonoBehaviour
{
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("enemy"))
{
Destroy(this.gameObject);
}
if (collision.gameObject.CompareTag("ore"))
{
Destroy(this.gameObject);
Destroy(this.gameObject);
}
}
void OnParticleCollision(GameObject other)
{
if (other.tag == "enemy")
{
}
}
}