| | |
| | | public class EquipStarWin : Window |
| | | { |
| | | [SerializeField] RectTransform m_LevelContainer; |
| | | [SerializeField] RectTransform m_OperateContainer; |
| | | [SerializeField] RectTransform m_EmptyContainer; |
| | | [SerializeField] Star[] m_Stars; |
| | | [SerializeField] ItemCell m_TargetEquip; |
| | | [SerializeField] Text m_EquipStar; |
| | |
| | | |
| | | if (force || model.selectedPlace.dirty) |
| | | { |
| | | var currentStarLevel = 0; |
| | | var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.Fetch()); |
| | | |
| | | var equipGuid = equipModel.GetEquip(equipPosition); |
| | | var equip = packModel.GetItemByGuid(equipGuid); |
| | | if (equip != null) |
| | | var place = model.selectedPlace.Fetch(); |
| | | if (place == 0) |
| | | { |
| | | m_TargetEquip.gameObject.SetActive(true); |
| | | m_TargetEquip.Init(equip); |
| | | m_TargetEquip.button.SetListener(ViewEquipTip); |
| | | currentStarLevel = model.GetEquipStarLevel(equipPosition); |
| | | |
| | | m_EquipStar.gameObject.SetActive(true); |
| | | m_EquipStar.text = currentStarLevel >= 1 ? string.Format("{0}星", currentStarLevel) : ""; |
| | | m_OperateContainer.gameObject.SetActive(false); |
| | | m_EmptyContainer.gameObject.SetActive(true); |
| | | } |
| | | else |
| | | { |
| | | m_EquipStar.gameObject.SetActive(false); |
| | | m_TargetEquip.gameObject.SetActive(false); |
| | | var currentStarLevel = 0; |
| | | var equipPosition = new Int2(model.selectedLevel.value, place); |
| | | m_OperateContainer.gameObject.SetActive(true); |
| | | m_EmptyContainer.gameObject.SetActive(false); |
| | | var equipGuid = equipModel.GetEquip(equipPosition); |
| | | var equip = packModel.GetItemByGuid(equipGuid); |
| | | if (equip != null) |
| | | { |
| | | m_TargetEquip.gameObject.SetActive(true); |
| | | m_TargetEquip.Init(equip); |
| | | m_TargetEquip.button.SetListener(ViewEquipTip); |
| | | currentStarLevel = model.GetEquipStarLevel(equipPosition); |
| | | |
| | | m_EquipStar.gameObject.SetActive(true); |
| | | m_EquipStar.text = currentStarLevel >= 1 ? string.Format("{0}星", currentStarLevel) : ""; |
| | | } |
| | | else |
| | | { |
| | | m_EquipStar.gameObject.SetActive(false); |
| | | m_TargetEquip.gameObject.SetActive(false); |
| | | } |
| | | |
| | | DisplayMaterialSlots(equipPosition, currentStarLevel); |
| | | DisplayPropertyPreview(equipPosition, currentStarLevel, EquipStarModel.GetMaxStarLevel(equipPosition.x)); |
| | | DisplayStarUpgradeButton(equipPosition, currentStarLevel); |
| | | } |
| | | |
| | | DisplayMaterialSlots(equipPosition, currentStarLevel); |
| | | DisplayPropertyPreview(equipPosition, currentStarLevel, EquipStarModel.GetMaxStarLevel(equipPosition.x)); |
| | | DisplayStarUpgradeButton(equipPosition, currentStarLevel); |
| | | } |
| | | |
| | | if (force || model.equipStarLevel.dirty || model.equipMaxStarLevel.dirty) |