Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEditor;
  6. using System;
  7.  
  8. public class Group : MonoBehaviour {
  9. public int prefabType;
  10. public int position;
  11. public float startTime;
  12. public float interval;
  13. public List<Course> courses;
  14. public List<float> incrementRates;
  15.  
  16. public Text incrementRateText;
  17.  
  18. public Group() {}
  19.  
  20. public Group(int position_, float startTime_, float interval_, int prefabType_, List<Course> courses_, List<float> incrementRates_)
  21. {
  22. position = position_;
  23. startTime = startTime_;
  24. interval = interval_;
  25. prefabType = prefabType_;
  26. courses = courses_;
  27. incrementRates = incrementRates_;
  28. }
  29.  
  30. public void setGroup(int position_, float startTime_, float interval_, int prefabType_, List<Course> courses_, List<float> incrementRates_)
  31. {
  32. position = position_;
  33. startTime = startTime_;
  34. interval = interval_;
  35. prefabType = prefabType_;
  36. courses = courses_;
  37. incrementRates = incrementRates_;
  38. }
  39.  
  40.  
  41. // Use this for initialization
  42. void Start () {
  43.  
  44. }
  45.  
  46. // Update is called once per frame
  47. void Update () {
  48.  
  49. }
  50.  
  51. public float getStartTime()
  52. {
  53. return startTime;
  54. }
  55.  
  56. public float getInterval()
  57. {
  58. return interval;
  59. }
  60.  
  61. public String getName()
  62. {
  63. return name;
  64. }
  65.  
  66. public int getPosition()
  67. {
  68. return position;
  69. }
  70.  
  71. public void OnClick()
  72. {
  73. // sound effect
  74. AudioSource audio = GetComponent<AudioSource>();
  75. audio.Play();
  76. }
  77.  
  78. public int getPrefabType()
  79. {
  80. return prefabType;
  81. }
  82.  
  83. public List<Course> getCourses()
  84. {
  85. return courses;
  86. }
  87.  
  88. public List<float> getIncrementRates()
  89. {
  90. return incrementRates;
  91. }
  92.  
  93. void OnTriggerEnter2D(Collider2D other) {
  94. EditorUtility.DisplayDialog ("enter trigger " + this.getCourses() + " " + this.getIncrementRates(), other.gameObject.tag, "asd", "asd");
  95. }
  96.  
  97. void OnTriggerExit2D(Collider2D other) {
  98. EditorUtility.DisplayDialog ("exit trigger" + this.getCourses() + " " + this.getIncrementRates(), other.gameObject.tag, "asd", "asd");
  99. }
  100.  
  101. public void Test()
  102. {
  103. if(prefabType == 0) Debug.Log(incrementRateText);
  104. //incrementRateText.gameObject.SetActive(false);
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement