public void SetScore(int score) { UISprite[] sprites = cardScoreObj.GetComponentsInChildren <UISprite>(); if (cardScoreBg) { cardScoreBg.width = 557; } else { foreach (UISprite sprite in sprites) { Destroy(sprite.gameObject); } } if (sprites.Length > 1) { foreach (UISprite sprite in sprites) { if (cardScoreBg) { if (sprite.gameObject != cardScoreBg.gameObject) { Destroy(sprite.gameObject); } } else { Destroy(sprite.gameObject); } } } if (cardScoreBg) { if (score == -1) { //cardScoreObj.SetActive(false); cardScoreBg.spriteName = "score_board"; EginTools.AddNumberSpritesCenter(jettonPrefab, cardScoreObj.transform, UserChip.ToString(), "plus_", .8f); } else { //cardScoreObj.SetActive(true); if (score >= 1000000 || score <= -1000000) { cardScoreBg.width = 557; } if (score >= 0) { cardScoreBg.spriteName = "benjia"; EginTools.AddNumberSpritesCenter(jettonPrefab, cardScoreObj.transform, "+" + score, "plus_", .8f); } else if (score < 0) { cardScoreBg.spriteName = "benjia_minus"; EginTools.AddNumberSpritesCenter(jettonPrefab, cardScoreObj.transform, score.ToString(), "minus_", .8f); } } } }