mirror of
https://github.com/DerTyp7/defrain-shooter-unity.git
synced 2025-11-02 06:22:30 +01:00
Gun.cs muss vlt noch umbenannt werden, weil Gun Pistole heißt und nicht ein oberbegriff für alle Waffen ist.
47 lines
1.0 KiB
C#
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; }
|
|
}
|