Advertisement
Askor

Weapon

Jan 7th, 2022
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public abstract class Weapon : MonoBehaviour
  6. {
  7.     [SerializeField] private string _label;
  8.     [SerializeField] private int _price;
  9.     [SerializeField] private Sprite _icon;
  10.     [SerializeField] private bool _isPurchased = false;
  11.  
  12.     [SerializeField] protected Bullet Bullet;
  13.  
  14.     public string Label => _label;
  15.     public int Price => _price;
  16.     public Sprite Icon => _icon;
  17.     public bool IsPurchased => _isPurchased;
  18.  
  19.     public abstract IEnumerator Shoot(Transform shootPoint);
  20.  
  21.     public void Buy()
  22.     {
  23.         _isPurchased = true;
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement