private void ShowGood() { GUI.Box(crdOutline, string.Empty, "BoxFadeBlue"); if (good != null && tItem != null && null != tItem.CurIcon()) { Texture2D texture2D = null; switch (buyHow) { case Good.BUY_HOW.GENERAL_POINT: texture2D = fpIcon; break; case Good.BUY_HOW.BRICK_POINT: texture2D = bpIcon; break; case Good.BUY_HOW.CASH_POINT: texture2D = TokenManager.Instance.currentToken.mark; break; } TextureUtil.DrawTexture(new Rect(crdOutline.x + 32f, crdOutline.y + (crdOutline.height - (float)tItem.CurIcon().height) / 2f, (float)tItem.CurIcon().width, (float)tItem.CurIcon().height), tItem.CurIcon()); Vector2 pos = new Vector2(crdOutline.x + crdOutline.width - 20f, crdOutline.y + 20f); LabelUtil.TextOut(pos, tItem.Name, "Label", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); pos.y += 32f; LabelUtil.TextOut(pos, good.GetRemainString(selected, buyHow), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); pos.y += 32f; if (texture2D != null) { TextureUtil.DrawTexture(crdMoneyIcon, texture2D); pos.x -= crdMoneyIcon.width + 10f; } LabelUtil.TextOut(pos, good.GetPriceString(selected, buyHow), "Label", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); } }
private void ShowPresent() { GUI.Box(crdPresentOutline, string.Empty, "BoxFadeBlue"); if (good != null && tItem != null && null != tItem.CurIcon()) { TextureUtil.DrawTexture(new Rect(crdPresentOutline.x + 20f, crdPresentOutline.y + 20f, (float)tItem.CurIcon().width, (float)tItem.CurIcon().height), tItem.CurIcon()); Vector2 pos = new Vector2(crdPresentOutline.x + crdPresentOutline.width - 20f, crdPresentOutline.y + 20f); LabelUtil.TextOut(pos, tItem.Name, "MiniLabel", new Color(0.83f, 0.49f, 0.29f), GlobalVars.txtEmptyColor, TextAnchor.UpperRight); pos.y += 20f; LabelUtil.TextOut(pos, good.GetRemainString(selected, buyHow), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); pos.y += 20f; LabelUtil.TextOut(pos, good.GetPriceString(selected, buyHow), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperRight); } }