Currency.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using UnityEngine;
  3. using Newtonsoft.Json;
  4. namespace DataTools
  5. {
  6. [Serializable]
  7. public class Currency
  8. {
  9. [JsonProperty]
  10. [SerializeField]
  11. private int glam;
  12. [JsonProperty]
  13. [SerializeField]
  14. private int experience;
  15. [JsonProperty]
  16. [SerializeField]
  17. private int dollars;
  18. [JsonProperty]
  19. [SerializeField]
  20. private int motivation;
  21. [JsonProperty]
  22. [SerializeField]
  23. private int level;
  24. public Currency(int glam = 0, int experience = 0, int dollars = 0, int motivation = 0, int level = 0)
  25. {
  26. this.glam = glam;
  27. this.experience = experience;
  28. this.dollars = dollars;
  29. this.motivation = motivation;
  30. this.level = level;
  31. }
  32. [JsonIgnore]
  33. public int Glam
  34. {
  35. get
  36. {
  37. return glam;
  38. }
  39. set
  40. {
  41. glam = value;
  42. }
  43. }
  44. [JsonIgnore]
  45. public int Experience
  46. {
  47. get
  48. {
  49. return experience;
  50. }
  51. set
  52. {
  53. experience = value;
  54. }
  55. }
  56. [JsonIgnore]
  57. public int Dollars
  58. {
  59. get
  60. {
  61. return dollars;
  62. }
  63. set
  64. {
  65. dollars = value;
  66. }
  67. }
  68. [JsonIgnore]
  69. public int Motivation
  70. {
  71. get
  72. {
  73. return motivation;
  74. }
  75. set
  76. {
  77. motivation = value;
  78. }
  79. }
  80. [JsonIgnore]
  81. public int Level
  82. {
  83. get
  84. {
  85. return level;
  86. }
  87. set
  88. {
  89. level = value;
  90. }
  91. }
  92. public void AddReward(int glam, int experience, int dollars, int motivation)
  93. {
  94. this.glam += glam;
  95. this.experience += experience;
  96. this.dollars += dollars;
  97. this.motivation += motivation;
  98. }
  99. }
  100. }