1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using GameFramework.Event;
- using UnityEngine;
- public class CoolTrainAniCtrl : MonoBehaviour
- {
- public GameObject ani_1;
- public GameObject ani_2;
- public GameObject ani_3;
- public GameObject ani_4;
- public GameObject ani_5;
- void Start()
- {
- GameMain.Event.Subscribe(Cool_TrainAniEvent.EventId,OnGetAniEvent);
- }
- private void OnDestroy()
- {
- GameMain.Event.Unsubscribe(Cool_TrainAniEvent.EventId,OnGetAniEvent);
- }
- private void OnGetAniEvent(object sender, GameEventArgs e)
- {
- Cool_TrainAniEvent args = (Cool_TrainAniEvent)e;
- ani_1.SetActive(false);
- ani_2.SetActive(false);
- ani_3.SetActive(false);
- ani_4.SetActive(false);
- ani_5.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;
- case 4:
- ani_4.SetActive(true);
- break;
- case 5:
- ani_5.SetActive(true);
- break;
- }
- }
- }
|