Skip to content

Instantly share code, notes, and snippets.

@jweimann
Last active November 14, 2016 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jweimann/a39462c70c10a24e132f74f4e16eea02 to your computer and use it in GitHub Desktop.
Save jweimann/a39462c70c10a24e132f74f4e16eea02 to your computer and use it in GitHub Desktop.
using UnityEngine;
[CreateAssetMenu(menuName = "Weapons/WeaponSettings")]
public class WeaponSettings : ScriptableObject
{
[SerializeField]
[Tooltip("Time required between trigger clicks to fire.")]
[Range(0, 2f)]
private float _fireDelay = 0.25f;
[SerializeField]
[Tooltip("Max range this weapon can shoot.")]
[Range(1, 200f)]
private float _maxRange = 50f;
[SerializeField]
[Tooltip("Damage dealt by this weapon (not including any modifiers).")]
[Range(1, 10)]
private int _damage = 1;
[SerializeField]
[Tooltip("Amount of ammo the weapon starts with.")]
[Range(1, 1000)]
private int _startingAmmo = 24;
[SerializeField]
[Tooltip("Number of shots the weapon can use per reload.")]
[Range(1, 1000)]
private int _ammoPerClip = 6;
public int Damage { get { return _damage; } }
public float FireDelay { get { return _fireDelay; } }
public float MaxRange { get { return _maxRange; } }
public int StartingAmmo { get { return _startingAmmo; } }
public int AmmoPerClip { get { return _ammoPerClip; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment