GameKey3Dboard.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class GameKey3Dboard : SCKeyboardMono
  5. {
  6. private void InitTween()
  7. {
  8. TweenBase[] tb = GetComponentsInChildren<TweenBase>();
  9. for (int i = 0; i < tb.Length; i++)
  10. {
  11. mlist.Add(tb[i]);
  12. }
  13. }
  14. private List<TweenBase> mlist = new List<TweenBase>();
  15. private void Begin()
  16. {
  17. if (!this.gameObject.activeInHierarchy)
  18. {
  19. return;
  20. }
  21. for (int i = 0; i < mlist.Count; i++)
  22. {
  23. mlist[i].Init();
  24. if (mlist[i].delaytime > 0)
  25. {
  26. StartCoroutine(DelayStart(mlist[i].delaytime, mlist[i]));
  27. }
  28. else
  29. {
  30. mlist[i].StartAction();
  31. }
  32. }
  33. }
  34. IEnumerator DelayStart(float time, TweenBase tb)
  35. {
  36. yield return new WaitForSeconds(time);
  37. tb.StartAction();
  38. }
  39. }