private void InstantiateNewCard(TcgCard newCard, Color backgroundColor) { GameObject newGO = Instantiate(Resources.Load <GameObject>(AddressOfItemToFillWith)) as GameObject; Border.GetComponent <UISprite>().depth = newGO.transform.Find("Background").GetComponent <UISprite>().depth - 1; newGO.name = newCard.Name; newGO.transform.parent = GridRef; newGO.transform.Find("Name").GetComponent <UILabel>().text = newCard.Name; newGO.transform.Find("Background").GetComponent <UISprite>().color = backgroundColor; newGO.transform.Find("Background").transform.localScale = new Vector3(TextField.GetComponent <UIPanel>().clipRange.z, newGO.transform.Find("Background").transform.localScale.y, newGO.transform.Find("Background").transform.localScale.z); newGO.GetComponent <FrontPageButton>().TheCardRef = newCard; newGO.transform.localScale = new Vector3(1, 1, 1); }
public void InstantiateNewCard(TcgCard newCard, int sortOrder) { GameObject newGO = Instantiate(Resources.Load <GameObject>("2.0/Item")) as GameObject; CardObject tmp = new CardObject(newCard, newGO); CardHistory.Add(tmp); newGO.name = sortOrder.ToString(); newGO.transform.SetParent(ScrollingText); //newGO.GetComponent<FrontPageButton>().TheCardRef = newCard; newGO.transform.Find("Name").GetComponent <Text>().text = newCard.Name; newGO.transform.Find("Mid").GetComponent <Text>().text = "Mid: " + string.Format("{0:C}", newCard.AvgPrice); newGO.transform.Find("Low").GetComponent <Text>().text = "Low: " + string.Format("{0:C}", newCard.LowPrice); newGO.transform.Find("Ratio").GetComponent <Text>().text = "+ " + string.Format("{0:C}", newCard.AvgPrice - newCard.LowPrice); //newGO.transform.Find("Shadow").GetComponent<Text>().text = "+ " + string.Format("{0:C}", newCard.AvgPrice - newCard.LowPrice); newGO.GetComponent <Image>().color = sortOrder % 2 == 1 ? baseItemColor : variantItemColor; }
private IEnumerator LoadCard(TcgCard theTcgCard) { cardModel = theTcgCard; while (!Ready) { yield return(null); } Name.text = theTcgCard.Name; HighMidLowPrices.text = "$" + theTcgCard.HiPrice.ToString() + "\n" + "$" + theTcgCard.AvgPrice.ToString() + "\n" + "$" + theTcgCard.LowPrice.ToString(); Debug.Log(theTcgCard.MultiverseID); string url = "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=" + theTcgCard.MultiverseID + "&type=card"; WWW www = new WWW(url); yield return(www); CardImage.sprite = Sprite.Create(www.texture as Texture2D, new Rect(0, 0, www.texture.width, www.texture.height), new Vector2(.5f, .5f)); }
public void coLoadCard(TcgCard theCard) { StartCoroutine(LoadCard(theCard)); }
public CardObject(TcgCard aCard, GameObject GORef) { TheCard = aCard; GO = GORef; }