123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using GameFramework.Event;
- using UnityEngine;
- public class EleTrainAniCtrl : MonoBehaviour
- {
- public GameObject ani_1;
- public GameObject ani_2;
- public GameObject ani_3;
- void Start()
- {
- GameMain.Event.Subscribe(Ele_TrainAniEvent.EventId,OnGetAniEvent);
- }
- private void OnDestroy()
- {
- GameMain.Event.Unsubscribe(Ele_TrainAniEvent.EventId,OnGetAniEvent);
- }
- private void OnGetAniEvent(object sender, GameEventArgs e)
- {
- Ele_TrainAniEvent args = (Ele_TrainAniEvent)e;
- ani_1.SetActive(false);
- ani_2.SetActive(false);
- ani_3.SetActive(false);
- switch (args.type)
- {
- case 1:
- ani_1.SetActive(true);
- break;
- case 2:
- ani_2.SetActive(true);
- break;
- case 3:
- ani_3.SetActive(true);
- break;
- }
- }
- }
|