public Deck(CardsSplitter tools) { for (int i = 0; i < CardsSplitter.toolsSplitter.CardsPacks.Count; i++) { int CardsCount = 0; for (int x = 0; x < tools.CardsPacks[i].SpriteLength.x; x++) { for (int y = 0; y < tools.CardsPacks[i].SpriteLength.y; y++) { Texture2D SplittedTex = tools.SplitTexture2D(CardsSplitter.toolsSplitter.CardsPacks[i].TexturePack, (int)(x * tools.CardsPacks[i].CardParser.x), (int)(y * tools.CardsPacks[i].CardParser.y), (int)tools.CardsPacks[i].CardParser.width, (int)tools.CardsPacks[i].CardParser.height); tools.CardsPacks[i].LCards[CardsCount].texture = SplittedTex; tools.CardsPacks[i].LCards[CardsCount].CardObject = GameObject.Instantiate(tools.Primitive) as GameObject; tools.CardsPacks[i].LCards[CardsCount].CardObject.renderer.material.mainTexture = SplittedTex; tools.allCards.Add(tools.CardsPacks[i].LCards[CardsCount]); CardsCount++; } } } DeckPosition = GameObject.Find("Server").transform.GetChild(0); BurnedPosition = GameObject.Find("Server").transform.GetChild(1); Reset(tools); }
// Use this for initialization void Awake() { toolsSplitter = this; for (int i = 0; i < 10; i++) { totalHandsProba.Add(0); } Primitive.transform.localScale = (defaultCardScale * CardTall); }
public void Reset(CardsSplitter tools) { cards.Clear(); foreach (TexturePackCards TPC in tools.CardsPacks) { foreach (Cards C in TPC.LCards) { cards.Add(C); C.CardObject.transform.localEulerAngles = new Vector3(-90, -90, -90); } } }