mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-11-02 06:22:30 +01:00
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:
46
Assets/Scripts/Weapons/Gun.cs
Normal file
46
Assets/Scripts/Weapons/Gun.cs
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user