public static void ChangePlayerScore(PlayerEnum indexPlayer)
    {
        XKPlayerScoreCtrl instanceVal = GetInstance(indexPlayer);

        if (instanceVal == null)
        {
            return;
        }
        //instanceVal.MakeScoreToBig();
        CheckPlayerZuiGaoFen();


        SSPlayerScoreManage playerScoreManage = SSPlayerScoreManage.GetInstance(indexPlayer);

        if (playerScoreManage != null && playerScoreManage.IsOnPlayerFenShuZuGou == false)
        {
            //玩家有新获得积分.
            int minChouJiangScore = 40000;
            if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_PingJiData != null)
            {
                minChouJiangScore = XkGameCtrl.GetInstance().m_PingJiData.GetChouJiangMinScore();
            }

            int playerScore = XkGameCtrl.GetPlayerJiFenValue(indexPlayer);
            //还差多少分数.
            int haiChaScoreVal = minChouJiangScore - playerScore;
            if (haiChaScoreVal <= 0)
            {
                haiChaScoreVal = 0;
            }

            XKPlayerScoreCtrl playerScoreCom = GetInstance(indexPlayer);
            if (playerScoreCom != null)
            {
                //设置还差多少分数.
                playerScoreCom.SetJuChouJiangScore(haiChaScoreVal);
            }
        }
    }
Example #2
0
        /// <summary>
        /// 设置是否显示距抽奖界面.
        /// </summary>
        internal void SetActiveJuChouJiang(PlayerEnum indexPlayer, bool isActive)
        {
            if (isActive == true)
            {
                //玩家分数不够抽奖资格.
                int indexVal = (int)indexPlayer - 1;
                if (juChouJiangUI != null)
                {
                    if (indexVal >= 0 && indexVal < juChouJiangImgArray.Length && juChouJiangImgArray[indexVal] != null)
                    {
                        //给不同玩家设置还差多少分UI.
                        juChouJiangUI.mainTexture = juChouJiangImgArray[indexVal];
                    }
                }

                if (fenShuNumUI != null)
                {
                    if (indexVal >= 0 && indexVal < fenShuAtlasArray.Length && fenShuAtlasArray[indexVal] != null)
                    {
                        for (int i = 0; i < fenShuNumUI.m_UISpriteArray.Length; i++)
                        {
                            if (fenShuNumUI.m_UISpriteArray[i] != null)
                            {
                                //给不同玩家设置还差多少分的数字UI图集.
                                fenShuNumUI.m_UISpriteArray[i].atlas = fenShuAtlasArray[indexVal];
                            }
                        }
                    }

                    //玩家最多差40000分可以获得抽奖.
                    int minChouJiangScore = 40000;
                    if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_PingJiData != null)
                    {
                        minChouJiangScore = XkGameCtrl.GetInstance().m_PingJiData.GetChouJiangMinScore();
                    }

                    int playerScore = XkGameCtrl.GetPlayerJiFenValue(indexPlayer);
                    //还差多少分数.
                    int haiChaScoreVal = minChouJiangScore - playerScore;
                    if (haiChaScoreVal <= 0)
                    {
                        haiChaScoreVal = 100;
                    }
                    fenShuNumUI.ShowNumUI(haiChaScoreVal);
                }
            }

            if (juChouJiangObj != null)
            {
                //距抽奖还差多少分.
                juChouJiangObj.SetActive(isActive);
            }

            if (gongXiJinRuChouJiangObj != null)
            {
                //恭喜进入抽奖.
                gongXiJinRuChouJiangObj.SetActive(!isActive);
            }

            if (headKuangUI != null)
            {
                int indexVal = (int)indexPlayer - 1;
                if (indexVal >= 0 && indexVal < headKuangImgArray.Length && headKuangImgArray[indexVal] != null)
                {
                    //玩家头像框.
                    headKuangUI.mainTexture = headKuangImgArray[indexVal];
                }
            }
        }