void FireBullet(fireType type) { switch (type) { case fireType.NOMAL: GetComponent <AudioSource>().Play(); // 효과음 시작 Instantiate(bulletObj, transform.position, transform.rotation); // 총알 생성 break; case fireType.HEAVY: GetComponent <AudioSource>().Play(); // 효과음 시작 Instantiate(bulletObj, transform.position, transform.rotation); Instantiate(bulletObj, transform.position + new Vector3(-0.3f, 0.0f, 0.0f), transform.rotation); Instantiate(bulletObj, transform.position + new Vector3(0.3f, 0.0f, 0.0f), transform.rotation); break; case fireType.FAST: GetComponent <AudioSource>().Play(); // 효과음 시작 Instantiate(bulletObj, transform.position, transform.rotation); // 총알 생성 break; default: Debug.Log("GunFireScript FireBullet error"); break; } }
void Start() { currFireType = fireType.semiAuto; ammo = 50; isTrigger = false; }