public void InitMonsterInfo(MotionBase monster) { _Monster = monster; ResourceManager.Instance.SetImage(_MagicImg, CommonDefine.GetElementIcon(monster._MonsterRecord.ElementType)); RefreshCD(); _MaxHP = monster._MaxHP; RefreshHP((float)monster._HP); }
private void Refresh() { var mapRecord = StageMapRecord.ReadStageMap(_StageInfo.StageRecord.ScenePath); for (int i = 0; i < _StarImgs.Count; ++i) { if (_StageInfo.IsStarOn(i)) { _StarImgs[i].gameObject.SetActive(true); } else { _StarImgs[i].gameObject.SetActive(false); } _StarTexts[i].text = StarInfoBase.GetStarConditionStr(mapRecord._StarInfos[i]); } Dictionary <ELEMENT_TYPE, int> monsterList = new Dictionary <ELEMENT_TYPE, int>(); foreach (var wave in mapRecord._MapStageLogic._Waves) { foreach (var monsterID in wave.NPCs) { var monRecord = Tables.TableReader.MonsterBase.GetRecord(monsterID); if (!monsterList.ContainsKey(monRecord.ElementType)) { monsterList.Add(monRecord.ElementType, 0); } ++monsterList[monRecord.ElementType]; } } int monImgIdx = 0; foreach (var monsterType in monsterList) { if (monImgIdx == _EnemyImgs.Count) { break; } _EnemyImgs[monImgIdx].transform.parent.gameObject.SetActive(true); ResourceManager.Instance.SetImage(_EnemyImgs[monImgIdx], CommonDefine.GetElementIcon(monsterType.Key)); _EnemyTexts[monImgIdx].text = monsterType.Value.ToString(); ++monImgIdx; } for (int i = monImgIdx; i < _EnemyImgs.Count; ++i) { _EnemyImgs[i].transform.parent.gameObject.SetActive(false); } }