Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    // Use this for initialization
    void Awake()
    {
        toolsSplitter = this;

        for (int i = 0; i < 10; i++)
        {
            totalHandsProba.Add(0);
        }

        Primitive.transform.localScale = (defaultCardScale * CardTall);
    }
Esempio n. 3
0
    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);
            }
        }
    }