void UpdateIcon(Item i) { if (_prevIconObjectIndex != -1) { UnitIconManager.Reset(transform.GetChild(_prevIconObjectIndex).gameObject); } int iconObjChildCount; switch (i.AniType) { case eItemType.Helmet: iconObjChildCount = 0; break; case eItemType.BodyArmour: iconObjChildCount = 1; break; default: iconObjChildCount = 2; break; } GameObject curIconObject = transform.GetChild(iconObjChildCount).gameObject; if (!curIconObject.activeSelf) { curIconObject.SetActive(true); } UnitIconManager.Reset(curIconObject); UnitIconManager.Update(curIconObject, i.Name); _prevIconObjectIndex = iconObjChildCount; }
public void Enable(SpawnManager spawnMgr) { _curCost = _startCost; for (int i = 0; i < spawnMgr._teamUnits.Length; ++i) { int headNum = spawnMgr._teamUnits.GetUnit(i)._equipedItems[0]; UnitIconManager.Update(_iconObjects[i], headNum); UnitStatus uStatus = spawnMgr._teamUnits.GetUnit(i); _unitCostTexts[i].text = uStatus._cost.ToString(); } }
// ChoiceUnit private void UpdateChoiceUnitUI(int index = -1) { int selectUnitNum = index == -1 ? _curSelectUnitNum : index; UnitStatus unit = _teams[_curSelectTeamName].GetUnit(selectUnitNum); GameObject iconObject = _unitSlots[selectUnitNum].transform.GetChild(1).gameObject; RawImage rawImage; if ((rawImage = _unitSlots[selectUnitNum].transform.GetChild(0).GetChild(0).GetComponent <RawImage>())) { } else { LogMessage.Log("UpdateChoiceUnitUI : Unit RawImage Load Error"); return; } UnitIconManager.Reset(iconObject); ItemList itemList = Manager.Get <GameManager>().itemList; if ((unit._equipedItems[0] == 0 && unit._equipedItems[1] == 0) || (unit._equipedItems[0] == itemList.CodeSearch(GameItem.eCodeType.Helmet, 0) && unit._equipedItems[1] == itemList.CodeSearch(GameItem.eCodeType.Bodyarmour, 0))) { // 알몸 상태 혹은 초기화가 안된상태 = _UnitAddImage.texture rawImage.texture = _UnitAddImage.texture; rawImage.SetNativeSize(); } else { _unitPhoto.UpdateTexture(ref rawImage, unit._equipedItems); UnitIconManager.Update(iconObject, unit._equipedItems[0]); StartCoroutine(UnitTextureWaiting(rawImage)); } }