void DelaySetIsKinematic() { Rigidbody rigObj = GetComponent <Rigidbody>(); rigObj.isKinematic = true; ChuanLunZiCtrl lunZiScript = GetComponentInChildren <ChuanLunZiCtrl>(); if (lunZiScript != null) { lunZiScript.CloseLunZiAction(); } }
// Use this for initialization void Start() { _Instance = this; pcvr.DongGanState = 1; PlayerZhuanXiangVal = GameCtrlXK.PlayerZhuanXiangPTVal; if (IsTestShootCartoon) { return; } if (HuanYingFuObj == null) { Debug.LogError("HuanYingFuObj is null"); HuanYingFuObj.name = "null"; } else { HuanYingFuObj.SetActive(false); } PlayerTran = transform; rigObj = GetComponent <Rigidbody>(); if (GetComponent <Animator>() != null) { Debug.LogWarning("Player Animator should be remove"); PlayerTran = null; PlayerTran.name = "null"; } AutoFireScript = GetComponent <PlayerAutoFire>(); ScreenWaterParticle.gameObject.SetActive(false); ChuanShenScript = GetComponentInChildren <ChuanShenCtrl>(); ChuanLunZiScript = GetComponentInChildren <ChuanLunZiCtrl>(); ZhuJiaoNanScript = GetComponentInChildren <ZhuJiaoNan>(); mGameTime = 1000; SetCamAimInfo(); CreatePlayerNeedObj(); AiPathCtrlTran = GameCtrlXK.GetInstance().AiPathCtrlTran.GetChild(0); AutoFireScript.SetPathKeyState(AiPathCtrlTran.GetComponent <AiPathCtrl>()); AimMarkTran = AiPathCtrlTran.GetChild(0); mBakeTimePointPos = AimMarkTran.position; mBakeTimePointRot = AimMarkTran.forward; AutoFireScript.SetPlayerPreMark(AimMarkTran); CreateFlyNpcAimCube(); if (GameCtrlXK.GetInstance().PlayerMarkTest != null) { AiPathCtrlTran = GameCtrlXK.GetInstance().PlayerMarkTest.parent; AutoFireScript.SetPathKeyState(AiPathCtrlTran.GetComponent <AiPathCtrl>()); AimMarkTran = GameCtrlXK.GetInstance().PlayerMarkTest; mBakeTimePointPos = AimMarkTran.position; mBakeTimePointRot = AimMarkTran.forward; AutoFireScript.SetPlayerPreMark(AimMarkTran); PlayerTran.position = mBakeTimePointPos; PlayerTran.forward = mBakeTimePointRot; } }