using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExplosionTest : MonoBehaviour
{
public GameObject Bomb;//爆発を呼び出す場所
public GameObject Explosion;//呼び出す爆発
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A))//Aキーがおされたら
{
Instantiate(Explosion.gameObject, Bomb.transform.position, Bomb.transform.rotation);//爆発をBombの場所にBombの向きで呼び出す
Destroy(Bomb.gameObject, 0.1f);//Bombを0.1秒後に消す
Destroy(Explosion.gameObject, 3);//Explosionを3秒後に消す
}
}
}