Ejemplo n.º 1
0
 private void OnSelectExchangeCard()
 {
     Debug.Log("select card as exchange card, oid=" + _info.OID);
     if (_info.Status == PaiStatus.Exchange)
     {
         _info.Status = PaiStatus.InHand;
         iTween.MoveTo(gameObject, iTween.Hash("y", -250, "islocal", true, "time", 0.2f));
         EventDispatcher.TriggerEvent <bool>(EventDefine.UpdateBtnExchangeCard, false);
     }
     else
     {
         pb.CardType exchangeType = BattleManager.Instance.GetExchangeTypeBySide(_side);
         pb.CardType curType      = (pb.CardType)Mathf.CeilToInt(_info.Id / 10);
         //Debug.Log("curType=" + curType.ToString() + ", exchangeType=" + exchangeType.ToString());
         if (exchangeType != pb.CardType.None && curType != exchangeType)
         {
             UIManager.Instance.ShowTips(TipsType.text, "必须选择同花色的牌");
         }
         else
         {
             int count = BattleManager.Instance.GetExchangeCardCountBySide(_side);
             if (count >= 3)
             {
                 UIManager.Instance.ShowTips(TipsType.text, "只能交换三张牌");
             }
             else
             {
                 _info.Status = PaiStatus.Exchange;
                 iTween.MoveTo(gameObject, iTween.Hash("y", -230, "islocal", true, "time", 0.2f));
                 count++;
                 EventDispatcher.TriggerEvent <bool>(EventDefine.UpdateBtnExchangeCard, count >= 3);
             }
         }
     }
 }
Ejemplo n.º 2
0
    public void UpdateUI(int index)
    {
        switch (index)
        {
        case 0:
            _type                   = pb.CardType.Wan;
            _word.spriteName        = "quewan1";
            transform.localPosition = new Vector3(-160, 0, 0);
            break;

        case 1:
            _type                   = pb.CardType.Tiao;
            _word.spriteName        = "quetiao1";
            transform.localPosition = Vector3.zero;
            break;

        case 2:
            _type                   = pb.CardType.Tong;
            _word.spriteName        = "quetong1";
            transform.localPosition = new Vector3(160, 0, 0);
            break;

        default:
            break;
        }
        UpdateWord(false);
    }
Ejemplo n.º 3
0
 public void SendMsgC2GSSelectLack(pb.CardType type)
 {
     Debug.Log("SendMsgC2GSSelectLack==>> [" + type.ToString() + "]");
     pb.C2GSSelectLack msg = new pb.C2GSSelectLack();
     msg.type = type;
     NetworkManager.Instance.SendToGS((UInt16)MsgDef.C2GSSelectLack, msg);
 }
Ejemplo n.º 4
0
 public void ShowLackIcon()
 {
     //Debug.Log("player name=" + PlayerInfo.NickName + " lack icon ani...");
     pb.CardType type = BattleManager.Instance.GetLackCardTypeByPlayerId(_playerInfo.OID);
     _cardTypeIcon.spriteName = getSpriteNameByType(type);
     _cardTypeIcon.gameObject.SetActive(true);
     //animation
     _cardTypeIcon.transform.localPosition = Vector3.zero;
     _cardTypeIcon.transform.localScale    = Vector3.one * 2;
     iTween.MoveTo(_cardTypeIcon.gameObject, iTween.Hash("position", new Vector3(55, 30, 0), "islocal", true, "time", 0.5f, "easytype", iTween.EaseType.easeOutExpo));
     iTween.ScaleTo(_cardTypeIcon.gameObject, iTween.Hash("scale", Vector3.one, "time", 0.5f, "easytype", iTween.EaseType.easeOutExpo));
 }
Ejemplo n.º 5
0
    public string getSpriteNameByType(pb.CardType type)
    {
        switch (type)
        {
        case pb.CardType.Wan:
            return("room_color2");

        case pb.CardType.Tiao:
            return("room_color3");

        case pb.CardType.Tong:
            return("room_color1");

        default:
            return("");
        }
    }