Advertisement
Guest User

Click.cs

a guest
Dec 16th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class DollarPerSec : MonoBehaviour {
  6.  
  7. public UnityEngine.UI.Text dpsDisplay;
  8. public Click click;
  9. public ItemManager[] items;
  10.  
  11. private void Start()
  12. {
  13. StartCoroutine(AutoTick());
  14. }
  15.  
  16. private void Update()
  17. {
  18. dpsDisplay.text = GetDollarsPerSec() + " Dollars/sec";
  19. }
  20. public int GetDollarsPerSec()
  21. using System.Collections;
  22. using System.Collections.Generic;
  23. using UnityEngine;
  24.  
  25. public class Click : MonoBehaviour
  26. {
  27. public UnityEngine.UI.Text CPC;
  28. public UnityEngine.UI.Text Cash;
  29. public float gold;
  30. public int goldperclick = 1;
  31.  
  32. public Click(int goldperclick)
  33. {
  34. this.goldperclick = goldperclick;
  35. }
  36.  
  37. private void Start()
  38. {
  39.  
  40.  
  41. loadStuff();
  42.  
  43.  
  44. }
  45.  
  46. private void Update()
  47. {
  48. Cash.text = "Cash: " + gold;
  49. CPC.text = "Dollars/Click: " + goldperclick;
  50. PlayerPrefs.SetFloat("gold", gold);
  51.  
  52.  
  53.  
  54.  
  55. }
  56. public void clicked()
  57. {
  58. gold += goldperclick;
  59. }
  60. public void loadStuff()
  61. {
  62. gold = PlayerPrefs.GetFloat("gold");
  63. }
  64.  
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement