TimeTicker.cs 685 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using CIS;
  3. using UnityEngine;
  4. public class TimeTicker : MonoBehaviour
  5. {
  6. private void OnTriggerEnter2D(Collider2D other)
  7. {
  8. string tag = other.gameObject.tag;
  9. if (tag == "Player")
  10. {
  11. if (this.tickerType == TimeTicker.TickerType.START)
  12. {
  13. SingletonMonoBehaviourClass<GameLogicMgr>.instance.StartPlay();
  14. UnityEngine.Debug.Log("Start to tick!");
  15. }
  16. else if (this.tickerType == TimeTicker.TickerType.END)
  17. {
  18. UnityEngine.Debug.Log("End tick!");
  19. SingletonMonoBehaviourClass<GameLogicMgr>.instance.EndPlay();
  20. }
  21. }
  22. }
  23. public TimeTicker.TickerType tickerType;
  24. public enum TickerType
  25. {
  26. START,
  27. END
  28. }
  29. }