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