public void Init(MatchLoadItemVo data) { this.data = data; AtlasSprite sprite = Resource.GameResourceLoadManager.GetInstance().LoadAtlasSprite(data.playerIcon); itemImage.SetSprite(sprite); //Resource.GameResourceLoadManager.GetInstance().LoadAtlasSprite( data.playerIcon, delegate ( string name, AtlasSprite atlasSprite, System.Object param ) //{ // itemImage.SetSprite( atlasSprite ); //}, true ); if (this.data.playerID != Data.DataManager.GetInstance().GetPlayerId()) { golwImage.gameObject.SetActive(false); nameText.color = Color.white; rateText.color = Color.white; } else { golwImage.gameObject.SetActive(true); nameText.color = myColor; rateText.color = myColor; } nameText.text = this.data.playerName; targetNum = 0; OnProgressHandler(); }
private void InitData() { ViewBase.ClearViewStack(); DataManager client = DataManager.GetInstance(); UIManager.locateState = UIManagerLocateState.Battle; client.SetPlayerIsInBattle(true); List <Matcher> list = client.GetMatchers(); battleType = client.GetBattleType(); simulateBattle = client.GetBattleSimluateState(); if (battleType == BattleType.BattleP1vsP1) { battleSceneName = "Battle_1v1"; battleMapName = "Prefabs/Map/1V1/BattleMapNew"; myBattleType = MyBattleType.Pvp; } else if (battleType == BattleType.Tranining) { battleSceneName = "Battle_PvE"; battleMapName = "Prefabs/Map/PVE/BattleMap"; myBattleType = MyBattleType.Pve; } else if (battleType == BattleType.Survival) { battleSceneName = "Battle_PvE"; battleMapName = "Prefabs/Map/1V1/BattleMapOld"; myBattleType = MyBattleType.Pve; } else if (battleType == BattleType.BattleP2vsP2) { battleSceneName = "Battle_2v2"; battleMapName = "Prefabs/Map/2V2/BattleMap"; myBattleType = MyBattleType.Pvp; } else if (battleType == BattleType.Tutorial) { battleSceneName = "Battle_Tutorial"; battleMapName = "Prefabs/Map/1V1/BattleMapNew"; myBattleType = MyBattleType.Tutorial; } dataList = new List <MatchLoadItemVo>(); int length = list == null ? 0 : list.Count; for (int i = 0; i < length; i++) { MatchLoadItemVo data = new MatchLoadItemVo(); data.playerID = list[i].playerId; data.playerName = list[i].name; data.playerIcon = list[i].portrait; data.sideIndex = list[i].side; dataList.Add(data); } }