Guest User

Untitled

a guest
Jun 17th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. ReelSymbolObject:
  2.  
  3. using UnityEngine;
  4. using System.Collections;
  5.  
  6. public class ReelSymbolObject
  7. {
  8. public int symbol_id;
  9. public int win_anim_id;
  10. public float[] current_pos;
  11. public float[] default_pos;
  12. public float current_pos_x;
  13. public float current_pos_y;
  14. public float current_pos_z;
  15. public float default_pos_x;
  16. public float default_pos_y;
  17. public float default_pos_z;
  18. public float rot_inc;
  19. public float rez_inc;
  20. public int curr_dir;
  21. public float curr_rot;
  22. public float units_spun;
  23. public float elapsed_time_2d;
  24.  
  25. public ReelSymbolObject()
  26. {
  27. symbol_id = -1;
  28. win_anim_id = -1;
  29. current_pos = new float[3] { 0, 0, 0 };
  30. default_pos = new float[3] { 0, 0, 0 };
  31. rot_inc = 0;
  32. rez_inc = 0;
  33. curr_dir = ReelScene.SPIN_DIR_DOWN;
  34. curr_rot = 0;
  35. units_spun = 0;
  36. elapsed_time_2d = 0;
  37. }
  38. }
  39.  
  40. ReelSymbolGroup:
  41.  
  42. using UnityEngine;
  43. using System.Collections;
  44.  
  45. public class ReelSymbolGroup
  46. {
  47. public int group_id;
  48. public int next_group_id;
  49. public int syms_per_second;
  50. public int num_syms_to_spin;
  51. public float spin_time;
  52. public float spin_start_time;
  53. public float prev_time;
  54. public float interval_units;
  55. public int spin_direction;
  56. public ReelScene.SPIN_STATE spin_state;
  57. public int nonwin_anim_id;
  58. public int win_anim_id;
  59. public ReelSymbolObject[] symbols;
  60.  
  61. public ReelSymbolGroup()
  62. {
  63. group_id = -1;
  64. next_group_id = -1;
  65. syms_per_second = 0;
  66. num_syms_to_spin = 0;
  67. spin_time = 0;
  68. spin_start_time = 0;
  69. prev_time = 0;
  70. interval_units = 0;
  71. spin_direction = ReelScene.SPIN_DIR_DOWN;
  72. spin_state = ReelScene.SPIN_STATE.SPIN_NOT_STARTED;
  73. nonwin_anim_id = -1;
  74. win_anim_id = -1;
  75. symbols = new ReelSymbolObject[7];
  76. for (int i = 0; i < 7; i++)
  77. symbols[i] = new ReelSymbolObject();
  78. }
  79. }
  80.  
  81. Code to initialise data:
  82.  
  83. private ReelSymbolGroup[] m_reelSymbolGroup;
  84. private ReelSymbolObject[] m_reelVisibleSymbols;
  85. private ReelSymbolManager m_reelSymbolManager;
  86. private GameHud m_gameHud;
  87.  
  88. static public ReelScene getInstance()
  89. {
  90. if (_instance == null)
  91. {
  92. _instance = new ReelScene();
  93. }
  94. return _instance;
  95. }
  96.  
  97. public ReelSymbolGroup[] SymbolGroup
  98. {
  99. get { return m_reelSymbolGroup; }
  100. }
  101.  
  102. public ReelSymbolObject[] VisibleSymbols
  103. {
  104. get { return m_reelVisibleSymbols; }
  105. }
  106.  
  107. public ReelScene()
  108. {
  109. // Construct symbol group and visible data
  110. m_reelSymbolGroup = new ReelSymbolGroup[5];
  111. for (int i = 0; i < 5; i++)
  112. m_reelSymbolGroup[i] = new ReelSymbolGroup();
  113. m_reelVisibleSymbols = new ReelSymbolObject[1024];
  114. for (int i = 0; i < 1024; i++)
  115. m_reelVisibleSymbols[i] = new ReelSymbolObject();
  116.  
  117. m_gameHud = new GameHud();
  118. }
Add Comment
Please, Sign In to add comment