123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using GameFramework.Event;
- using UnityEngine;
- using UnityEngine.Playables;
- using UnityEngine.Video;
- public class AppTrainAniCtrl : MonoBehaviour
- {
- public GameObject ani_1;
- public GameObject ani_2;
- public VideoPlayer player1;
- public VideoPlayer player2;
- void Start()
- {
- GameMain.Event.Subscribe(App_TrainAniEvent.EventId,OnGetAniEvent);
- }
- private void OnDestroy()
- {
- GameMain.Event.Unsubscribe(App_TrainAniEvent.EventId,OnGetAniEvent);
- }
- private void OnGetAniEvent(object sender, GameEventArgs e)
- {
- App_TrainAniEvent args = (App_TrainAniEvent)e;
- switch (args.type)
- {
- case 1:
- ani_1.SetActive(true);
- ani_2.SetActive(false);
- ani_1.GetComponent<PlayableDirector>().time = 0;
- // player1.Play();
- // player1.time = 0;
- // //player2.Stop();
- break;
- case 2:
- ani_1.SetActive(false);
- ani_2.SetActive(true);
- ani_2.GetComponent<PlayableDirector>().time = 0;
- // player2.Play();
- // player2.time = 0;
- // player1.Stop();
- break;
- }
- }
- }
|