Advertisement
Mr_Kapitoshka

Untitled

Jun 28th, 2021 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.57 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Shop : MonoBehaviour
  6. {
  7.     public float pistol = 5;
  8.     public float mp9 = 45;
  9.     public float LonGun = 105;
  10.     public float HealthChip = 15;
  11.     public float UnPosionChip = 20;
  12.     public float ShieldChip = 30;
  13.     public float AirDrop = 50;
  14.     public float Bullet = 2;
  15.     public GameManager GM;
  16.     public bool PistolEquiped = false;
  17.     public bool MP9Equiped = false;
  18.     public bool LonGunEquiped = false;
  19.     public bool AirDropBuy = false;
  20.  
  21.     // Start is called before the first frame update
  22.     void Start()
  23.     {
  24.        
  25.     }
  26.  
  27.     // Update is called once per frame
  28.     void Update()
  29.     {
  30.        
  31.     }
  32.  
  33.     public void Pistol()
  34.     {
  35.         if(GM.Money >= pistol)
  36.         {
  37.             if ( !PistolEquiped)
  38.             {
  39.                 GM.Money -= pistol;
  40.                 PistolEquiped = true;
  41.                 MP9Equiped = false;
  42.                 LonGunEquiped = false;
  43.             }
  44.         }
  45.     }
  46.     public void MP9()
  47.     {
  48.         if(GM.Money >= mp9)
  49.         {
  50.             if ( !MP9Equiped)
  51.             {
  52.                 GM.Money -= mp9;
  53.                 MP9Equiped = true;
  54.                 PistolEquiped = false;
  55.                 LonGunEquiped = false;
  56.             }
  57.         }
  58.     }
  59.     public void LonGuN()
  60.     {
  61.         if(GM.Money >= LonGun)
  62.         {
  63.             if ( !LonGunEquiped)
  64.             {
  65.                 GM.Money -= LonGun;
  66.                 LonGunEquiped = true;
  67.                 PistolEquiped = false;
  68.                 MP9Equiped = false;
  69.             }
  70.         }
  71.     }
  72.     public void HCh()
  73.     {
  74.         if(GM.Money >= HealthChip)
  75.         {
  76.             if (GM.Health < 1)
  77.             {
  78.                 GM.Money -= HealthChip;
  79.                 GM.Health = 1;
  80.             }
  81.         }
  82.     }
  83.     public void SCh()
  84.     {
  85.         if(GM.Money >= ShieldChip)
  86.         {
  87.             if (GM.Armor < 6)
  88.             {
  89.                 GM.Money -= ShieldChip;
  90.                 GM.Armor += 1;
  91.             }
  92.         }
  93.     }
  94.             public void UPCh()
  95.     {
  96.         if(GM.Money >= UnPosionChip)
  97.         {
  98.             if (GM.Poison > 0)
  99.             {
  100.                 GM.Money -= UnPosionChip;
  101.                 GM.Poison = 0;
  102.             }
  103.         }
  104.     }
  105.     public void Airdrop()
  106.     {
  107.         if(GM.Money >= AirDrop)
  108.         {
  109.             if ( !AirDropBuy)
  110.             {
  111.                 GM.Money -= AirDrop;
  112.                 AirDropBuy = true;
  113.             }
  114.         }
  115.     }
  116.    
  117.    
  118.  
  119.  
  120.  
  121.  
  122. }
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement