/// <summary> /// 设置这张扑克的牌值信息,显示效果 /// </summary> /// <param name="cdValueData">牌值信息</param> public void SetCdValue(int cdValueData) { CdValue = cdValueData; ColorLeftUp.gameObject.SetActive(false); ColorRightDown.gameObject.SetActive(false); CdValueSpUp.gameObject.SetActive(false); CdBackSp.gameObject.SetActive(false); switch (CdValue) { case HdCdsCtrl.SmallJoker: { CdBg.spriteName = HdCdsCtrl.SmallJoker.ToString(CultureInfo.InvariantCulture); CdBg.MakePixelPerfect(); CdBackSp.gameObject.SetActive(true); return; } case HdCdsCtrl.BigJoker: { CdBg.spriteName = HdCdsCtrl.BigJoker.ToString(CultureInfo.InvariantCulture); CdBg.MakePixelPerfect(); CdBackSp.gameObject.SetActive(true); return; } case HdCdsCtrl.MagicKing: { CdBg.spriteName = HdCdsCtrl.MagicKing.ToString(CultureInfo.InvariantCulture); CdBg.MakePixelPerfect(); CdBackSp.gameObject.SetActive(true); return; } } CdBg.spriteName = "front"; ColorLeftUp.gameObject.SetActive(true); ColorRightDown.gameObject.SetActive(true); CdValueSpUp.gameObject.SetActive(true); CdBackSp.gameObject.SetActive(true); var color = PokerRuleUtil.GetColor(cdValueData); var value = HdCdsCtrl.GetValue(cdValueData).ToString(CultureInfo.InvariantCulture); ColorLeftUp.spriteName = "s_" + color + "_0"; ColorRightDown.spriteName = "b_" + color + "_0"; if (color > 2) { CdValueSpUp.spriteName = "black_" + value; //CdBackSp.spriteName = "black_" + value; } else { CdValueSpUp.spriteName = "red_" + value; //CdBackSp.spriteName = "red_" + value; } CdBg.MakePixelPerfect(); ColorLeftUp.MakePixelPerfect(); ColorRightDown.MakePixelPerfect(); CdValueSpUp.MakePixelPerfect(); //CdBackSp.MakePixelPerfect(); CdValueSpUp.transform.localScale = new Vector3(1.1f, 1.1f, 1.1f); //CdBackSp.transform.localScale = new Vector3(0.9f, 0.9f, 1); ColorRightDown.transform.localScale = new Vector3(0.7f, 0.7f, 1); }
public void SetHdcdctrlInstance(HdCdsCtrl instance) { _hdCdsCtrlInstance = instance; }