Ejemplo n.º 1
0
 /// <summary>
 /// デバッグ用
 /// </summary>
 public void Debug_CreateCardDate()
 {
     {
         CardTypeEnum.CardType cardType = (CardTypeEnum.CardType) 1;
         for (int number = 1; number < 14; number++)
         {
             cardlist.Add(new ObjCardData.CardData(number, cardType));
         }
     }
     {
         CardTypeEnum.CardType cardType = (CardTypeEnum.CardType) 2;
         for (int number = 13; number > 0; number--)
         {
             cardlist.Add(new ObjCardData.CardData(number, cardType));
         }
     }
     {
         CardTypeEnum.CardType cardType = (CardTypeEnum.CardType) 3;
         for (int number = 1; number < 14; number++)
         {
             cardlist.Add(new ObjCardData.CardData(number, cardType));
         }
     }
     {
         CardTypeEnum.CardType cardType = (CardTypeEnum.CardType) 4;
         for (int number = 13; number > 0; number--)
         {
             cardlist.Add(new ObjCardData.CardData(number, cardType));
         }
     }
 }
Ejemplo n.º 2
0
    public Material GetCardSprite(int number, CardTypeEnum.CardType type)
    {
        if (number == 0 || type == CardTypeEnum.CardType.None)
        {
            return(null);
        }

        string s_type = "";

        switch (type)
        {
        case CardTypeEnum.CardType.spade:
            s_type = "Spade";
            break;

        case CardTypeEnum.CardType.heart:
            s_type = "Heart";
            break;

        case CardTypeEnum.CardType.Clover:
            s_type = "Club";
            break;

        case CardTypeEnum.CardType.Diamond:
            s_type = "Diamond";
            break;

        default:
            break;
        }
        Material material = Resources.Load <Material>("CardMaterial/" + "Card" + s_type + number.ToString());

        return(material);
    }
Ejemplo n.º 3
0
 public void CreateCardDate()
 {
     for (int type = 1; type < 5; type++)
     {
         CardTypeEnum.CardType cardType = (CardTypeEnum.CardType)type;
         for (int number = 1; number < 14; number++)
         {
             cardlist.Add(new ObjCardData.CardData(number, cardType));
         }
     }
 }
Ejemplo n.º 4
0
    /// <summary>
    /// 個別に画像を表示するところ
    /// </summary>

    void SwitchActive(CardTypeEnum.CardType type, int number, bool active)
    {
        //種類は四種類あります
        if (type == CardTypeEnum.CardType.None)
        {
            Debug.LogError("カードタイプがおかしいです:" + type);
            return;
        }
        int typeNumber = (int)type - 1;


        //数字は1~13で存在しているので配列用に切り替えます
        number -= 1;
        //カードの枚数が最大13枚です
        if (number < 0 || number > 13)
        {
            Debug.LogError("数字がおかしいです:" + number);
            return;
        }
        numberList[typeNumber, number].SetActive(active);
    }
Ejemplo n.º 5
0
 //番号を消したいときにわかりやすく
 public void UseNumber(CardTypeEnum.CardType type, int number)
 {
     SwitchActive(type, number, false);
 }
Ejemplo n.º 6
0
 //番号を復活させる
 public void PlaybackNumber(CardTypeEnum.CardType type, int number)
 {
     SwitchActive(type, number, true);
 }
Ejemplo n.º 7
0
 public ObjCardData(int number, CardTypeEnum.CardType type)
 {
     cardData = new CardData(number, type);
 }
Ejemplo n.º 8
0
 public void DataInit()
 {
     number = 0;
     type   = CardTypeEnum.CardType.None;
 }
Ejemplo n.º 9
0
 public CardData(int number_, CardTypeEnum.CardType type_)
 {
     number = number_;
     type   = type_;
 }