public override void Initialize(EB.Sparx.Config config) { Instance.Api = new NationAPI(); Instance.Api.ErrorHandler += ErrorHandler; Config = GameDataSparxManager.Instance.Register <NationConfig>(ConfigDataId); BattleTimeConfig = GameDataSparxManager.Instance.Register <NationBattleTimeConfig>(BattleTimeConfigDataId); List = GameDataSparxManager.Instance.Register <Nations>(ListDataId); Detail = GameDataSparxManager.Instance.Register <NationDetail>(DetailDataId); Account = GameDataSparxManager.Instance.Register <NationAccount>(AccountDataId); Members = GameDataSparxManager.Instance.Register <NationMembers>(MembersDataId); TerritoryList = GameDataSparxManager.Instance.Register <NationTerritoryList>(TerritoryDataId); BattleSyncData = GameDataSparxManager.Instance.Register <NationBattleSyncData>(BattleDataId); ScoreRankList = GameDataSparxManager.Instance.Register <NationScoreRankList>(ScoreRankDataId); }
void OnListDataListener(string path, INodeData data) { NationScoreRankList rankList = data as NationScoreRankList; List <NationScore> nationScoreList = rankList.GetSortedDataList(); if (nationScoreList != null) { for (int cellIndex = 0; cellIndex < nationScoreList.Count; ++cellIndex) { CellItemList[cellIndex].Fill(nationScoreList[cellIndex]); } for (int excessIndex = nationScoreList.Count; excessIndex < CellItemList.Count; ++excessIndex) { CellItemList[excessIndex].Fill(null); } } else { Debug.LogError("nationScoreRank is null"); } }