public void Initialize(ScoreManager scoreManager) { _cardMediator = GetComponent <CardMediator>(); _cardRepository = GetComponent <MemoryCardRepository>(); _playingCardRepository = GetComponent <PlayingCardRepository>(); _cardMediator.Initialize(scoreManager); _cardRepository.Initialize(CardServiceHost.CreateCardService()); _playingCardRepository.Initialize(CardServiceHost.CreateCardService()); }
/// <summary> /// 界面显示时初始化数据 /// </summary> protected override void OnShow(INotification notification) { LoadSprite.LoaderImage(m_Panel.beijing, "bg/qiuchang", false); backType = BackType.Main; m_Panel.PieceGrid.enabled = true; m_Panel.PieceGrid.BindCustomCallBack(UpdatePieceGrid); m_Panel.PieceGrid.StartCustom(); m_Panel.rewardGrid.enabled = true; m_Panel.rewardGrid.BindCustomCallBack(UpdateRewardGrid); m_Panel.rewardGrid.StartCustom(); freeInfo = LotteryConfig.GetLotteryInfoByType(1); diamondInfo = LotteryConfig.GetLotteryInfoByType(2); tenInfo = LotteryConfig.GetLotteryInfoByType(3); m_Panel.orangedesc.text = TextManager.GetUIString("UICard3"); m_Panel.orangeCount.text = tenInfo.capitalValue.ToString(); if (cardMediator == null) { cardMediator = Facade.RetrieveMediator("CardMediator") as CardMediator; } m_Panel.freeTimes.text = string.Format(TextManager.GetUIString("UICard7"), freeInfo.freeCount - cardInfo.euroFreeTimes); UpdateView(CardType.First); }