Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3.  
  4. public class ScriptTrade : MonoBehaviour
  5. {
  6. public Text win;
  7. public InputField vvodTexta;
  8. public int balance;
  9.  
  10. void Start()
  11. {
  12. OnClick2();
  13. OnClick3();
  14. }
  15.  
  16. public void OnClick2()
  17. {
  18. if (int.TryParse(vvodTexta.text, out int result))
  19. {
  20. win.text = vvodTexta.text;
  21. GameManager.balance += result;
  22. GameManager.TextUpdate();
  23. }
  24.  
  25. }
  26.  
  27. public void OnClick3()
  28. {
  29. if (int.TryParse(vvodTexta.text, out int result))
  30. {
  31. win.text = vvodTexta.text;
  32. GameManager.balance += result;
  33. GameManager.TextUpdate();
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement