void CheckIsHitDown()
    {
        if (IsHitDown)
        {
            return;
        }

        RaycastHit hitInfo;
        Vector3    startPos   = tr.position + Vector3.up * 2f;
        Vector3    forwardVal = Vector3.down;

        Physics.Raycast(startPos, forwardVal, out hitInfo, 10f, GameCtrlXK.GetInstance().NpcVertHitLayer.value);
        if (hitInfo.collider != null)
        {
            if (Vector3.Distance(hitInfo.point, tr.position) < 2)
            {
                IsHitDown = true;

                Animator aniCom = tr.GetComponentInChildren <Animator>();
                if (aniCom != null && BulletState == NpcBulletState.ShuiLei)
                {
                    aniCom.SetBool("Root", true);
                }
            }
        }
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 50f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                CameraShake.GetInstance().PlayAudioSoureFengXue();
                //XueDiTiShiCtrl.GetInstance().ShowXueDiTiShi();
                SetPlayerZhuanXiangVal();
            }
        }
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 50f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                DirectionalLlightCtrl.GetInstance().InitChangeIntensity(DirectionalLlightCtrl.MinIntensityVal, TimeLightVal);
            }
        }
    }
    void CheckPlayerForwardHit()
    {
        RaycastHit hitInfo;
        Vector3    startPos = PlayerTran.position + Vector3.up * 10f;

        //Vector3 endPos = PlayerTran.position;
        //Debug.DrawLine(startPos, endPos, Color.red);
        Physics.Raycast(startPos, Vector3.down, out hitInfo, 10f, GameCtrlXK.GetInstance().WaterLayerMask);
        if (hitInfo.collider != null &&
            !hitInfo.collider.isTrigger &&
            (hitInfo.collider.GetComponent <BoxCollider>() != null ||
             (hitInfo.collider.GetComponent <MeshCollider>() && hitInfo.collider.tag == "WaterPath")))
        {
            PlayerTran.position = hitInfo.point;
        }

        if (!IsActivePlayerForwardHit)
        {
            return;
        }

        startPos = PlayerTran.position + Vector3.up * 1.5f;
        //Vector3 endPos = startPos + PlayerTran.forward * 10f;
        //Debug.DrawLine(startPos, endPos, Color.red);
        Physics.Raycast(startPos, PlayerTran.forward, out hitInfo, 10f, GameCtrlXK.GetInstance().WaterLayerMask);
        if (hitInfo.collider != null &&
            hitInfo.collider.GetComponent <MeshCollider>() &&
            hitInfo.collider.tag != "WaterPath")
        {
            hitInfo.collider.isTrigger = true;
        }
    }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 50f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                SetPlayerSpeedVal();
            }
        }
    }
    void InitPlayerAutoFire()
    {
        if (IsInitPlayerAutoFire)
        {
            return;
        }
        IsInitPlayerAutoFire = true;
        CenterPerPx          = GameCtrlXK.GetInstance().ZhuJiaoNvCenterPerPx;
        NetView    = GetComponent <NetworkView>();
        PlayerTran = transform;
        RigObj     = rigidbody;
        IsIntoSky  = false;
        ResetIsTurn();

        SetMaxDirCosAB();
        if (spawnPoint == null)
        {
            spawnPoint = transform;
        }
        CloseWaterParticle();
        SetPlayerBoxColliderState(false);
        ZhuJiaoNvScript = GetComponentInChildren <ZhuJiaoNv>();

        InputEventCtrl.GetInstance().ClickFireBtEvent += ClickFireBtEvent;
    }
    IEnumerator DelaySpawnPlayerNengLiangLiZi(Vector3 pos)
    {
        float timeVal = GameCtrlXK.GetInstance().TimeNpcSpawnExplode + TimeValNengLiang;

        yield return(new WaitForSeconds(timeVal));

        Instantiate(NengLiangLiZi, pos, transform.rotation);
    }
 void ActiveJuLiFuState()
 {
     if (IsActiveJuLiFu)
     {
         return;
     }
     IsActiveJuLiFu = true;
     AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioJuLiFu);
     GlobalData.GetInstance().IsActiveJuLiFu = true;
     Invoke("CloseJuLiFuState", GameCtrlXK.GetInstance().ActiveJuLiFuTime);
 }
Example #9
0
    void HiddenFinishPanel()
    {
        if (!gameObject.activeSelf)
        {
            return;
        }
        gameObject.SetActive(false);

        GameCtrlXK.GetInstance().CloseAllCameras();
        Invoke("GotoMoviePanel", 4f);
    }
 void CloseJuLiFuState()
 {
     if (!IsActiveJuLiFu)
     {
         return;
     }
     IsActiveJuLiFu = false;
     GlobalData.GetInstance().IsActiveJuLiFu = false;
     ActiveDaJuCtrl.SetTypeDaoJuList((int)DaoJuTypeIndex.juLiFu, 0);
     GameCtrlXK.GetInstance().ActivePlayerDaoJuType((int)DaoJuTypeIndex.Close);
 }
    public void SendShowAllCamera()
    {
        NetworkRpcMsgCtrl.MaxLinkServerCount = 100;

        if (Network.peerType != NetworkPeerType.Disconnected &&
            MoveCameraByPath.IsMovePlayer &&
            GlobalData.GetInstance().gameLeve == GameLeve.WaterwheelNet)
        {
            netView.RPC("SendOtherLinkerShowAllCamera", RPCMode.OthersBuffered);
        }
        GameCtrlXK.GetInstance().ShowAllCameras();
    }
    public static void ResetIsIntoPuBu()
    {
        if (!IntoPuBuCtrl.IsIntoPuBu)
        {
            return;
        }
        IntoPuBuCtrl.IsIntoPuBu = false;
        PlayerAutoFire.ResetIsRestartMove();

        GameCtrlXK.GetInstance().InitDelayClosePlayerBoxCollider();
        CameraShake.GetInstance().SetRadialBlurActive(false, CameraShake.BlurStrengthPubu);
        CameraShake.GetInstance().SetActiveCamOtherPoint(false, CamDirPos.FIRST, null);
    }
Example #13
0
    void UpdateMeshFilter()
    {
        MeshFilter filter = GetComponent <MeshFilter>();

        if (filter != null &&
            GameCtrlXK.GetInstance().TriggerFilterMesh != null &&
            filter.sharedMesh != GameCtrlXK.GetInstance().TriggerFilterMesh)
        {
            DestroyImmediate(filter);
            MeshFilter newFilter = gameObject.AddComponent <MeshFilter>();
            newFilter.sharedMesh = GameCtrlXK.GetInstance().TriggerFilterMesh;
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        if (vecA.y <= vecB.y)
        {
            return;
        }

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 50f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                IntoPuBuCtrl.IsIntoPuBu = false;
                PlayerAutoFire.ResetIsRestartMove();
                PlayerAutoFire.HandlePlayerOutPubuEvent();

                GameCtrlXK.GetInstance().InitDelayClosePlayerBoxCollider();
                CameraShake.GetInstance().SetRadialBlurActive(false, CameraShake.BlurStrengthPubu);
                CameraShake.GetInstance().SetActiveCamOtherPoint(false, CamDirPos.FIRST, null);

                if (PlayerAutoFire.PlayerMvSpeed > 100f)
                {
                    HeatDistort.GetInstance().InitPlayScreenWater();
                }
            }
        }
    }
    public static int GetPlayerJiaShiLevelStar()
    {
        int starNum = 3;
        int val_1   = GameCtrlXK.GetInstance().PlayerHitZhangAi_1;
        int val_2   = GameCtrlXK.GetInstance().PlayerHitZhangAi_2;

        if (PlayerHitZhangAiNum > val_2)
        {
            starNum = 1;
        }
        else if (PlayerHitZhangAiNum <= val_2 && PlayerHitZhangAiNum > val_1)
        {
            starNum = 2;
        }
        return(starNum);
    }
    public static int GetPlayerShootLevelStar()
    {
        int starNum = 1;
        int val_1   = GameCtrlXK.GetInstance().PlayerShootNpc_1;
        int val_2   = GameCtrlXK.GetInstance().PlayerShootNpc_2;

        if (PlayerShootNpcNum > val_2)
        {
            starNum = 3;
        }
        else if (PlayerShootNpcNum <= val_2 && PlayerShootNpcNum > val_1)
        {
            starNum = 2;
        }
        return(starNum);
    }
 public void ActiveHuanYingFuState()
 {
     if (IsActiveHuanYingFu)
     {
         return;
     }
     IsActiveHuanYingFu = true;
     AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioHuanYingFu);
     CameraShake.GetInstance().SetIsActiveHuanYingFu(true);
     PlayerBoxColObj.layer = LayerMask.NameToLayer("TransparentFX");
     HuanYingFuObj.SetActive(true);
     HuanYingFengXiaoObj.SetActive(true);
     XingXingCtrl.IsPlayerCanHitNPC          = false;
     PlayerAutoFire.IsActivePlayerForwardHit = true;
     Invoke("CloseHuanYingFuState", GameCtrlXK.GetInstance().JiaSuWuDiTime);
 }
