Beispiel #1
0
    void OnTriggerEnter(Collider other)
    {
        if (XKTriggerKaQiuShaFire.IsCloseKaQiuShaTest)
        {
            return;             //test;
        }

        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (Network.peerType == NetworkPeerType.Server)
        {
            return;
        }

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

        if (script == null || !script.GetIsHandleRpc())
        {
            return;
        }
        PlayerCameraTr  = script.GetPlayerCameraScript().transform;
        IsActiveTrigger = true;
    }
    void OnTriggerEnter(Collider other)
    {
        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (Network.peerType == NetworkPeerType.Server)
        {
            return;
        }

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

        if (playerScript == null || !playerScript.GetIsHandleRpc())
        {
            return;
        }
        gameObject.SetActive(false);
        XkGameCtrl.GetInstance().SetIsStopMovePlayer(false);
        XkGameCtrl.GetInstance().SetIsActiveWuDiState(true);
    }
    void OnTriggerEnter(Collider other)
    {
        if (ZuDangState == ZuDangType.Null)
        {
            gameObject.SetActive(false);
            return;
        }

        if (JiFenJieMianCtrl.GetInstance().GetIsShowFinishTask())
        {
            return;
        }

        if (Network.peerType == NetworkPeerType.Server)
        {
            return;
        }

        mPlayerScript = other.GetComponent <XkPlayerCtrl>();
        if (mPlayerScript == null || !mPlayerScript.GetIsHandleRpc())
        {
            return;
        }

        if (!CheckIsMovePlayer())
        {
            IsActiveTrigger         = true;
            KongXiDt.TimeLastKongXi = KongXiDt.TimeLastKongXiDaoJiShi = Time.time;
            //打开提示框UI.
            switch (ZuDangState)
            {
            case ZuDangType.PuTong:
            {
                XkGameCtrl.GetInstance().SetIsStopMovePlayer(true);
                XkGameCtrl.GetInstance().SetIsActiveZuDangTrigger(true);
                if (GameUICenterCtrl.GetInstance() != null)
                {
                    GameUICenterCtrl.GetInstance().SpawnZuDangUI();
                    if (ZuDangArray[0] != null)
                    {
                        XKNpcHealthCtrl npcHealth = ZuDangArray[0].GetComponent <XKNpcHealthCtrl>();
                        if (npcHealth != null)
                        {
                            GameUICenterCtrl.GetInstance().SpawnZuDangXueTiaoUI(npcHealth);
                        }
                    }
                }
                break;
            }

            case ZuDangType.KongXi:
            {
                if (GameUICenterCtrl.GetInstance() != null)
                {
                    GameUICenterCtrl.GetInstance().SpawnKongXiZuDangUI();
                    GameUICenterCtrl.GetInstance().SpawnKongXiDaoJiShiUI((int)KongXiDt.TimeSpawnDaoDan);
                }
                break;
            }
            }
        }
        else
        {
            gameObject.SetActive(false);
        }
    }