Пример #1
0
    public void StopDaoJiShi()
    {
        //SSDebug.Log("StopDaoJiShi******************************************************IsPlayDaoJishi " + IsPlayDaoJishi + ", Time ======= " + Time.time.ToString("f2"));
        if (GameOverObj.activeInHierarchy == true)
        {
            if (IsInvoking("HiddenGameOverObj"))
            {
                CancelInvoke("HiddenGameOverObj");
            }
            GameOverObj.SetActive(false);
        }

        if (!IsPlayDaoJishi)
        {
            //重置玩家信息.
            XkGameCtrl.GetInstance().ResetPlayerInfo(PlayerIndex);
            XKPlayerScoreCtrl.ShowPlayerScore(PlayerIndex);
            return;
        }
        IsPlayDaoJishi = false;
        CountDaoJiShi--;
        ContinueGameObj.SetActive(false);
        DaoJiShiObj.SetActive(false);
        //m_TVYaoKongEnterObj.SetActive(false);

        bool isActive = XkGameCtrl.GetIsActivePlayer(PlayerIndex);

        if (isActive == false && pcvr.GetInstance() != null)
        {
            pcvr.GetInstance().m_HongDDGamePadInterface.OnPlayerGameDaoJiShiOver(PlayerIndex);
        }
    }
Пример #2
0
    public void ShowPlayerFenShu(PlayerEnum indexVal, int fenShuVal)
    {
        int indexPlayer = (int)indexVal - 1;

        indexPlayer = (indexPlayer < 0 || indexPlayer > 3) ? 0 : indexPlayer;
        int fenShuValTmp = (fenShuVal * XKDaoJuGlobalDt.FenShuBeiLv[indexPlayer]);

        if (fenShuValTmp <= 0)
        {
            return;
        }

        if (XkGameCtrl.GetIsActivePlayer(indexVal) == true && XkGameCtrl.GetIsDeathPlayer(indexVal) == false)
        {
            XkGameCtrl.PlayerJiFenArray[indexPlayer] += fenShuValTmp;
        }
        XKPlayerScoreCtrl.ChangePlayerScore(indexVal);

        XKPlayerFenShuMove fenShuMoveCom = GetXKPlayerFenShuMove(indexVal);

        if (fenShuMoveCom == null)
        {
            return;
        }
        Transform playerTr = XKPlayerMoveCtrl.GetInstance(indexVal).PiaoFenPoint;
//		playerTr = TestPlayerTr; //test

        Vector3 startPos  = XkGameCtrl.GetInstance().GetWorldObjToScreenPos(playerTr.position);
        int     fenShuLen = fenShuVal.ToString().Length;

        startPos.x += 9f * (fenShuLen - 1);
        fenShuMoveCom.SetPlayerFenShuVal(fenShuVal, startPos, indexPlayer);
    }
Пример #3
0
    public void SetPlayerIndex(PlayerEnum playerIndex)
    {
        bool isActiveXT = XkGameCtrl.GetIsActivePlayer(playerIndex);

        PlayerSt = playerIndex;
        switch (PlayerSt)
        {
        case PlayerEnum.PlayerOne:
            _InstanceOne = this;
            break;

        case PlayerEnum.PlayerTwo:
            _InstanceTwo = this;
            break;

        case PlayerEnum.PlayerThree:
            _InstanceThree = this;
            break;

        case PlayerEnum.PlayerFour:
            _InstanceFour = this;
            break;
        }

        NengLianTran        = transform;
        OffsetXT            = NengLianTran.localPosition;
        NengLianParentTr    = NengLianTran.parent;
        NengLianTran.parent = XkGameCtrl.MissionCleanup;
        gameObject.SetActive(isActiveXT);
    }
    // Use this for initialization
    void Start()
    {
        switch (PlayerIndex)
        {
        case PlayerEnum.PlayerOne:
            _InstanceP1 = this;
            break;

        case PlayerEnum.PlayerTwo:
            _InstanceP2 = this;
            break;

        case PlayerEnum.PlayerThree:
            _InstanceP3 = this;
            break;

        case PlayerEnum.PlayerFour:
            _InstanceP4 = this;
            break;
        }
        ZuiGaoFenObj.SetActive(false);
        SetScoreSprite();

        if (!XkGameCtrl.GetIsActivePlayer(PlayerIndex))
        {
            SetActivePlayerScore(false);
        }
    }
    // Use this for initialization
    void Start()
    {
        switch (PlayerSt)
        {
        case PlayerEnum.PlayerOne:
            _InstanceOne = this;
            break;

        case PlayerEnum.PlayerTwo:
            _InstanceTwo = this;
            break;

        case PlayerEnum.PlayerThree:
            _InstanceThree = this;
            break;

        case PlayerEnum.PlayerFour:
            _InstanceFour = this;
            break;
        }

        bool isActive = XkGameCtrl.GetIsActivePlayer(PlayerSt);

        HandleXueKuangNum(isActive);
        m_WeiXinHead.mainTexture = m_TouMingHead;
    }
    // Use this for initialization
    internal void Init()
    {
        if (IsInit == true)
        {
            return;
        }
        IsInit = true;

        switch (PlayerIndex)
        {
        case PlayerEnum.PlayerOne:
            _InstanceP1 = this;
            break;

        case PlayerEnum.PlayerTwo:
            _InstanceP2 = this;
            break;

        case PlayerEnum.PlayerThree:
            _InstanceP3 = this;
            break;

        case PlayerEnum.PlayerFour:
            _InstanceP4 = this;
            break;
        }
        ZuiGaoFenObj.SetActive(false);
        //SetScoreSprite();

        if (!XkGameCtrl.GetIsActivePlayer(PlayerIndex))
        {
            SetActivePlayerScore(false);
        }
    }
    public void ClickFireBtFour(pcvr.ButtonState val)
    {
        if (ClickFireBtFourEvent != null)
        {
            ClickFireBtFourEvent(val);

            if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerFour) == false ||
                SSUIRoot.GetInstance().GetIsActiveCaiPiaoBuZuPanel(PlayerEnum.PlayerFour) == true)
            {
                ClickStartBtFour(val);
            }
        }
    }
    IEnumerator DelayActivePlayerToGame(XKPlayerMoveCtrl playerScript)
    {
        playerScript.SetIsActiveZhuiYa(true);
        XKGlobalData.GetInstance().PlayAudioXuanYaDiaoLuo();
        XkGameCtrl.GetInstance().SubGamePlayerHealth(playerScript.PlayerIndex, PlayerDamage, true);
        if (!XkGameCtrl.GetIsActivePlayer(playerScript.PlayerIndex))
        {
            playerScript.SetIsActiveZhuiYa(false);
            yield break;
        }
        yield return(new WaitForSeconds(TimeResetPlayer));

        XkGameCtrl.ActivePlayerToGame(playerScript.PlayerIndex, true);
        playerScript.SetIsActiveZhuiYa(false);
    }
Пример #9
0
    public void SetPlayerIndex(PlayerEnum playerIndex)
    {
        bool isActiveXT = XkGameCtrl.GetIsActivePlayer(playerIndex);

        PlayerSt = playerIndex;
        switch (PlayerSt)
        {
        case PlayerEnum.PlayerOne:
            _InstanceOne = this;
            break;

        case PlayerEnum.PlayerTwo:
            _InstanceTwo = this;
            break;

        case PlayerEnum.PlayerThree:
            _InstanceThree = this;
            break;

        case PlayerEnum.PlayerFour:
            _InstanceFour = this;
            break;
        }

        //Debug.Log("Unity: SetPlayerIndex -> isActiveXT === " + isActiveXT + ", playerIndex ==== " + playerIndex);
        NengLianTran        = transform;
        OffsetXT            = NengLianTran.localPosition;
        NengLianParentTr    = NengLianTran.parent;
        NengLianTran.parent = XkGameCtrl.MissionCleanup;
        gameObject.SetActive(isActiveXT);

        //if (isActiveXT && pcvr.IsHongDDShouBing)
        //{
        //    if (pcvr.IsHongDDShouBing)
        //    {
        //        int indexVal = (int)PlayerSt - 1;
        //        if (m_HeadUrl != pcvr.GetInstance().m_PlayerHeadUrl[indexVal])
        //        {
        //            m_HeadUrl = pcvr.GetInstance().m_PlayerHeadUrl[indexVal];
        //            XkGameCtrl.GetInstance().m_AsyImage.LoadPlayerHeadImg(m_HeadUrl, m_MatNum);
        //        }
        //    }
        //    else
        //    {
        //        m_MatNum.mainTexture = m_PlayerNumImg;
        //    }
        //}
    }
    void OnTriggerEnter(Collider other)
    {
        XKPlayerMoveCtrl playerMoveScript = other.GetComponent <XKPlayerMoveCtrl>();

        if (playerMoveScript == null)
        {
            return;
        }

        if (!XkGameCtrl.GetIsActivePlayer(playerMoveScript.PlayerIndex) ||
            playerMoveScript.GetIsActiveZhuiYa())
        {
            return;
        }
        //Debug.Log("XKTriggerXuanYa::OnTriggerEnter -> hit "+other.name);
        StartCoroutine(DelayActivePlayerToGame(playerMoveScript));
    }
Пример #11
0
    void CheckJiSuUISprite()
    {
        if (!XkGameCtrl.GetIsActivePlayer(PlayerSt))
        {
            HiddenJiSuUI();
            return;
        }

        float keyHD   = -JiSuTime;
        float fillVal = ((Time.realtimeSinceStartup - TimeStart) / keyHD) + 1f;

        fillVal = fillVal < 0f ? 0f : fillVal;
        fillVal = fillVal > 1f ? 1f : fillVal;
        JiSuSprite.fillAmount = fillVal;
        if (fillVal <= 0f)
        {
            HiddenJiSuUI();
        }
    }
    public void ClickFireBtTwo(pcvr.ButtonState val)
    {
        if (XKGlobalData.GameVersionPlayer == 0)
        {
            if (ClickFireBtTwoEvent != null)
            {
                ClickFireBtTwoEvent(val);
            }

            if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerTwo) == false ||
                SSUIRoot.GetInstance().GetIsActiveCaiPiaoBuZuPanel(PlayerEnum.PlayerTwo) == true)
            {
                ClickStartBtTwo(val);
            }
        }
        else
        {
            ClickFireBtFour(val);
        }
    }
    void Update()
    {
#if !USE_PC_INPUT_TEST
        if (pcvr.bIsHardWare)
        {
            return;
        }
#else
        IsUsePcInputTest = true;
#endif

#if UNITY_EDITOR
        //发布出来的游戏不允许用键盘进行投币.
        if (Input.GetKeyUp(KeyCode.T))
        {
            if (pcvr.IsXuNiPhoneShouBing)
            {
                //红点点微信二维码游戏.
                if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerOne) == false)
                {
                    //该机位没有被激活.
                    if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                    {
                        //清理玩家微信数据.
                        pcvr.GetInstance().m_HongDDGamePadInterface.RemoveGamePlayerData(PlayerEnum.PlayerOne);
                    }
                }
            }

            int coinVal = XKGlobalData.CoinPlayerOne + 1;
            XKGlobalData.SetCoinPlayerOne(coinVal);
            if (XKGlobalData.GetInstance().m_GameWXPayDataManage != null)
            {
                XKGlobalData.GetInstance().m_GameWXPayDataManage.WriteGamePayRevenueInfo(1);
            }
        }

        if (Input.GetKeyUp(KeyCode.Y))
        {
            if (pcvr.IsXuNiPhoneShouBing)
            {
                //红点点微信二维码游戏.
                if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerTwo) == false)
                {
                    //该机位没有被激活.
                    if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                    {
                        //清理玩家微信数据.
                        pcvr.GetInstance().m_HongDDGamePadInterface.RemoveGamePlayerData(PlayerEnum.PlayerTwo);
                    }
                }
            }

            int coinVal = XKGlobalData.CoinPlayerTwo + 1;
            XKGlobalData.SetCoinPlayerTwo(coinVal);
            if (XKGlobalData.GetInstance().m_GameWXPayDataManage != null)
            {
                XKGlobalData.GetInstance().m_GameWXPayDataManage.WriteGamePayRevenueInfo(1);
            }
        }

        if (Input.GetKeyUp(KeyCode.U))
        {
            if (pcvr.IsXuNiPhoneShouBing)
            {
                //红点点微信二维码游戏.
                if (XkGameCtrl.GetIsActivePlayer(PlayerEnum.PlayerThree) == false)
                {
                    //该机位没有被激活.
                    if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                    {
                        //清理玩家微信数据.
                        pcvr.GetInstance().m_HongDDGamePadInterface.RemoveGamePlayerData(PlayerEnum.PlayerThree);
                    }
                }
            }

            if (XKGlobalData.GameVersionPlayer == 0)
            {
                int coinVal = XKGlobalData.CoinPlayerThree + 1;
                XKGlobalData.SetCoinPlayerThree(coinVal);
                if (XKGlobalData.GetInstance().m_GameWXPayDataManage != null)
                {
                    XKGlobalData.GetInstance().m_GameWXPayDataManage.WriteGamePayRevenueInfo(1);
                }
            }
        }
#endif

        //if (Input.GetKeyUp(KeyCode.I)) {
        //	if (XKGlobalData.GameVersionPlayer == 0) {
        //		int coinVal = XKGlobalData.CoinPlayerFour + 1;
        //		XKGlobalData.SetCoinPlayerFour(coinVal);
        //	}
        //}

        //StartBt PlayerOne
        if (Input.GetKeyUp(KeyCode.G))
        {
            ClickStartBtOne(pcvr.ButtonState.UP);
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            ClickStartBtOne(pcvr.ButtonState.DOWN);
        }

        //StartBt PlayerTwo
        if (Input.GetKeyUp(KeyCode.H))
        {
            ClickStartBtTwo(pcvr.ButtonState.UP);
        }

        if (Input.GetKeyDown(KeyCode.H))
        {
            ClickStartBtTwo(pcvr.ButtonState.DOWN);
        }

        //StartBt PlayerThree
        if (Input.GetKeyUp(KeyCode.J))
        {
            ClickStartBtThree(pcvr.ButtonState.UP);
        }

        if (Input.GetKeyDown(KeyCode.J))
        {
            ClickStartBtThree(pcvr.ButtonState.DOWN);
        }

        //StartBt PlayerFour
        //if (Input.GetKeyUp(KeyCode.K)) {
        //	ClickStartBtFour( pcvr.ButtonState.UP );
        //}

        //if (Input.GetKeyDown(KeyCode.K)) {
        //	ClickStartBtFour( pcvr.ButtonState.DOWN );
        //}

        if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_GamePlayerAiData.IsActiveAiPlayer)
        {
            //没有玩家激活游戏.
        }
        else
        {
            //player_1.
            if (Input.GetKeyDown(KeyCode.A))
            {
                //ClickFangXiangLBtP1(pcvr.ButtonState.DOWN);
                OnClickFangXiangLBt(0, pcvr.ButtonState.DOWN);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangLBt(1, pcvr.ButtonState.DOWN);
                    OnClickFangXiangLBt(2, pcvr.ButtonState.DOWN);
                }
                OnPlayerDoPadDirection(PlayerEnum.PlayerOne);
            }

            if (Input.GetKeyUp(KeyCode.A))
            {
                //ClickFangXiangLBtP1(pcvr.ButtonState.UP);
                OnClickFangXiangLBt(0, pcvr.ButtonState.UP);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangLBt(1, pcvr.ButtonState.UP);
                    OnClickFangXiangLBt(2, pcvr.ButtonState.UP);
                }
            }

            if (Input.GetKeyDown(KeyCode.D))
            {
                //ClickFangXiangRBtP1(pcvr.ButtonState.DOWN);
                OnClickFangXiangRBt(0, pcvr.ButtonState.DOWN);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangRBt(1, pcvr.ButtonState.DOWN);
                    OnClickFangXiangRBt(2, pcvr.ButtonState.DOWN);
                }
                OnPlayerDoPadDirection(PlayerEnum.PlayerOne);
            }

            if (Input.GetKeyUp(KeyCode.D))
            {
                //ClickFangXiangRBtP1(pcvr.ButtonState.UP);
                OnClickFangXiangRBt(0, pcvr.ButtonState.UP);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangRBt(1, pcvr.ButtonState.UP);
                    OnClickFangXiangRBt(2, pcvr.ButtonState.UP);
                }
            }

            if (Input.GetKeyDown(KeyCode.W))
            {
                //ClickFangXiangUBtP1(pcvr.ButtonState.DOWN);
                OnClickFangXiangUBt(0, pcvr.ButtonState.DOWN);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangUBt(1, pcvr.ButtonState.DOWN);
                    OnClickFangXiangUBt(2, pcvr.ButtonState.DOWN);
                }
                OnPlayerDoPadDirection(PlayerEnum.PlayerOne);
            }

            if (Input.GetKeyUp(KeyCode.W))
            {
                //ClickFangXiangUBtP1(pcvr.ButtonState.UP);
                OnClickFangXiangUBt(0, pcvr.ButtonState.UP);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangUBt(1, pcvr.ButtonState.UP);
                    OnClickFangXiangUBt(2, pcvr.ButtonState.UP);
                }
            }

            if (Input.GetKeyDown(KeyCode.S))
            {
                //ClickFangXiangDBtP1(pcvr.ButtonState.DOWN);
                OnClickFangXiangDBt(0, pcvr.ButtonState.DOWN);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangDBt(1, pcvr.ButtonState.DOWN);
                    OnClickFangXiangDBt(2, pcvr.ButtonState.DOWN);
                }
                OnPlayerDoPadDirection(PlayerEnum.PlayerOne);
            }

            if (Input.GetKeyUp(KeyCode.S))
            {
                //ClickFangXiangDBtP1(pcvr.ButtonState.UP);
                OnClickFangXiangDBt(0, pcvr.ButtonState.UP);
                if (XkGameCtrl.GetInstance().m_CaiPiaoHealthDt != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData != null &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsOpenTest == true &&
                    XkGameCtrl.GetInstance().m_CaiPiaoHealthDt.m_TestBaoJiangData.IsTestPlayerAmmo == true)
                {
                    //测试玩家子弹,使玩家运动到一起.
                    OnClickFangXiangDBt(1, pcvr.ButtonState.UP);
                    OnClickFangXiangDBt(2, pcvr.ButtonState.UP);
                }
            }

            //player_2.
            if (Input.GetKeyDown(KeyCode.F))
            {
                //ClickFangXiangLBtP2(pcvr.ButtonState.DOWN);
                OnClickFangXiangLBt(1, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerTwo);
            }

            if (Input.GetKeyUp(KeyCode.F))
            {
                //ClickFangXiangLBtP2(pcvr.ButtonState.UP);
                OnClickFangXiangLBt(1, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.H))
            {
                //ClickFangXiangRBtP2(pcvr.ButtonState.DOWN);
                OnClickFangXiangRBt(1, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerTwo);
            }

            if (Input.GetKeyUp(KeyCode.H))
            {
                //ClickFangXiangRBtP2(pcvr.ButtonState.UP);
                OnClickFangXiangRBt(1, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.T))
            {
                //ClickFangXiangUBtP2(pcvr.ButtonState.DOWN);
                OnClickFangXiangUBt(1, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerTwo);
            }

            if (Input.GetKeyUp(KeyCode.T))
            {
                //ClickFangXiangUBtP2(pcvr.ButtonState.UP);
                OnClickFangXiangUBt(1, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.G))
            {
                //ClickFangXiangDBtP2(pcvr.ButtonState.DOWN);
                OnClickFangXiangDBt(1, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerTwo);
            }

            if (Input.GetKeyUp(KeyCode.G))
            {
                //ClickFangXiangDBtP2(pcvr.ButtonState.UP);
                OnClickFangXiangDBt(1, pcvr.ButtonState.UP);
            }

            //player_3.
            if (Input.GetKeyDown(KeyCode.J))
            {
                //ClickFangXiangLBtP3(pcvr.ButtonState.DOWN);
                OnClickFangXiangLBt(2, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerThree);
            }

            if (Input.GetKeyUp(KeyCode.J))
            {
                //ClickFangXiangLBtP3(pcvr.ButtonState.UP);
                OnClickFangXiangLBt(2, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                //ClickFangXiangRBtP3(pcvr.ButtonState.DOWN);
                OnClickFangXiangRBt(2, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerThree);
            }

            if (Input.GetKeyUp(KeyCode.L))
            {
                //ClickFangXiangRBtP3(pcvr.ButtonState.UP);
                OnClickFangXiangRBt(2, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.I))
            {
                //ClickFangXiangUBtP3(pcvr.ButtonState.DOWN);
                OnClickFangXiangUBt(2, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerThree);
            }

            if (Input.GetKeyUp(KeyCode.I))
            {
                //ClickFangXiangUBtP3(pcvr.ButtonState.UP);
                OnClickFangXiangUBt(2, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.K))
            {
                //ClickFangXiangDBtP3(pcvr.ButtonState.DOWN);
                OnClickFangXiangDBt(2, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerThree);
            }

            if (Input.GetKeyUp(KeyCode.K))
            {
                //ClickFangXiangDBtP3(pcvr.ButtonState.UP);
                OnClickFangXiangDBt(2, pcvr.ButtonState.UP);
            }

            //player_4.
            if (Input.GetKeyDown(KeyCode.LeftArrow))
            {
                //ClickFangXiangLBtP4(pcvr.ButtonState.DOWN);
                OnClickFangXiangLBt(3, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerFour);
            }

            if (Input.GetKeyUp(KeyCode.LeftArrow))
            {
                //ClickFangXiangLBtP4(pcvr.ButtonState.UP);
                OnClickFangXiangLBt(3, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.RightArrow))
            {
                //ClickFangXiangRBtP4(pcvr.ButtonState.DOWN);
                OnClickFangXiangRBt(3, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerFour);
            }

            if (Input.GetKeyUp(KeyCode.RightArrow))
            {
                //ClickFangXiangRBtP4(pcvr.ButtonState.UP);
                OnClickFangXiangRBt(3, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.UpArrow))
            {
                //ClickFangXiangUBtP4(pcvr.ButtonState.DOWN);
                OnClickFangXiangUBt(3, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerFour);
            }

            if (Input.GetKeyUp(KeyCode.UpArrow))
            {
                //ClickFangXiangUBtP4(pcvr.ButtonState.UP);
                OnClickFangXiangUBt(3, pcvr.ButtonState.UP);
            }

            if (Input.GetKeyDown(KeyCode.DownArrow))
            {
                //ClickFangXiangDBtP4(pcvr.ButtonState.DOWN);
                OnClickFangXiangDBt(3, pcvr.ButtonState.DOWN);
                OnPlayerDoPadDirection(PlayerEnum.PlayerFour);
            }

            if (Input.GetKeyUp(KeyCode.DownArrow))
            {
                //ClickFangXiangDBtP4(pcvr.ButtonState.UP);
                OnClickFangXiangDBt(3, pcvr.ButtonState.UP);
            }
        }

        //setPanel enter button
        if (Input.GetKeyUp(KeyCode.F4))
        {
            ClickSetEnterBt(pcvr.ButtonState.UP);
        }

        if (Input.GetKeyDown(KeyCode.F4))
        {
            ClickSetEnterBt(pcvr.ButtonState.DOWN);
        }

        //setPanel move button
        if (Input.GetKeyUp(KeyCode.F5))
        {
            ClickSetMoveBt(pcvr.ButtonState.UP);
        }

        if (Input.GetKeyDown(KeyCode.F5))
        {
            ClickSetMoveBt(pcvr.ButtonState.DOWN);
        }

        //Fire button
        if (Input.GetKeyUp(KeyCode.Mouse0))
        {
            //OnClickFireBt(0, pcvr.ButtonState.UP);
            //OnClickFireBt(1, pcvr.ButtonState.UP);
            //OnClickFireBt(2, pcvr.ButtonState.UP);
            //OnClickFireBt(3, pcvr.ButtonState.UP);
            OnClickDaoDanBt(0, pcvr.ButtonState.UP);
            OnClickDaoDanBt(1, pcvr.ButtonState.UP);
            OnClickDaoDanBt(2, pcvr.ButtonState.UP);
            //OnClickDaoDanBt(3, pcvr.ButtonState.UP);
            OnPlayerDoPadButton(PlayerEnum.PlayerOne);
            OnPlayerDoPadButton(PlayerEnum.PlayerTwo);
            OnPlayerDoPadButton(PlayerEnum.PlayerThree);
            //OnPlayerDoPadButton(PlayerEnum.PlayerFour);
        }

        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            //OnClickFireBt(0, pcvr.ButtonState.DOWN);
            //OnClickFireBt(1, pcvr.ButtonState.DOWN);
            //OnClickFireBt(2, pcvr.ButtonState.DOWN);
            //OnClickFireBt(3, pcvr.ButtonState.DOWN);
            OnClickDaoDanBt(0, pcvr.ButtonState.DOWN);
            OnClickDaoDanBt(1, pcvr.ButtonState.DOWN);
            OnClickDaoDanBt(2, pcvr.ButtonState.DOWN);
            //OnClickDaoDanBt(3, pcvr.ButtonState.DOWN);
            OnPlayerDoPadButton(PlayerEnum.PlayerOne);
            OnPlayerDoPadButton(PlayerEnum.PlayerTwo);
            OnPlayerDoPadButton(PlayerEnum.PlayerThree);
            //OnPlayerDoPadButton(PlayerEnum.PlayerFour);
        }

        if (Input.GetKeyUp(KeyCode.Mouse1))
        {
            OnClickDaoDanBt(0, pcvr.ButtonState.UP);
            OnClickDaoDanBt(1, pcvr.ButtonState.UP);
            OnClickDaoDanBt(2, pcvr.ButtonState.UP);
            //OnClickDaoDanBt(3, pcvr.ButtonState.UP);
            OnPlayerDoPadButton(PlayerEnum.PlayerOne);
            OnPlayerDoPadButton(PlayerEnum.PlayerTwo);
            OnPlayerDoPadButton(PlayerEnum.PlayerThree);
            //OnPlayerDoPadButton(PlayerEnum.PlayerFour);
        }

        if (Input.GetKeyDown(KeyCode.Mouse1))
        {
            OnClickDaoDanBt(0, pcvr.ButtonState.DOWN);
            OnClickDaoDanBt(1, pcvr.ButtonState.DOWN);
            OnClickDaoDanBt(2, pcvr.ButtonState.DOWN);
            //OnClickDaoDanBt(3, pcvr.ButtonState.DOWN);
            OnPlayerDoPadButton(PlayerEnum.PlayerOne);
            OnPlayerDoPadButton(PlayerEnum.PlayerTwo);
            OnPlayerDoPadButton(PlayerEnum.PlayerThree);
            //OnPlayerDoPadButton(PlayerEnum.PlayerFour);
        }

        //test
        //if (Input.GetKeyDown(KeyCode.P))
        //{
        //    PcvrComInputEvent.GetInstance().ClickPcvrBt07(pcvr.ButtonState.DOWN);
        //}

        //if (Input.GetKeyUp(KeyCode.P))
        //{
        //    PcvrComInputEvent.GetInstance().ClickPcvrBt07(pcvr.ButtonState.UP);
        //}
        //test
    }
    // Update is called once per frame
    void Update()
    {
        if (CameraTran == null)
        {
            CameraTran = Camera.main != null ? Camera.main.transform : null;
            return;
        }

        if (Time.frameCount % 3 == 0)
        {
            if (XkGameCtrl.GetIsActivePlayer(PlayerSt) == false || XkGameCtrl.GetIsDeathPlayer(PlayerSt) == true)
            {
                //gameObject.SetActive(false);
                SetActivePlayerXuTiao(false);
                return;
            }
        }
        CheckPlayerHitCol();

        Vector3 pos        = Vector3.zero;
        Vector3 forwardVal = Vector3.zero;

        switch (KeyHitSt)
        {
        case 0:
            //血条在后.
            forwardVal           = CameraTran.forward;
            forwardVal.y         = 0f;
            NengLianTran.forward = forwardVal;
            pos  = NengLianParentTr.position;
            pos += forwardVal * OffsetXT.z;
            //pos.x += OffsetXT.x;
            //pos.y += OffsetXT.y;
            NengLianTran.position = pos;
            break;

        case 1:
            //血条在左.
            forwardVal           = CameraTran.right;
            forwardVal.y         = 0f;
            NengLianTran.forward = forwardVal;
            pos  = NengLianParentTr.position;
            pos += forwardVal * (OffsetXT.z + 3f);
            //pos.x += OffsetXT.x;
            //pos.y += OffsetXT.y;
            NengLianTran.position = pos;
            break;

        case 2:
            //血条在右.
            forwardVal           = -CameraTran.right;
            forwardVal.y         = 0f;
            NengLianTran.forward = forwardVal;
            pos  = NengLianParentTr.position;
            pos += forwardVal * (OffsetXT.z + 3f);
            //pos.x += OffsetXT.x;
            //pos.y += OffsetXT.y;
            NengLianTran.position = pos;
            break;

        case 3:
            //血条在前.
            forwardVal           = CameraTran.forward;
            forwardVal.y         = 0f;
            NengLianTran.forward = forwardVal;
            pos  = NengLianParentTr.position;
            pos -= forwardVal * (OffsetXT.z - 3.5f);
            //pos.x += OffsetXT.x;
            //pos.y += OffsetXT.y;
            NengLianTran.position = pos;
            break;
        }
    }
