修复注册信号时间差

This commit is contained in:
YangHua 2024-09-05 14:13:36 +08:00
parent 52732ff896
commit bff2d1e78d
1 changed files with 4 additions and 4 deletions

View File

@ -16,12 +16,10 @@ public class OfficeTimelineControl : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
private async void Start() private async void Start()
{ {
await Task.Delay(1000); await Task.Delay(1);
mPlayableDirector = GetComponent<PlayableDirector>(); mPlayableDirector = GetComponent<PlayableDirector>();
if (!GameManager.RunModelMgr.isOnceOfficeAni) if (!GameManager.RunModelMgr.isOnceOfficeAni)
{ {
//playerController.SetActive(false);
mPlayableDirector.Stop();
//mPlayableDirector.stopped += OnPlayableDirectorStopped; //mPlayableDirector.stopped += OnPlayableDirectorStopped;
playerModel = transform.GetChild(0).gameObject; playerModel = transform.GetChild(0).gameObject;
StartTimeline(); StartTimeline();
@ -45,7 +43,9 @@ public class OfficeTimelineControl : MonoBehaviour
{ {
mPlayableDirector.Play(); mPlayableDirector.Play();
} }
/// <summary>
/// 外挂到场景中得timeline
/// </summary>
public void OnPlayableDirectorStopped() public void OnPlayableDirectorStopped()
{ {
GameManager.EventMgr.EventTrigger(Enum_EventType.OfficeTimeLineOver); GameManager.EventMgr.EventTrigger(Enum_EventType.OfficeTimeLineOver);