Exemple #1
0
    public HandCardItem DingQue(DingQueType type, HandCardItem target)
    {
        int low   = -1;
        int hight = -1;

        switch (type)
        {
        case DingQueType.WAN:
            low   = 0;
            hight = 9;
            break;

        case DingQueType.TIAO:
            low   = 10;
            hight = 19;
            break;

        case DingQueType.TONG:
            low   = 20;
            hight = 29;
            break;
        }
        if (low != -1 || hight != -1)
        {
            if (target._id >= low && target._id <= hight)
            {
                target._obj.GetComponent <Renderer>().materials[1].color = new Color(0.286f, 0.286f, 0.286f, 1f);
            }
        }
        return(target);
    }
Exemple #2
0
    /// <summary>
    /// 定缺,缺一门
    /// </summary>
    /// <param name="type">指定的需要定缺的类型</param>
    /// <param name="_handCardList">指定的需要定缺的数组</param>
    public void DingQue(DingQueType type, List <HandCardItem> _handCardList)
    {
        int low   = -1;
        int hight = -1;

        switch (type)
        {
        case DingQueType.WAN:
            low   = 0;
            hight = 9;
            break;

        case DingQueType.TIAO:
            low   = 10;
            hight = 19;
            break;

        case DingQueType.TONG:
            low   = 20;
            hight = 29;
            break;
        }
        if (low != -1 || hight != -1)
        {
            for (int i = _handCardList.Count - 1; i >= 0; i--)
            {
                HandCardItem item = _handCardList[i];
                if (item._id >= low && item._id <= hight)
                {
                    Debug.Log("定缺");
                    item._obj.GetComponent <Renderer>().materials[1].color = new Color(0.286f, 0.286f, 0.286f, 1f);
                }
            }
        }
    }