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.
This commit is contained in:
Noah4ever
2022-01-19 21:41:02 +01:00
parent 80a44e6d3e
commit 5fd5f27ac6
8 changed files with 177 additions and 55 deletions

View File

@@ -0,0 +1,46 @@
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; }
}