Exemplo n.º 1
0
    void BuildCorner3(SubMesh data, CardShape shape, Vector3 v0, Vector3 v1, Vector3 v2)
    {
        CardStock Stock  = Definition.Stock;
        int       smooth = Stock.Smooth;

        int vbase = data.VertexList.Count;

        this.VertexUV(data, shape, v0, UV(shape, 0, 1));
        this.VertexUV(data, shape, v1, UV(shape, 0, 1));
        this.VertexUV(data, shape, v2, UV(shape, 1, 0));

        float   deltaAngle = 0.5f * Mathf.PI / (smooth + 1);
        int     prev       = vbase + 1;
        Vector3 vy         = v1 - v0;
        Vector3 vx         = v2 - v0;

        for (int i = 0; i <= smooth; ++i)
        {
            if (i < smooth)
            {
                float   angle = (i + 1) * deltaAngle;
                float   tu    = Mathf.Sin(angle);
                float   tv    = Mathf.Cos(angle);
                Vector3 xyz   = v0 + tu * vx + tv * vy;
                Vector2 uv    = UV(shape, tu, tv);
                data.AddVertex(xyz, uv, Color.white);
            }
            int vn    = vbase + 3 + i;
            int vprev = (i == 0) ? vbase + 1 : vn - 1;
            int vnext = (i < smooth) ? vn : vbase + 2;
            data.AddTriangle(vbase, vprev, vnext);
            prev = vn;
        }
    }
Exemplo n.º 2
0
 public CardDef(CardAtlas atlas, CardStock stock, string text, string symbol, int pattern)
 {
     Atlas   = atlas;
     Stock   = stock;
     Text    = text;
     Symbol  = symbol;
     Pattern = pattern;
 }
Exemplo n.º 3
0
    public void SetCardInfo(CardStock _cardStock)
    {
        quantityOfCard.text = "x " + _cardStock.GetCount().ToString();
        CardInfo cardInfo = _cardStock.GetCardInfo();

        //Debug.Log(cardInfo.description);
        card.GetComponent <Card>().SetCardInfo(cardInfo);
    }
        public void kukuMethod4U()
        {
            CardStock cardDeck = new CardStock();

            foreach (Card item in cardDeck)
            {
                Console.WriteLine(item);
            }
        }
        public void Testmethod3()
        {
            CardStock cardDeck = new CardStock();

            for (int i = 0; i < 26; i++)
            {
                Console.WriteLine(cardDeck[i]);
            }
        }
 public CardDef(CardDef def)
 {
     Atlas   = def.Atlas;
     Stock   = def.Stock;
     Text    = def.Text;
     Symbol  = def.Symbol;
     Pattern = def.Pattern;
     Grade   = def.Grade;
 }
Exemplo n.º 7
0
        public void DealCards(string playerId, params int[] cardIds)
        {
            if (!PlayerExists(playerId))
            {
                return;
            }
            var cards = cardIds.Select(GetCard).Where(card => card != null).ToArray();

            DealCards(_players[playerId], cards);
            CardStock.SetStockCount(_stock -= cards.Length);
        }
Exemplo n.º 8
0
    //我们自己开发的时候都使用这个卡牌定义
    //游戏牌初始化定义

    public CardDef(CardAtlas atlas, CardStock stock, string image, string cardname, int dianshu, string huase, string classification, string function)
    {
        Atlas          = atlas;
        Stock          = stock;
        Image          = image;
        CardName       = cardname;
        Dianshu        = dianshu;
        Huase          = huase;
        Classification = classification;
        Function       = function;
        //直接默认用full image
        FullImage = true;
    }
Exemplo n.º 9
0
 public CardDef(CardAtlas atlas, CardStock stock, string image, string cardname, string country, int xueliang, string sex, string jineng1, string jineng2, string jineng3, string jineng4)
 {
     Atlas    = atlas;
     Stock    = stock;
     Image    = image;
     CardName = cardname;
     Country  = country;
     Xueliang = xueliang;
     Sex      = sex;
     Jineng_1 = jineng1;
     Jineng_2 = jineng2;
     Jineng_3 = jineng3;
     Jineng_4 = jineng4;
     //直接默认用full image
     FullImage = true;
 }
Exemplo n.º 10
0
 private void Deal(int count)
 {
     if (CardStock.Count < count * _players.Count)
     {
         count = CardStock.Count / _players.Count;
     }
     if (count == 0)
     {
         StartCoroutine(EndGame());
     }
     else
     {
         foreach (var player in _players)
         {
             DealCards(player, CardStock.Take(count));
         }
     }
 }
Exemplo n.º 11
0
        private IEnumerator LateNewGame()
        {
            yield return(null);

            _players = new List <CardPlayer>(PlayersParent.GetComponentsInChildren <CardPlayer>());
            foreach (var cardPlayer in _players)
            {
                cardPlayer.SetScore(0);
            }
            if (_players.Count == 0)
            {
                yield break;
            }

            CurrentPlayer.SetFocused(true);
            CardStock.Clear();
            CardStock.AddRange(Cards.Take(_initialStock));
            CardStock.Shuffle();

            Utils.SetChildrenVisible(transform, false);
            Deal(_defaultCards);
        }