| | |
| | | var maxStarLevel = EquipStarModel.GetMaxStarLevel(model.equipPosition.x); |
| | | var currentStar = model.star; |
| | | |
| | | for (int i = 0; i < m_Stars.Length; i++) |
| | | var iconCnt = m_Stars.Length; |
| | | for (int i = 0; i < iconCnt; i++) |
| | | { |
| | | var behaviour = m_Stars[i]; |
| | | if (i < maxStarLevel) |
| | | { |
| | | if (i < currentStar) |
| | | { |
| | | behaviour.Display(true); |
| | | if (i == currentStar - 1) |
| | | var loopIndex = (currentStar / iconCnt * iconCnt + i < currentStar ? currentStar / iconCnt * iconCnt + i : i) / iconCnt; |
| | | behaviour.Display(true, loopIndex); |
| | | if (i == (currentStar - 1) % iconCnt) |
| | | { |
| | | behaviour.Display(false); |
| | | behaviour.Display(false, loopIndex); |
| | | Clock.AlarmAfter(1f, () => |
| | | { |
| | | behaviour.Display(true); |
| | | behaviour.Display(true, loopIndex); |
| | | behaviour.PlayScaleAnimation(); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | behaviour.Display(false); |
| | | behaviour.Display(false, 0); |
| | | } |
| | | } |
| | | else |
| | |
| | | public Image imageBase; |
| | | public Image imageStar; |
| | | |
| | | public void Display(bool active) |
| | | public void Display(bool active, int loopIndex) |
| | | { |
| | | container.SetActive(true); |
| | | imageStar.SetActive(active); |
| | | imageStar.transform.localScale = Vector3.one; |
| | | imageStar.SetSprite("ImgStar_" + loopIndex); |
| | | } |
| | | |
| | | public void Hide() |