Пример #15
0
    // Update is called once per frame
    void Update()
    {
        if (pcvr.DongGanState == 0)
        {
            return;
        }

        if (!GameTimeCtrl.GetInstance().GetIsCheckTimeSprite())
        {
            return;
        }

        if (!XkGameCtrl.GetIsActivePlayer(IndexPlayer))
        {
            return;
        }

        if (DaoJiShiCtrl.GetInstance(IndexPlayer).GetIsPlayDaoJishi())
        {
            return;
        }
        //pcvr.OpenQiNangQian(IndexPlayer);//test.
        //return;

        Vector3 eulerAngle = transform.eulerAngles;

        if (eulerAngle.x > 180f)
        {
            eulerAngle.x -= 360f;
        }

        if (eulerAngle.z > 180f)
        {
            eulerAngle.z -= 360f;
        }
        float eulerAngleX = eulerAngle.x;
        float eulerAngleZ = eulerAngle.z;
        float offsetAngle = 0.5f;

        if (Mathf.Abs(eulerAngleX) <= offsetAngle)
        {
            //前后气囊放气.
            if (KeyQHQiNangState != 0)
            {
                KeyQHQiNangState = 0;
                if (KeyZYQiNangState == 0)
                {
                    pcvr.CloseQiNangQian(IndexPlayer);
                    pcvr.CloseQiNangHou(IndexPlayer);
                }
            }
        }
        else if (eulerAngleX < 0f)
        {
            //前气囊充气,后气囊放气.
            if (KeyQHQiNangState != 1)
            {
                KeyQHQiNangState = 1;
                pcvr.OpenQiNangQian(IndexPlayer);
                pcvr.CloseQiNangHou(IndexPlayer, KeyZYQiNangState);
            }
        }
        else if (eulerAngleX > 0f)
        {
            //后气囊充气,前气囊放气.
            if (KeyQHQiNangState != 2)
            {
                KeyQHQiNangState = 2;
                pcvr.OpenQiNangHou(IndexPlayer);
                pcvr.CloseQiNangQian(IndexPlayer, KeyZYQiNangState);
            }
        }

        int indexVal = (int)IndexPlayer - 1;

        eulerAngleZ = -InputEventCtrl.PlayerFX[indexVal];
        if (XKGlobalData.GameVersionPlayer != 0)
        {
            indexVal   -= 2;
            eulerAngleZ = -InputEventCtrl.PlayerFX[indexVal];
        }

        offsetAngle = 0.1f;
        if (Mathf.Abs(eulerAngleZ) <= offsetAngle)
        {
            //左右气囊放气.
            if (KeyZYQiNangState != 0 && Time.realtimeSinceStartup - TimeLastZY >= MinTimeZY)
            {
                KeyZYQiNangState = 0;
                TimeLastZY       = Time.realtimeSinceStartup;
                if (KeyQHQiNangState == 0)
                {
                    pcvr.CloseQiNangZuo(IndexPlayer);
                    pcvr.CloseQiNangYou(IndexPlayer);
                }
            }
        }
        else if (eulerAngleZ < 0f)
        {
            //左气囊充气,右气囊放气.
            if (KeyZYQiNangState != 1 && Time.realtimeSinceStartup - TimeLastZY >= MinTimeZY)
            {
                KeyZYQiNangState = 1;
                TimeLastZY       = Time.realtimeSinceStartup;
                pcvr.OpenQiNangZuo(IndexPlayer);
                pcvr.CloseQiNangYou(IndexPlayer, KeyQHQiNangState);
            }
        }
        else if (eulerAngleZ > 0f)
        {
            //右气囊充气,左气囊放气.
            if (KeyZYQiNangState != 2 && Time.realtimeSinceStartup - TimeLastZY >= MinTimeZY)
            {
                KeyZYQiNangState = 2;
                TimeLastZY       = Time.realtimeSinceStartup;
                pcvr.OpenQiNangYou(IndexPlayer);
                pcvr.CloseQiNangZuo(IndexPlayer, KeyQHQiNangState);
            }
        }
    }
