protected void SetCostData(string type, string cost, PriceData data, int maxHeight) { data.Action(true); data.CostLabel.text = string.Format("x{0}", cost); var sp = data.CostTypeSprite; sp.spriteName = type; sp.MakePixelPerfect(); var offh = (float)maxHeight / sp.height; if (!(offh < 1)) { return; } var ts = sp.transform; ts.localScale = new Vector3(offh, offh, offh); }