NoviceTimeLineControllerOne.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.Timeline;
  5. using UnityEngine.Playables;
  6. using UnityGameFramework.Runtime;
  7. public class NoviceTimeLineControllerOne : MonoBehaviour
  8. {
  9. private PlayableDirector _timelineController;
  10. // 播放时长
  11. float _duration;
  12. public int playIndex;
  13. public bool _isComplate;
  14. public bool IsComplate { get { return _isComplate; } set { _isComplate = value;
  15. //EventComponent nowEvent = GameEntry.GetComponent<EventComponent>();
  16. //nowEvent.FireNow(this, new NoviceEventTimeLineComplete(playIndex));
  17. } }
  18. private void Awake()
  19. {
  20. this._timelineController = this.GetComponent<PlayableDirector>();
  21. }
  22. // Start is called before the first frame update
  23. void Start()
  24. {
  25. _duration = (float)_timelineController.duration;
  26. }
  27. // Update is called once per frame
  28. void Update()
  29. {
  30. //if(_duration > 0)
  31. //{
  32. // _duration -= Time.deltaTime;
  33. // if(_duration <= 0)
  34. // {
  35. // closeAllTimeLine();
  36. // //Transform battlePrefeb = GameObject.Find("YLBattlePrefebs").transform;
  37. // //battlePrefeb.Find("CameraManager/Main Camera").gameObject.SetActive(true);
  38. // EventComponent nowEvent = GameEntry.GetComponent<EventComponent>();
  39. // nowEvent.FireNow(this, new NoviceEventTimeLineComplete(playIndex));
  40. // HpbarManager.Instance.SetShowState(true);
  41. // }
  42. //}
  43. }
  44. public void closeAllTimeLine()
  45. {
  46. this._timelineController.gameObject.SetActive(false);
  47. }
  48. }