protected void ToggleNavigationBar(bool enabled) { if (NavigationController == null) { return; } if (enabled) { NavigationController.NavigationBar.SetBackgroundImage(_backgroundImage, UIBarMetrics.Default); NavigationController.NavigationBar.Items[0].BackBarButtonItem.Enabled = true; NavigationController.NavigationBar.TintColor = ColorExtension.FromHex("3C6DF0"); NavigationController.InteractivePopGestureRecognizer.Enabled = true; } else { NavigationController.NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); NavigationController.NavigationBar.Items[0].BackBarButtonItem.Enabled = false; NavigationController.NavigationBar.TintColor = UIColor.LightGray; NavigationController.InteractivePopGestureRecognizer.Enabled = false; } }
public void SetData(cmd_update_support_vote_person data, int nPlayerCount) { if (data.uPDBIU <= 0) { return; } // 初始化标签轮盘 WarLabelSelectItem labelItem = VoteButton.GetComponent <WarLabelSelectItem>(); if (labelItem != null && labelItem.gameObject.activeSelf) { labelItem.Init(data.nVoteID, data.uPDBIU); } m_PDBIU = data.uPDBIU; // 计算玩家本次的点赞总数 int nSupportNum = LogicDataCenter.labelDataManager.getPlayerSupportNum(m_PDBIU); if (parentsView) { VotePointImage.sprite = parentsView.GetSupportNumSprite(nSupportNum); } cmd_war_add_label lastLabel; int nLabelCount; // 当前玩家是否最新被点赞的玩家 bool isLastPlayer = LogicDataCenter.labelDataManager.getLastPlayerLabel(m_PDBIU, out lastLabel, out nLabelCount); if (isLastPlayer) { // 播放标签特效 loadLabelEffect(lastLabel, nLabelCount); } VotePointImage.SetNativeSize(); VotePointImage.gameObject.SetActive(VotePointImage.sprite); SSchemeWarSupportPlayerConfig config = WarSupportPlayerConfigPage.Instance.GetWarSupportPlayerConfig(data.nVoteID); if (config != null) { VoteDescText.text = config.sVoteDesc; TitleImage.sprite = parentsView.GetSupportTitleSprite(config.nVoteIconID); TitleImage.gameObject.SetActive(TitleImage.sprite); } else { Debug.LogError(String.Format("GetWarSupportPlayerConfig failed. nVoteID={0},pdbid={1}", data.nVoteID, data.uPDBIU)); } DataCenter.WarRecordTableDataManager.WarPersonInfo info = LogicDataCenter.recordTableDataManager.getWarPersonInfoByPDBID(data.uPDBIU); if (info == null) { return; } PlayerNameText.text = info.playerName; bool bSameCamp = info.nCamp == EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CAMP); string szColor = bSameCamp ? "7BDBEDFF" : "FF3434FF"; string szEffectColor = bSameCamp ? "0072FF99" : "92000099"; Color32 color = ColorExtension.FromHex(szColor); Color32 effectcolor = ColorExtension.FromHex(szEffectColor); PlayerNameText.color = color; PlayerNameText.gameObject.GetComponent <Outline>().effectColor = effectcolor; SSchemeWarSupportPositionConfig positionConfig = WarSupportPlayerConfigPage.Instance.GetWarSupportPositionConfig(data.nSortID, nPlayerCount); if (positionConfig == null) { return; } Vector3 oldAnchoredPosition = this.GetComponent <RectTransform>().anchoredPosition; this.GetComponent <RectTransform>().anchoredPosition = new Vector3(positionConfig.fUIPositionOffsetX, oldAnchoredPosition.y, oldAnchoredPosition.z); // 播放光效 if (isLastPlayer) { DoEffect(m_PDBIU, bSameCamp, nSupportNum, data.nSortID); } // 播放音效 if (isLastPlayer) { DoSound(nSupportNum); } }
public void setFillColor(string strClr) { Color32 color = ColorExtension.FromHex(strClr); fillImage.color = color; }
public void SetData(UTileViewItemRoomHeroSkin item) { if (SkinIconImage == null || SelectFrame == null || SkinProssesText == null || SkinGradeText == null || SkinNameText == null || SkinBuyObj == null) { return; } if (item.eRoomState == Stage_ManagerDef.EMatchRoomState.MatchRoomState_Wait) { SkinMaskObj.SetActive(false); } else { if (item.eRoomState == Stage_ManagerDef.EMatchRoomState.MatchRoomState_SelectHero) { SkinMaskObj.SetActive(!item.bIsHaveSkin); } } SkinIconImage.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_GAMEWAITINGROOMVIEW, item.nSkinIconId, 6, item.nHeroID); SkinIconImage.gameObject.SetActive(SkinIconImage.sprite); string[] szWord = new string[] { "经典", "传说", "史诗", "终极" }; int nSkinGrade = item.nSkinType; if (nSkinGrade >= 0 && nSkinGrade < szWord.Length) { SkinGradeText.text = szWord[nSkinGrade]; } SkinNameText.text = item.szSkinName; string szProssesText = ""; Color prossesColor = Color.white; if (item.bIsHaveSkin) { if (item.dwSkinLimitTime > 0) { DateTime calcTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(item.dwSkinLimitTime); calcTime = calcTime.ToLocalTime(); TimeSpan ts = calcTime.Subtract(DateTime.Now).Duration(); if (ts.Days > 0) { szProssesText = ts.Days.ToString() + "天";//+ ts.Hours.ToString() + "小时"; } else if (ts.Hours > 0) { szProssesText = ts.Hours.ToString() + "小时"; //+ ts.Minutes.ToString() + "分钟"; } else { szProssesText = ts.Minutes.ToString() + "分钟"; } prossesColor = Color.red; SkinBuyObj.SetActive(false); } else { szProssesText = "已拥有"; prossesColor = Color.white; SkinBuyObj.SetActive(false); } } else { szProssesText = "未拥有"; prossesColor = Color.red; SkinBuyObj.SetActive(true); } SkinProssesText.text = szProssesText; SkinProssesText.color = prossesColor; string[] colorList = new string[4] { "FFFFFFFF", "F11DF9", "F9BF1D", "20C53B" }; if (nSkinGrade >= 0 && nSkinGrade < szWord.Length) { Color32 colorItem = ColorExtension.FromHex(colorList[nSkinGrade]); SkinGradeText.color = colorItem; SkinNameText.color = colorItem; } if (item.bSelect) { SetSelectDownShotEffect(); RoomList.SelectHeroItem = this; } else { DestorySelectDownShotEffect(); } SelectFrame.gameObject.SetActive(item.bSelect); ItemData = item; //SkinTypeImage.sprite = }