private void setIconByType(GameType type) { var image = matchLogo.GetComponent <VectorImage>(); image.vectorImageData = CustomIconHelper.GetIcon(iconTypeMap[type]).vectorImageData; matchLogo.SetActive(true); }
private void setCardFace(int index, int cardType) { cardBg.sprite = Face; int NumSub = (index + 1) % 13; NumSub = NumSub == 0 ? 13 : NumSub; int SuitSub = index / 13; NumberPic.gameObject.SetActive(true); NumberPic.vectorImageData = CustomIconHelper.GetIcon("poker_" + NumSub).vectorImageData; if (cardType == 0 && NumSub > 10) { FigurePic.gameObject.SetActive(true); SuitPic.gameObject.SetActive(false); int figureSub = NumSub + SuitSub * 3 - 11; FigurePic.sprite = Figures[figureSub]; } else { SuitPic.gameObject.SetActive(true); FigurePic.gameObject.SetActive(false); SuitPic.vectorImageData = CustomIconHelper.GetIcon("pattern_" + SuitSub).vectorImageData; } //设置颜色 if (cardType == 0) { cardBg.color = Color.white; NumberPic.color = SuitPic.color = SuitSub % 2 == 0 ? Color.black : _.HexColor("#d32f2f"); } else { string[] colors = new string[4] { "#000000", "#d32f2f", "#388e3c", "#1976d2" }; if (cardType == 1) { cardBg.color = Color.white; NumberPic.color = SuitPic.color = _.HexColor(colors[SuitSub]); } else if (cardType == 2) { cardBg.color = _.HexColor(colors[SuitSub]); NumberPic.color = SuitPic.color = Color.white; } } }