void SetLabel(long gold, NguiLabelAdapter adapter) { adapter.Text(gold); var labelStyle = gold >= 0 ? WinLabelStyle : LoseLabelStyle; SetLabelStyle(adapter, labelStyle); adapter.gameObject.SetActive(true); }
protected void SetLabelStyle(NguiLabelAdapter labelAdapter, LabelStyle style) { var label = labelAdapter.Label; if (style.ApplyGradient) { label.applyGradient = true; label.gradientBottom = style.GradientBottom; label.gradientTop = style.GradientTop; } if (style.EffectStyle != UILabel.Effect.None) { label.effectStyle = style.EffectStyle; label.effectColor = style.EffectColor; label.effectDistance = style.EffectDistance; } }
private void CreateItem(AssetBundleInfo info) { if (!info.Name.Equals(_bundleName)) { return; } if (_itemView != null) { Destroy(_itemView.gameObject); } var go = info.GetAsset <GameObject>(); if (go == null) { return; } go = Instantiate(go); var ts = go.transform; var lcScale = ts.localScale; var lcPos = ts.localPosition; var lcRot = ts.localRotation; ts.parent = transform; ts.localPosition = lcPos; ts.localRotation = lcRot; ts.localScale = lcScale; _itemView = go.GetComponent <GameListItemView>(); if (_itemView != null) { _itemView.MainYxView = this; _itemView.FreshBtnClickBound(_btn, DefaultBoxWidget, Model.GameState == GameState.Developing); if (GameNameLabel != null) { GameNameLabel = _itemView.NameLabel; } } else { YxDebug.LogError("没有GameListItemView", "GameListItem"); } if (GameNameLabel != null) { GameNameLabel.SetActive(true); GameNameLabel.Text(Model.GameName); } }
void SetLabel(NguiLabelAdapter adapter, int score) { adapter.Text(score); var label = adapter.Label; if (score < 0) { label.gradientTop = Tools.ChangeToColor(0x6FFBF1); label.gradientBottom = Tools.ChangeToColor(0x0090FF); label.effectColor = Tools.ChangeToColor(0x002EA3); } else { label.gradientTop = Tools.ChangeToColor(0xFFFF00); label.gradientBottom = Tools.ChangeToColor(0xFF9600); label.effectColor = Tools.ChangeToColor(0x831717); } label.gameObject.SetActive(true); }
void HideLabel(NguiLabelAdapter adapter) { adapter.Label.text = string.Empty; adapter.gameObject.SetActive(false); }
///// <summary> ///// 进入游戏时,显示已下注数值 ///// </summary> ///// <param name="glist"></param> //public void SetGroupBet(int[] glist) //{ // int len = glist.Length; // int labelLen = ZLabels.Length; // for (int i = 0; i < len; i++) // { // if (i >= labelLen) break; // var gold = glist[i]; // SetNumLabel(ZLabels[i], gold); // ZBet[i] = gold; // } //} /// <summary> /// 设置label内容 /// </summary> /// <param name="label"></param> /// <param name="gold"></param> void SetNumLabel(NguiLabelAdapter label, int gold) { label.Text(gold); }