Example #18
0
    void Update()
    {
        if (GlobalData.GetInstance().gameMode == GameMode.None ||
            GlobalData.GetInstance().gameLeve == GameLeve.Movie)
        {
            return;
        }

        if (GlobalData.GetInstance().gameMode == GameMode.OnlineMode && Network.peerType == NetworkPeerType.Client)
        {
            gameObject.SetActive(false);
            return;
        }

        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= TriggerDisMin)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                SpawnAllPointNpc();
            }
        }
    }
    IEnumerator PlayHiddenOver()
    {
        OverSprite.fillAmount -= 0.05f;
        if (OverSprite.fillAmount <= 0f)
        {
            OverSprite.fillAmount = 0f;
            StopCoroutine("PlayHiddenOver");
            yield return(new WaitForSeconds(0.5f));

            GameCtrlXK.GetInstance().CloseAllCameras();
            Invoke("GameOverBackToMovieScene", 4.0f);
            yield break;
        }

        yield return(new WaitForSeconds(0.03f));

        yield return(StartCoroutine(PlayHiddenOver()));
    }
    void CheckWaterwheelPlayerSpeed()
    {
        float speedTmp = 0f;

        speedTmp  = rigidbody.velocity.magnitude * 3.6f * Time.timeScale;
        speedTmp *= 0.9f;
        speedTmp  = Mathf.FloorToInt(speedTmp);

        float mouseDownCountTmp = MouseDownCountP_1 + MouseDownCountP_2;
        float dVal = mSpeed - speedTmp;

        if (dVal > PlayerAutoFire.DisSpeedVal && mouseDownCountTmp > 0f)
        {
            //Debug.Log("DSpeedVal = " + dVal);
            CameraShake.GetInstance().SetCameraShakeImpulseValue();
            PlayerAutoFire.AddPlayerHitZhangAiNum();
            pcvr.GetInstance().OnPlayerHitShake();
        }
        mSpeed = speedTmp;

        if (!pcvr.IsPlayerHitShake)
        {
            if (mSpeed > 25f)
            {
                pcvr.OpenQiNangQian();
                pcvr.CloseQiNangHou();
            }
            else
            {
                pcvr.CloseQiNangQian();
            }

            if (mSpeed < 5 && mouseDownCountTmp <= 0.1f)
            {
                pcvr.CloseQiNangZuo();
                pcvr.CloseQiNangYou();
            }
        }
        GameCtrlXK.GetInstance().SetPlayerMvSpeedSpriteInfo(speedTmp / (0.65f * mMaxVelocityFoot));
        AutoFireScript.SetPlayerMvSpeed(mSpeed);
        ChuanLunZiScript.UpdateChuanLunZiAction(speedTmp);
    }
    void ActivePlayerFollowCamera()
    {
        this.enabled        = false;
        NoiseScript.enabled = false;
        GameCtrlXK.GetInstance().ShowAllGUI();
        StartGameTimeCtrl.GetInstance().DelayPlayTime();
        WaterwheelCameraCtrl.GetInstance().ActivePlayerFollowCamera();
        InputEventCtrl.GetInstance().ClickStartBtOneEvent -= clickStartBtOneEvent;

        if (GameCtrlXK.GetInstance().PlayerMarkTest == null)
        {
            PlayerAutoFire.ResetIsRestartMove();
        }
        Debug.Log("ActivePlayerFollowCamera....");

        if (CartoonShootCamCtrl.GetInstance() != null)
        {
            CartoonShootCamCtrl.GetInstance().CheckGenSuiCamTranStartGame();
        }
    }
    void ActiveBuWaWa()
    {
        if (BuWaWaObj == null || BuWaWaObj.activeSelf)
        {
            return;
        }
        AnimatorNpc.enabled = false;
        BuWaWaObj.SetActive(true);
        Rigidbody rigObj = BuWaWaObj.GetComponent <Rigidbody>();
        Vector3   vecDir = Vector3.Lerp(-ZaiTiNpcTran.forward, ZaiTiNpcTran.up, GameCtrlXK.GetInstance().NpcBuWaWaVal);

        if (IsDiLeiNpc)
        {
            Transform TranCam = Camera.main.transform;
            vecDir   = TranCam.forward;
            vecDir.y = 0f;
            vecDir   = Vector3.Lerp(vecDir, Vector3.up, GameCtrlXK.GetInstance().NpcBuWaWaVal);
        }
        rigObj.AddForce(vecDir * BuWaWaPowerVal, ForceMode.Impulse);
    }
    public void ResetPlayerCameraPos()
    {
        //Debug.Log("ResetPlayerCameraPos*********");
        IsRestartMove     = true;
        PlayerRestartTime = Time.realtimeSinceStartup;
        PlayerMvSpeed     = 0f;
        Time.timeScale    = 1.0f;

        if (GlobalData.GetInstance().gameMode == GameMode.SoloMode)
        {
            WaterwheelCameraCtrl.GetInstance().ResetPlayerCameraPos();
        }
        else
        {
            WaterwheelCameraNetCtrl.GetInstance().ResetPlayerCameraPos();
        }
        CameraShake.IsActiveCamOtherPoint = false;
        IntoPuBuCtrl.IsIntoPuBu           = false;
        GameCtrlXK.GetInstance().DelayClosePlayerBoxCollider();
    }
    // Update is called once per frame
    void Update()
    {
        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 50f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                //Time.timeScale = WorldTimeScale;
                if (IntoPuBuCtrl.IsIntoPuBu)
                {
                    return;
                }

                PlayerForward  = TriggerTran.forward;
                Time.timeScale = WorldTimeScale;
                CameraShake.GetInstance().SetActiveCamOtherPoint(true, CameraDirPos, CamFreePoint);
            }
        }
    }
