123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Timeline;
- using UnityEngine.Playables;
- using UnityGameFramework.Runtime;
- public class NoviceTimeLineControllerOne : MonoBehaviour
- {
- private PlayableDirector _timelineController;
- // 播放时长
- float _duration;
- public int playIndex;
- public bool _isComplate;
- public bool IsComplate { get { return _isComplate; } set { _isComplate = value;
- //EventComponent nowEvent = GameEntry.GetComponent<EventComponent>();
- //nowEvent.FireNow(this, new NoviceEventTimeLineComplete(playIndex));
- } }
- private void Awake()
- {
- this._timelineController = this.GetComponent<PlayableDirector>();
- }
- // Start is called before the first frame update
- void Start()
- {
- _duration = (float)_timelineController.duration;
- }
- // Update is called once per frame
- void Update()
- {
- //if(_duration > 0)
- //{
- // _duration -= Time.deltaTime;
- // if(_duration <= 0)
- // {
- // closeAllTimeLine();
- // //Transform battlePrefeb = GameObject.Find("YLBattlePrefebs").transform;
- // //battlePrefeb.Find("CameraManager/Main Camera").gameObject.SetActive(true);
- // EventComponent nowEvent = GameEntry.GetComponent<EventComponent>();
- // nowEvent.FireNow(this, new NoviceEventTimeLineComplete(playIndex));
- // HpbarManager.Instance.SetShowState(true);
- // }
- //}
- }
- public void closeAllTimeLine()
- {
- this._timelineController.gameObject.SetActive(false);
- }
- }
|