Advertisement
TheSuicideHeart

:P

May 30th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class CashTesting : MonoBehaviour {
  5.  
  6.     private float cashPerRound = 1000;
  7.     public float cashPerKill;
  8.     public float scale;
  9.     public int cash = 0;
  10.     public float roundKills = 0;
  11.  
  12.     public int roundNum = 1;
  13.  
  14.     // Use this for initialization
  15.     void Start () {
  16.         endOfRound();
  17.     }
  18.    
  19.     // Update is called once per frame
  20.     void Update () {
  21.        
  22.     }
  23.  
  24.     void endOfRound()
  25.     {
  26.         if (roundNum > 10)
  27.         {
  28.             cashPerRound = 500;
  29.             cashPerKill = 8;
  30.         }
  31.         float roundPrice = cashPerRound * roundNum;
  32.         if (roundKills > 0) {
  33.             cash += (int)roundPrice + (int)(cashPerKill * roundKills * scale);
  34.             Debug.Log(cash);
  35.         } else
  36.         {
  37.             cash += (int)roundPrice + (int)(cashPerKill * 1 * scale);
  38.             Debug.Log(cash);
  39.         }
  40.     }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement