Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class Shop : MonoBehaviour
- {
- public float pistol = 5;
- public float mp9 = 45;
- public float LonGun = 105;
- public float HealthChip = 15;
- public float UnPosionChip = 20;
- public float ShieldChip = 30;
- public float AirDrop = 50;
- public float Bullet = 2;
- public GameManager GM;
- public bool PistolEquiped = false;
- public bool MP9Equiped = false;
- public bool LonGunEquiped = false;
- public bool AirDropBuy = false;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
- public void Pistol()
- {
- if(GM.Money >= pistol)
- {
- if ( !PistolEquiped)
- {
- GM.Money -= pistol;
- PistolEquiped = true;
- MP9Equiped = false;
- LonGunEquiped = false;
- }
- }
- }
- public void MP9()
- {
- if(GM.Money >= mp9)
- {
- if ( !MP9Equiped)
- {
- GM.Money -= mp9;
- MP9Equiped = true;
- PistolEquiped = false;
- LonGunEquiped = false;
- }
- }
- }
- public void LonGuN()
- {
- if(GM.Money >= LonGun)
- {
- if ( !LonGunEquiped)
- {
- GM.Money -= LonGun;
- LonGunEquiped = true;
- PistolEquiped = false;
- MP9Equiped = false;
- }
- }
- }
- public void HCh()
- {
- if(GM.Money >= HealthChip)
- {
- if (GM.Health < 1)
- {
- GM.Money -= HealthChip;
- GM.Health = 1;
- }
- }
- }
- public void SCh()
- {
- if(GM.Money >= ShieldChip)
- {
- if (GM.Armor < 6)
- {
- GM.Money -= ShieldChip;
- GM.Armor += 1;
- }
- }
- }
- public void UPCh()
- {
- if(GM.Money >= UnPosionChip)
- {
- if (GM.Poison > 0)
- {
- GM.Money -= UnPosionChip;
- GM.Poison = 0;
- }
- }
- }
- public void Airdrop()
- {
- if(GM.Money >= AirDrop)
- {
- if ( !AirDropBuy)
- {
- GM.Money -= AirDrop;
- AirDropBuy = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement