| | |
| | | private int gridIndex; |
| | | private bool isOpened; |
| | | private ushort awardID; |
| | | private string playerName; |
| | | |
| | | /// <summary> |
| | | /// 初始化格子 |
| | |
| | | /// <param name="isWin">是否胜利</param> |
| | | /// <param name="opened">是否已开启</param> |
| | | /// <param name="awardId">奖励ID(已开启时有效)</param> |
| | | /// <param name="name">开启格子的玩家名</param> |
| | | /// <param name="playOpenAnim">是否播放开启动画(翻牌破碎特效)</param> |
| | | public void Init(int index, bool isWin, bool opened, ushort awardId, bool playOpenAnim = false) |
| | | public void Init(int index, bool isWin, bool opened, ushort awardId, string name, bool playOpenAnim = false) |
| | | { |
| | | gridIndex = index; |
| | | isOpened = opened; |
| | | awardID = awardId; |
| | | playerName = name; |
| | | |
| | | // 格子序号 |
| | | topNumText.text = index.ToString(); |
| | |
| | | topNumText.SetActive(!isOpened); |
| | | |
| | | qualityImage.SetActive(isOpened); |
| | | itemImage.SetActive(isOpened); |
| | | itemCntText.text = string.Empty; |
| | | itemNameText.text = isOpened ? playerName : string.Empty; |
| | | |
| | | if (isOpened && awardID > 0) |
| | | { |
| | | var config = FamilyAtkDefBatTreasureConfig.Get(awardID); |
| | |
| | | { |
| | | itemImage.SetItemSprite(config.ItemID); |
| | | itemCntText.text = config.ItemCount > 1 ? $"x{config.ItemCount}" : string.Empty; |
| | | itemNameText.text = itemConfig.ItemName; |
| | | } |
| | | |
| | | qualityImage.SetSprite($"GuildAtkDefBatTreasureAwardColor{config.AwardColor}"); |