Files
defrain-shooter-unity/Assets/Scripts/Weapons/Gun.cs
Noah4ever 5fd5f27ac6 Abstract Gun.cs & Weapon.cs
Gun.cs muss vlt noch umbenannt werden, weil Gun  Pistole heißt und nicht ein oberbegriff für alle Waffen ist.
2022-01-19 21:41:02 +01:00

47 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class Gun
{
// All types of guns
public enum types
{
Rifle, Pistole, Melee, Grenade
}
// Type of gun
private types type;
// Name of gun
private string name;
// Damage of gun
private float damage;
// Strength of throw
private float dropForce;
//private Animator gunAnimator;
//private Transform gunRightREF;
//private Transform gunLeftREF;
// Constructor
public Gun()
{
this.type = types.Rifle;
this.name = "Weapon";
this.damage = 0f;
this.dropForce = 10f;
}
public Gun(types type, string name, float damage, float dropforce)
{
this.type = type;
this.name = name;
this.damage = damage;
this.dropForce = dropforce;
}
// Getter
private types Type { get => type; }
private string Name { get => name; }
private float Damage { get => damage; }
public float DropForce { get => dropForce; }
}