Example #25
0
    public void SetActiveCamOtherPoint(bool isActive, CamDirPos camDirPosVal, Transform camFreePoint)
    {
        IsActiveCamOtherPoint = isActive;
        if (isActive)
        {
            switch (camDirPosVal)
            {
            case CamDirPos.BACK:
                Debug.LogError("SetActiveCamOtherPoint -> camDirPosVal should not is BackCamPoint");
                CamPointUp      = null;
                CamPointUp.name = "null";
                return;

            case CamDirPos.FREE:
                if (camFreePoint == null)
                {
                    Debug.LogError("SetActiveCamOtherPoint -> camFreePoint should not is null");
                    CamPointUp      = null;
                    CamPointUp.name = "null";
                    return;
                }
                mCamPoint_free = camFreePoint;
                break;

            case CamDirPos.FIRST:
                GameCtrlXK.GetInstance().SetPlayerBoxColliderState(true);
                break;
            }
        }
        else
        {
            Time.timeScale = 1f;
            if (IntoPuBuCtrl.IsIntoPuBu)
            {
                IntoPuBuCtrl.PlayerMvSpeed += 20f;
            }
            GameCtrlXK.GetInstance().InitDelayClosePlayerBoxCollider();
        }
        CamDir = camDirPosVal;
    }
