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