45 lines
870 B
C#
45 lines
870 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class Gun : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// gun stats
|
|
/// </summary>
|
|
public int magSize;
|
|
public int damage;
|
|
public float fireRate;
|
|
public float range;
|
|
public float reloadTime;
|
|
public int bulletsPerFire;
|
|
public float timeBetweenShots;
|
|
public bool automaticFire;
|
|
|
|
/// <summary>
|
|
/// gun status
|
|
/// </summary>
|
|
private bool reloading;
|
|
private bool shooting;
|
|
private bool readyToShot;
|
|
private int bulletsLeft;
|
|
private int bulletsShot;
|
|
|
|
/// <summary>
|
|
/// Refrencing
|
|
/// </summary>
|
|
[SerializeField]
|
|
Camera fpsCam;
|
|
public TextMeshProUGUI bulletCounter;
|
|
|
|
void Start() {
|
|
bulletsLeft=magSize;
|
|
readyToShot=true;
|
|
}
|
|
void onShoot()
|
|
{
|
|
|
|
}
|
|
}
|