void OnTriggerEnter(Collider other)
    {
        if (ScreenDanHeiCtrl.IsStartGame)
        {
            return;
        }

        XkPlayerCtrl playerScript = other.GetComponent <XkPlayerCtrl>();

        if (playerScript == null)
        {
            return;
        }
        //Debug.Log("Unity:"+"XKTriggerSpawnNpc::OnTriggerEnter -> hit "+other.name);
        ScreenDanHeiCtrl.GetInstance().OpenScreenDanHui();
        playerScript.MakePlayerMoveToAiMark(MarkCom);
        gameObject.SetActive(false);
    }
コード例 #2
0
    void OnTriggerEnter(Collider other)
    {
        if (XKTriggerKaQiuShaFire.IsCloseKaQiuShaTest)
        {
            return;             //test;
        }

        if (Network.peerType != NetworkPeerType.Disconnected)
        {
            if (Network.peerType == NetworkPeerType.Server)
            {
                if (FeiJiMarkCom != null && TanKeMarkCom != null)
                {
                    IsActiveHeTiCloseUI = true;
                    ServerPortCameraCtrl.CloseAllServerPortCamera();
                }
                return;
            }
        }

        if (DaoJiShiCtrl.GetInstance().GetIsPlayDaoJishi() || GameOverCtrl.IsShowGameOver)
        {
            return;
        }

        XkPlayerCtrl playerScript = other.GetComponent <XkPlayerCtrl>();

        if (playerScript == null)
        {
            return;
        }

        if (playerScript.PlayerSt == PlayerTypeEnum.FeiJi && XkGameCtrl.GameJiTaiSt != GameJiTaiType.FeiJiJiTai)
        {
            return;
        }

        if (playerScript.PlayerSt == PlayerTypeEnum.TanKe && XkGameCtrl.GameJiTaiSt != GameJiTaiType.TanKeJiTai)
        {
            return;
        }

        if (FeiJiMarkCom != null && TanKeMarkCom != null && IsActiveHeTiCloseUI)
        {
            return;
        }
        IsClosePlayerUI = true;
        CheckIsPlayDaoJiShi();

        ScreenDanHeiCtrl.GetInstance().ClosePlayerUI();
        if (FeiJiMarkCom != null && TanKeMarkCom != null)
        {
            IsActiveHeTiCloseUI = true;
            if (Network.peerType == NetworkPeerType.Client && NetCtrl.GetInstance() != null)
            {
                NetCtrl.GetInstance().TryActiveHeTiPlayerEvent();
            }
            ScreenDanHeiCtrl.GetInstance().OpenStartCamera();
            ScreenDanHeiCtrl.GetInstance().OpenScreenDanHui(1);
            GameMode modeVal = XkGameCtrl.GameModeVal;
            switch (modeVal)
            {
            case GameMode.DanJiFeiJi:
                playerScript.MakePlayerMoveToAiMark(FeiJiMarkCom);
                break;

            case GameMode.DanJiTanKe:
                playerScript.MakePlayerMoveToAiMark(TanKeMarkCom);
                break;

            case GameMode.LianJi:
                if (Network.peerType != NetworkPeerType.Disconnected)
                {
                    if (XkPlayerCtrl.GetInstanceFeiJi() != null)
                    {
                        XkPlayerCtrl.GetInstanceFeiJi().MakePlayerMoveToAiMark(FeiJiMarkCom);
                    }

                    if (XkPlayerCtrl.GetInstanceTanKe() != null)
                    {
                        XkPlayerCtrl.GetInstanceTanKe().MakePlayerMoveToAiMark(TanKeMarkCom);
                    }
                }
                else
                {
                    XkPlayerCtrl.GetInstanceFeiJi().MakePlayerMoveToAiMark(FeiJiMarkCom);
                    XkPlayerCtrl.GetInstanceTanKe().MakePlayerMoveToAiMark(TanKeMarkCom);
                }

//				if (XkGameCtrl.GetInstance().IsServerCameraTest) {
//					ServerPortCameraCtrl.CloseAllServerPortCamera();
//				}
                break;
            }
        }
        gameObject.SetActive(false);
    }