Example #26
0
    // Update is called once per frame
    void Update()
    {
        /*if (Input.GetKeyUp(KeyCode.P)) {
         *      AddGameTimeCtrl.GetInstance().PlayAddGameTime(AddTimeVal);
         * }*/

        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 15f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);
                StartBtCtrl.GetInstanceP1().ActivePlayerOne();
                GameDaoJiShiCtrl.GetInstance().StopDaoJiShi();
                AddGameTimeCtrl.GetInstance().PlayAddGameTime(AddTimeVal);
                AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioTimeJiaShiDian);
            }
        }
    }
    void CloseHuanYingFuState()
    {
        PlayerZhuanXiangVal = GameCtrlXK.PlayerZhuanXiangPTVal;
        if (!IsActiveHuanYingFu)
        {
            return;
        }
        CancelInvoke("CloseHuanYingFuState");
        NengLiangQuanCtrl.GetInstance().MoveNengLiangQuanToStart(DaoJuTypeIndex.huanYingFu);
        CameraShake.GetInstance().SetRadialBlurActive(false, CameraShake.BlurStrengthHuanYingFu);
        CameraShake.GetInstance().SetIsActiveHuanYingFu(false);

        if (!IsActiveShenXingMode)
        {
            XingXingCtrl.IsPlayerCanHitNPC          = true;
            PlayerAutoFire.IsActivePlayerForwardHit = false;
            PlayerBoxColObj.layer = LayerMask.NameToLayer("Default");
            HuanYingFuObj.SetActive(false);
        }
        IsActiveHuanYingFu = false;
        HuanYingFengXiaoObj.SetActive(false);
        ActiveDaJuCtrl.SetTypeDaoJuList((int)DaoJuTypeIndex.huanYingFu, 0);
        GameCtrlXK.GetInstance().ActivePlayerDaoJuType((int)DaoJuTypeIndex.Close);
    }
