Beispiel #1
0
    void GenerateTypeObj(int index, int type, Vector3 pos)
    {
        Debug.Log("index :" + "==" + GameTools.GetCardType(type));
        if (type == 1)
        {
            if (typeObjDic.ContainsKey(index))
            {
                typeObjDic[index].SetActive(false);
            }
            return;
        }
        GameObject typeObj;

        if (!typeObjDic.ContainsKey(index))
        {
            GameObject goType = GameTools.Instance.GetObject("Prefabs/TianTianLe/cardType");
            typeObj = Instantiate(goType);
            typeObjDic.Add(index, typeObj);
        }
        else
        {
            typeObj = typeObjDic[index];
        }
        typeObj.SetActive(true);
        typeObj.transform.SetParent(content);
        typeObj.transform.localScale          = Vector3.one;
        typeObj.GetComponent <Image>().sprite = GameTools.Instance.GetSpriteAtlas("Sprite/card/CardTypeAtlas", type.ToString());
        typeObj.transform.localPosition       = pos;
    }
Beispiel #2
0
    /// <summary>
    /// 显示牌信息
    /// </summary>
    public void ShowCardsResult(LotteryHistoryDto result)
    {
        stopBet.gameObject.SetActive(false);
        AHEndTxt.gameObject.SetActive(true);
        LastResult.text         = GameTools.GetCardType(result.result);
        lastTimeGrantAward.text = NumberConvert.ConvertW(result.lastTimeGrantAward);

        if (transform.gameObject.activeSelf)
        {
            ShowChard(result.cardIds, result.result);
        }
    }
Beispiel #3
0
    /// <summary>
    /// 历史记录
    /// </summary>
    public void HandleHistory(List <AHResult> history)
    {
        Transform resultParentTrans = transform.Find("Bg/Result");

        for (int i = 0; i < history.Count; i++)
        {
            Transform result = resultParentTrans.GetChild(i);

            //单双
            result.GetChild(0).GetComponent <Text>().text = GameTools.GetDoubleOrSingle(history[i].OddEnven);
            //牌型
            result.GetChild(1).GetComponent <Text>().text = GameTools.GetCardType(history[i].Result);
        }
    }
Beispiel #4
0
    /// <summary>
    /// 进入房间,更新信息
    /// </summary>
    /// <param name="info"></param>
    public void InRoom(LotteryRoomInfoDto info)
    {
        //if (info.residueTime > 10)
        //{
        //    StartTimeDown(info.residueTime - 10);
        //}
        //else if (info.residueTime >= 7)
        //{
        //    stopBet.gameObject.SetActive(true);
        //    AHEndTxt.gameObject.SetActive(false);
        //}
        //else
        //{
        //    stopBet.gameObject.SetActive(false);
        //    AHEndTxt.gameObject.SetActive(true);
        //}

        //if (info.historyDtos != null)
        //{

        //    lastTimeGrantAward.text = NumberConvert.ConvertW(info.lastTimeGrantAward);
        //    playerNum.text = info.playerNum + "人";
        //    NowBetMoney.text = NumberConvert.ConvertW(info.nowBetMoney);
        //    if (info.historyDtos.Count > 0)
        //    {
        //        LastResult.text = GameTools.GetCardType(info.historyDtos[0].result) + "  " + GameTools.GetDoubleOrSingle(info.historyDtos[0].oddEnven);
        //    }

        //    PlayerCache.historyList.Clear();
        //    for (int i = 0; i < info.historyDtos.Count; i++)
        //    {
        //        AHResult AHResultItem = new AHResult();
        //        AHResultItem.OddEnven = info.historyDtos[i].oddEnven;
        //        AHResultItem.Result = info.historyDtos[i].result;
        //        PlayerCache.historyList.Add(AHResultItem);
        //    }

        //    HandleHistory(PlayerCache.historyList);
        //}

        if (info.residueTime > 10)
        {
            StartTimeDown(info.residueTime - 10);
        }
        else if (info.residueTime >= 7)
        {
            stopBet.gameObject.SetActive(true);
            AHEndTxt.gameObject.SetActive(false);
        }
        else
        {
            stopBet.gameObject.SetActive(false);
            AHEndTxt.gameObject.SetActive(true);
        }
        lastTimeGrantAward.text = NumberConvert.ConvertW(info.lastTimeGrantAward);
        playerNum.text          = info.playerNum + "人";
        NowBetMoney.text        = NumberConvert.ConvertW(info.nowBetMoney);
        if (info.historyDtos != null)
        {
            LastResult.text = GameTools.GetCardType(info.historyDtos.result);
        }
    }