| | |
| | | yield return WaitingForSecondConst.WaitMS2000; |
| | | } |
| | | |
| | | for (var i = 0; i < m_Stars.Length; i++) |
| | | //循环显示不同颜色,如10星在第一颗图标星换颜色 |
| | | int starCnt = stars.Count; |
| | | int starLevel = model.GetStarLevel(new Int2(model.selectedLevel.value, model.selectedPlace.value)); |
| | | int iconCnt = m_Stars.Length; |
| | | int loop = ((int)Math.Max(starLevel - 1, 0)) / iconCnt; |
| | | for (var i = 0; i < iconCnt; i++) |
| | | { |
| | | if (i < stars.Count) |
| | | if (i < starCnt) |
| | | { |
| | | var star = stars[i]; |
| | | m_Stars[i].Display(star.actived); |
| | | var starIndex = loop * iconCnt + i < starLevel ? loop * iconCnt + i : i; |
| | | var star = stars[starIndex]; |
| | | m_Stars[i].Display(star.actived, starIndex / iconCnt); |
| | | if (star.newGet) |
| | | { |
| | | m_Stars[i].PlayEffect(); |
| | |
| | | public Image imageStar; |
| | | public UIEffect newStarEffect; |
| | | |
| | | public void Display(bool active) |
| | | public void Display(bool active, int loopIndex) |
| | | { |
| | | container.SetActive(true); |
| | | imageStar.SetActive(active); |
| | | container.gameObject.SetActive(true); |
| | | imageStar.gameObject.SetActive(active); |
| | | imageStar.SetSprite("ImgStar_" + loopIndex); |
| | | } |
| | | |
| | | public void Hide() |