砲弾を破壊する


砲弾を破壊する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyShell : MonoBehaviour
{
public GameObject effectPrefab;
private void OnCollisionEnter(Collision collision)
{
Destroy(gameObject);
GameObject effect = Instantiate(effectPrefab, transform.position, Quaternion.identity);
Destroy(effect, 0.5f);
}
}




砲弾を破壊する
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyShell : MonoBehaviour
{
public GameObject effectPrefab;
private void OnCollisionEnter(Collision collision)
{
Destroy(gameObject);
GameObject effect = Instantiate(effectPrefab, transform.position, Quaternion.identity);
Destroy(effect, 0.5f);
}
}


砲弾を破壊する