void Shoot() { Debug.Log("Shoot"); if (target != null) { GameObject bulletGo = (GameObject)Instantiate(bullet_prefab, gameObject.transform.position, gameObject.transform.rotation); Bullet_script bulletscr = bulletGo.GetComponent <Bullet_script>(); bulletscr.Ara(target); } }
void Fire() { if (target == null) { return; } GameObject Bullet_GO = (GameObject)Instantiate(bullet_prefab, fire_point.position, fire_point.rotation); Bullet_script bullet = Bullet_GO.GetComponent <Bullet_script>(); if (bullet != null) { bullet.Ara(target); } }