22 lines
390 B
C#
22 lines
390 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class Done_WeaponController : MonoBehaviour
|
|
{
|
|
public GameObject shot;
|
|
public Transform shotSpawn;
|
|
public float fireRate;
|
|
public float delay;
|
|
|
|
void Start ()
|
|
{
|
|
InvokeRepeating ("Fire", delay, fireRate);
|
|
}
|
|
|
|
void Fire ()
|
|
{
|
|
Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
|
|
GetComponent<AudioSource>().Play();
|
|
}
|
|
}
|