public override void OnMessage(Message message) { string name = message.Name; object[] body = message.Params; switch (name) { case MessageConst.MODULE_CARD_COLLECTION_SHOW_CARD_DETAIL_VIEW: if (_cardDetailPanel == null) { _cardDetailPanel = new CardDetailPanel(); _cardDetailPanel.Init(this); } _cardDetailPanel.EnterFromOther = false; _cardDetailPanel.Show(0); _cardCollectionPanel.Hide(); _cardDetailPanel.SetData((UserCardVo)body[0]); break; case MessageConst.MODULE_CARD_COLLECTION_BACK_TO_CARD_LIST_VIEW: if (_cardDetailPanel != null) { _cardDetailPanel.Hide(); } _cardCollectionPanel.Show(0); _cardCollectionPanel.ChangeTabBar(GlobalData.CardModel.CurPlayerPb, false); break; case MessageConst.MODULE_CARD_COLLECTION_CHANEG_VIEW: _cardCollectionPanel.ChangeView((CardViewState)message.Body); break; case MessageConst.MODULE_CARD_TABBAR_SELECT_CHANGE: OnTabChange((PlayerPB)message.Body); break; case MessageConst.MODULE_CARD_SHOW_FULLSCREEN_CARD: _fullScreenCardPanel = new FullScreenCardPanel(); _fullScreenCardPanel.Init(this); _fullScreenCardPanel.SetTexture((RawImage)body[0], (RawImage)body[1]); if (_cardDetailPanel != null) { _cardDetailPanel.Hide(); } _fullScreenCardPanel.Show(0); break; case MessageConst.MODULE_CARD_CLOSE_FULLSCREEN: _fullScreenCardPanel.Destroy(); _cardDetailPanel.BackFromFullScreen(); break; } }
public override void Init() { GuideManager.RegisterModule(this); if (_userCardVo != null) { if (_cardDetailPanel == null) { _cardDetailPanel = new CardDetailPanel(); _cardDetailPanel.Init(this); } _cardDetailPanel.Show(0); _cardDetailPanel.EnterFromOther = true; _cardDetailPanel.SetData(_userCardVo); _userCardVo = null; } else { //跳转回来的时候,有可能是在星缘回忆界面! if (_cardDetailPanel != null) { return; } if (_cardCollectionPanel == null) { _cardCollectionPanel = new CardCollectionPanel(); _cardCollectionPanel.Init(this); RegisterModel <DrawData>(); _cardCollectionPanel.Show(0); } if (state != 0) { _cardCollectionPanel.ChangeView(CardViewState.Resolve); _cardCollectionPanel.SetResolveState(); } } }