Пример #16
0
    void Update()
    {
        UpdateDanHuaPingJi();
        if (Time.time - m_TimeStart >= m_TimeCreateChouJiang && IsCreateChouJiang == false)
        {
            IsCreateChouJiang = true;
            //创建玩家抽奖界面.
            if (SSUIRoot.GetInstance().m_GameUIManage != null)
            {
                SSPingJiData.PingJiLevel chouJiangPingJi = SSPingJiData.PingJiLevel.A;
                if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_PingJiData != null)
                {
                    chouJiangPingJi = XkGameCtrl.GetInstance().m_PingJiData.m_ChouJiangPingJi;
                }

                //是否可以抽奖.
                IsPlayerCanChouJiang = m_PlayerPingJiLevel < chouJiangPingJi ? false : true;
                if (IsPlayerCanChouJiang == true)
                {
                    //淡化隐藏评级界面.
                    StartDanHuaHiddenPingJiPanel();
                    //允许抽奖时才可以展示抽奖界面.
                    SSUIRoot.GetInstance().m_GameUIManage.CreatPlayerChouJiangUI(m_IndexPlayer, IsPlayerCanChouJiang);
                }
            }
        }

        if (Time.time - m_TimeStart >= m_TimeHidden && IsRemoveSelf == false && IsPlayerCanChouJiang == false)
        {
            //玩家分数不足,无法进行抽奖.
            SSPingJiData.PingJiLevel chouJiangPingJi = SSPingJiData.PingJiLevel.A;
            if (XkGameCtrl.GetInstance() != null && XkGameCtrl.GetInstance().m_PingJiData != null)
            {
                chouJiangPingJi = XkGameCtrl.GetInstance().m_PingJiData.m_ChouJiangPingJi;
            }

            if (m_PlayerPingJiLevel < chouJiangPingJi)
            {
                //玩家分数不足,无法进行抽奖.
                //玩家币值是否足够.
                bool isPlayerCoinEnough = XKGlobalData.GetPlayerCoinIsEnough(m_IndexPlayer);
                if (isPlayerCoinEnough == true)
                {
                    //玩家币值充足.
                    bool isCanXuMing = true;
                    if (XKGlobalData.GetInstance().m_SSGameXuMingData != null)
                    {
                        //当前机位是否可以续命.
                        isCanXuMing = XKGlobalData.GetInstance().m_SSGameXuMingData.GetIsCanXuMing(m_IndexPlayer);
                    }

                    if (isCanXuMing == true)
                    {
                        //玩家可以续命.
                        if (XkGameCtrl.GetIsActivePlayer(m_IndexPlayer) == true)
                        {
                            //玩家首次GG之后,没有设置信息.
                            //设置玩家状态信息.
                            XkGameCtrl.SetActivePlayer(m_IndexPlayer, false);
                        }

                        //是否可以继续进行免费游戏.
                        bool isCanMianFeiPlayGame = false;
                        if (XKGlobalData.GetInstance() != null)
                        {
                            isCanMianFeiPlayGame = XKGlobalData.GetInstance().GetIsCanMianFeiPlayGame(m_IndexPlayer);
                        }

                        if (isCanMianFeiPlayGame == false)
                        {
                            //玩家不可以继续进行免费游戏.
                            //玩家币值充足,需要对微信用户进行扣费.
                            if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                            {
                                //此时需要对微信付费玩家进行红点点账户扣费.
                                pcvr.GetInstance().m_HongDDGamePadInterface.OnNeedSubPlayerMoney(m_IndexPlayer);
                            }

                            //玩家付费激活游戏.
                            if (pcvr.GetInstance() != null && pcvr.GetInstance().m_HongDDGamePadInterface != null)
                            {
                                //发送玩家付费激活游戏的登录信息给服务器.
                                pcvr.GetInstance().m_HongDDGamePadInterface.SendPlayerFuFeiActiveGameInfoToServer(m_IndexPlayer);
                            }
                        }
                        else
                        {
                            //玩家可以继续进行免费游戏.
                            if (pcvr.GetInstance() != null && pcvr.GetInstance().m_HongDDGamePadInterface != null)
                            {
                                //发送玩家首次免费游戏登录信息给服务器.
                                pcvr.GetInstance().m_HongDDGamePadInterface.SendPlayerShouCiMianFeiInfoToServer(m_IndexPlayer);
                            }
                            //减少玩家免费次数.
                            XKGlobalData.GetInstance().SubMianFeiNum(m_IndexPlayer);
                        }

                        //当前机位续命一次.
                        if (XKGlobalData.GetInstance().m_SSGameXuMingData != null)
                        {
                            XKGlobalData.GetInstance().m_SSGameXuMingData.AddXuMingCount(m_IndexPlayer);
                        }
                    }

                    if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                    {
                        //此时需要对微信玩家进行的游戏时长信息发送给红点点服务器.
                        pcvr.GetInstance().m_HongDDGamePadInterface.SetPlayerEndGameTime(m_IndexPlayer);
                    }

                    if (SSUIRoot.GetInstance().m_GameUIManage != null)
                    {
                        //删除玩家评级界面.
                        SSUIRoot.GetInstance().m_GameUIManage.RemovePlayerPingJiUI(m_IndexPlayer);
                    }

                    SSPlayerScoreManage playerScoreManage = SSPlayerScoreManage.GetInstance(m_IndexPlayer);
                    if (playerScoreManage != null)
                    {
                        //当删除玩家评级界面的同时重置距玩家还差多少分数.
                        playerScoreManage.OnRemovePlayerPingJiPanel();
                    }
                }
                else
                {
                    //玩家币值不足.
                    //玩家币值不足,需要对微信用户进行扣费.
                    if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                    {
                        if (pcvr.GetInstance().m_HongDDGamePadInterface.GetPlayerIsFuFeiActiveGame(m_IndexPlayer) == true)
                        {
                            //付费激活游戏的玩家.
                            //此时需要对微信付费玩家进行红点点账户扣费.
                            pcvr.GetInstance().m_HongDDGamePadInterface.OnNeedSubPlayerMoney(m_IndexPlayer);
                        }
                    }

                    if (pcvr.GetInstance().m_HongDDGamePadInterface != null)
                    {
                        //此时需要对微信玩家进行的游戏时长信息发送给红点点服务器.
                        pcvr.GetInstance().m_HongDDGamePadInterface.SetPlayerEndGameTime(m_IndexPlayer);
                    }

                    //设置玩家状态信息.
                    XkGameCtrl.SetActivePlayer(m_IndexPlayer, false);
                    //玩家评级过低,显示倒计时界面.
                    DaoJiShiCtrl daoJiShiCom = DaoJiShiCtrl.GetInstance(m_IndexPlayer);
                    if (daoJiShiCom != null)
                    {
                        daoJiShiCom.StartPlayDaoJiShi();
                    }

                    if (SSUIRoot.GetInstance().m_GameUIManage != null)
                    {
                        //删除玩家评级界面.
                        SSUIRoot.GetInstance().m_GameUIManage.RemovePlayerPingJiUI(m_IndexPlayer);
                    }

                    SSPlayerScoreManage playerScoreManage = SSPlayerScoreManage.GetInstance(m_IndexPlayer);
                    if (playerScoreManage != null)
                    {
                        //当删除玩家评级界面的同时重置距玩家还差多少分数.
                        playerScoreManage.OnRemovePlayerPingJiPanel();
                    }
                }

                //if (SSUIRoot.GetInstance().m_GameUIManage != null)
                //{
                //    //删除玩家游戏抽奖界面UI.
                //    SSUIRoot.GetInstance().m_GameUIManage.RemovePlayerChouJiangUI(m_IndexPlayer, 0f);
                //}
            }
            //else
            //{
            //    //玩家评级达到抽奖水平,显示抽奖界面.
            //    if (SSUIRoot.GetInstance().m_GameUIManage != null)
            //    {
            //        SSUIRoot.GetInstance().m_GameUIManage.CreatPlayerChouJiangUI(m_IndexPlayer);
            //    }
            //}

            //if (SSUIRoot.GetInstance().m_GameUIManage != null)
            //{
            //    //删除玩家评级界面.
            //    SSUIRoot.GetInstance().m_GameUIManage.RemovePlayerPingJiUI(m_IndexPlayer);
            //}
        }
    }
    static void CheckPlayerZuiGaoFen(bool isHuLueTime = false)
    {
        //XkGameCtrl.CheckPlayerActiveNum();
        if (XkGameCtrl.PlayerActiveNum <= 0)
        {
            return;
        }

        if (Time.time - TimeLastMaxScore < 0.5f)
        {
            return;
        }
        TimeLastMaxScore = Time.time;

        int        maxScore    = 0;
        int        indexVal    = -1;
        PlayerEnum indexPlayer = PlayerEnum.Null;

        for (int i = 0; i < 4; i++)
        {
            indexPlayer = (PlayerEnum)(i + 1);
            if (XkGameCtrl.GetIsActivePlayer(indexPlayer) == false)
            {
                continue;
            }

            if (XkGameCtrl.GetIsDeathPlayer(indexPlayer) == true)
            {
                XKPlayerScoreCtrl playerScoreCom = GetInstance(indexPlayer);
                if (playerScoreCom != null)
                {
                    playerScoreCom.SetActiveZuiGaoFen(false);
                }
                continue;
            }
            //switch (i) {
            //case 0:
            //	if (!XkGameCtrl.IsActivePlayerOne) {
            //		continue;
            //	}
            //	break;
            //case 1:
            //	if (!XkGameCtrl.IsActivePlayerTwo) {
            //		continue;
            //	}
            //	break;
            //case 2:
            //	if (!XkGameCtrl.IsActivePlayerThree) {
            //		continue;
            //	}
            //	break;
            //case 3:
            //	if (!XkGameCtrl.IsActivePlayerFour) {
            //		continue;
            //	}
            //	break;
            //}

            if (XkGameCtrl.PlayerJiFenArray[i] > maxScore)
            {
                maxScore = XkGameCtrl.PlayerJiFenArray[i];
                indexVal = i;
            }
        }
        //Debug.Log("Unity:"+"CheckPlayerZuiGaoFen -> maxScore "+maxScore+", index "+indexVal);

        if (indexVal == -1)
        {
            return;
        }

        XKPlayerScoreCtrl playerScore = null;

        switch (indexVal)
        {
        case 0:
            playerScore = _InstanceP1;
            break;

        case 1:
            playerScore = _InstanceP2;
            break;

        case 2:
            playerScore = _InstanceP3;
            break;

        case 3:
            playerScore = _InstanceP4;
            break;
        }
        if (playerScore.ZuiGaoFenObj.activeSelf)
        {
            return;
        }

        if (_InstanceP1 != null)
        {
            _InstanceP1.SetActiveZuiGaoFen(playerScore == _InstanceP1);
        }

        if (_InstanceP2 != null)
        {
            _InstanceP2.SetActiveZuiGaoFen(playerScore == _InstanceP2);
        }

        if (_InstanceP3 != null)
        {
            _InstanceP3.SetActiveZuiGaoFen(playerScore == _InstanceP3);
        }

        if (_InstanceP4 != null)
        {
            _InstanceP4.SetActiveZuiGaoFen(playerScore == _InstanceP4);
        }
    }