Example #28
0
    // Update is called once per frame
    void Update()
    {
        if (GameCtrlXK.PlayerTran == null)
        {
            GameCtrlXK.GetInstance().FindPlayerTran();
            return;
        }

        if (Time.realtimeSinceStartup - TimeVal < 0.1f)
        {
            return;
        }
        TimeVal = Time.realtimeSinceStartup;

        Vector3 vecA = TriggerTran.position;
        Vector3 vecB = GameCtrlXK.PlayerTran.position;

        vecA.y = vecB.y = 0f;
        float dis = Vector3.Distance(vecA, vecB);

        if (dis <= 50f)
        {
            vecA   = TriggerTran.forward;
            vecB   = TriggerTran.position - GameCtrlXK.PlayerTran.position;
            vecA.y = vecB.y = 0f;
            float cosAB = Vector3.Dot(vecA, vecB);
            if (cosAB <= 0f)
            {
                gameObject.SetActive(false);

                vecA = TriggerTran.position;
                vecB = OutPuBuTran.position;
                float disH = Mathf.Abs(vecA.y - vecB.y);
                vecA.y = vecB.y = 0f;
                float disV     = Vector3.Distance(vecA, vecB);
                float gravity  = -PlayerAutoFire.GravityValMax;
                float timeVal  = Mathf.Sqrt((2f * disH) / gravity);
                float speedVal = timeVal != 0f ? (disV / timeVal) : 50f;
                //Time.timeScale = 1f;
                Time.timeScale = 0.5f;
                CancelInvoke("ResetTimeScale");
                Invoke("ResetTimeScale", 0.5f);
                if (Time.timeScale >= 1f)
                {
                    speedVal = (int)speedVal + 100f;
                }
                else
                {
                    speedVal = (int)speedVal;
                }
                //Debug.Log("player speed = " + speedVal);

                PlayerMvSpeed = speedVal;
                PlayerForward = TriggerTran.forward;
                CameraShake.GetInstance().SetRadialBlurActive(true, CameraShake.BlurStrengthPubu);
                CameraShake.GetInstance().SetActiveCamOtherPoint(true, CamDirPos.FIRST, null);
                GameCtrlXK.GetInstance().SetPlayerBoxColliderState(true);
                AudioListCtrl.PlayAudio(AudioListCtrl.GetInstance().AudioPuBuJiaSu);

                IsIntoPuBu = true;
                MvCount    = 0;
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        ChuanShenScript  = GetComponentInChildren <ChuanShenCtrl>();
        ZhuJiaoNanScript = GetComponentInChildren <ZhuJiaoNan>();

        netView = GetComponent <NetworkView>();
        if (AimMarkDataScript == null)
        {
            AimMarkDataScript = gameObject.AddComponent <PlayerAimMarkData>();
        }

        PlayerObj          = gameObject;
        PlayerTran         = transform;
        RigObj             = GetComponent <Rigidbody>();
        RigObj.isKinematic = true;

        SetRankPlayerArray();

        mGameTime = 1000;
        CreatePlayerNeedObj();

        AiPathCtrlTran = GameCtrlXK.GetInstance().AiPathCtrlTran.GetChild(0);
        AimMarkTran    = AiPathCtrlTran.GetChild(0);
        if (AimMarkTran != null)
        {
            AiMark     markAimScript = AimMarkTran.GetComponent <AiMark>();
            AiPathCtrl pathScript    = AiPathCtrlTran.GetComponent <AiPathCtrl>();
            SetPlayerAimMarkData(pathScript.PathIndex, markAimScript.getMarkCount(), PlayerTran.name);
        }

        mBakeTimePointPos  = AimMarkTran.position;
        mBakeTimePointPos += Vector3.up * 0.5f;
        mBakeTimePointRot  = AimMarkTran.forward;

        if (GameCtrlXK.GetInstance().PlayerMarkTest != null)
        {
            AiPathCtrlTran = GameCtrlXK.GetInstance().PlayerMarkTest.parent;
            AiMark markScript = GameCtrlXK.GetInstance().PlayerMarkTest.GetComponent <AiMark>();
            AimMarkTran = markScript.mNextMark;
            if (AimMarkTran != null)
            {
                AiMark     markAimScript = AimMarkTran.GetComponent <AiMark>();
                AiPathCtrl pathScript    = AiPathCtrlTran.GetComponent <AiPathCtrl>();
                SetPlayerAimMarkData(pathScript.PathIndex, markAimScript.getMarkCount(), PlayerTran.name);
            }
            TestPosCount++;

            Transform posTran = GameCtrlXK.GetInstance().PlayerMarkTest;
            mBakeTimePointRot   = posTran.forward;
            mBakeTimePointRot.y = 0f;
            switch (TestPosCount)
            {
            case 1:
                mBakeTimePointPos = posTran.position - posTran.right * 9f + mBakeTimePointRot;
                break;

            case 2:
                mBakeTimePointPos = posTran.position + posTran.right * 9f + mBakeTimePointRot;
                break;

            case 3:
                mBakeTimePointPos = posTran.position - posTran.right * 6f + mBakeTimePointRot * 4f;
                break;

            case 4:
                mBakeTimePointPos = posTran.position + posTran.right * 6f + mBakeTimePointRot * 4f;
                break;

            case 5:
                mBakeTimePointPos = posTran.position - posTran.right * 3f + mBakeTimePointRot * 7f;
                break;

            case 6:
                mBakeTimePointPos = posTran.position + posTran.right * 3f + mBakeTimePointRot * 7f;
                break;

            case 7:
                mBakeTimePointPos = posTran.position + mBakeTimePointRot * 10f;
                TestPosCount      = 0;
                break;
            }
            mBakeTimePointPos  += Vector3.up * 0.5f;
            PlayerTran.position = mBakeTimePointPos;
            PlayerTran.forward  = mBakeTimePointRot;
        }
    }
 void SendOtherLinkerShowAllCamera()
 {
     NetworkRpcMsgCtrl.MaxLinkServerCount = 100;
     GameCtrlXK.GetInstance().ShowAllCameras();
 }