void GetInput() { float steerTmp = 0f; if (mGameTime > 0) { steerTmp = pcvr.mGetSteer; } else { MouseDownCountP_1 = 0f; MouseDownCountP_2 = 0f; } //Debug.Log("MouseDownCountP_1 " + MouseDownCountP_1 + ", MouseDownCountP_2 " + MouseDownCountP_2); if (IsActiveBingLu) { steerTmp *= 3f; if (steerTmp > 1f) { steerTmp = 1f; } } mSteer = steerTmp; if (Mathf.Abs(mSteer) < 0.1f) { mSteer = 0f; } float rotSpeed = PlayerZhuanXiangVal * mSteer * Time.smoothDeltaTime; if (mSteer > 0f && !IsDonotTurnRight) { if (mSteer - OldSteer > 0f) { mSteerTimeCur += GameCtrlXK.GetInstance().PlayerSteerKey *maxSteerTime; if (mSteerTimeCur > maxSteerTime) { mSteerTimeCur = maxSteerTime; } } else if (mSteer - OldSteer < 0f) { mSteerTimeCur -= GameCtrlXK.GetInstance().PlayerSteerKey *maxSteerTime; if (mSteerTimeCur < 0f) { mSteerTimeCur = 0f; } } OldSteer = mSteer; if (TengManInfoCtrl.GetInstance().GetIsActiveTengManInfo()) { PlayerTran.Rotate(0, -rotSpeed, 0); } else { PlayerTran.Rotate(0, rotSpeed, 0); } bIsTurnLeft = false; if (!bIsTurnRight) { bIsTurnRight = true; PlayerAutoFire.ActiveIsTurnRight(); if (mSpeed > 15f && !pcvr.IsPlayerHitShake) { pcvr.OpenQiNangZuo(); pcvr.CloseQiNangYou(); } } if (Mathf.Abs(mSteer) < 0.4f) { bIsTurnRight = false; if (!pcvr.IsPlayerHitShake) { pcvr.CloseQiNangZuo(); } } } else if (mSteer < 0f && !IsDonotTurnLeft) { if (mSteer - OldSteer > 0f) { mSteerTimeCur += GameCtrlXK.GetInstance().PlayerSteerKey *maxSteerTime; if (mSteerTimeCur > 0f) { mSteerTimeCur = 0f; } } else if (mSteer - OldSteer < 0f) { mSteerTimeCur -= GameCtrlXK.GetInstance().PlayerSteerKey *maxSteerTime; if (mSteerTimeCur < -maxSteerTime) { mSteerTimeCur = -maxSteerTime; } } OldSteer = mSteer; if (TengManInfoCtrl.GetInstance().GetIsActiveTengManInfo()) { PlayerTran.Rotate(0, -rotSpeed, 0); } else { PlayerTran.Rotate(0, rotSpeed, 0); } bIsTurnRight = false; if (!bIsTurnLeft) { bIsTurnLeft = true; PlayerAutoFire.ActiveIsTurnLeft(); if (mSpeed > 15f && !pcvr.IsPlayerHitShake) { pcvr.OpenQiNangYou(); pcvr.CloseQiNangZuo(); } } if (Mathf.Abs(mSteer) < 0.4f) { bIsTurnLeft = false; if (!pcvr.IsPlayerHitShake) { pcvr.CloseQiNangYou(); } } } else { OldSteer = 0f; mSteerTimeCur = 0f; PlayerAutoFire.ResetIsTurn(); bIsTurnLeft = false; bIsTurnRight = false; } ChuanShenScript.UpdateChuanShenAction(bIsTurnLeft, bIsTurnRight); ZhuJiaoNanScript.UpdateZhuJiaoNanAction(bIsTurnLeft, bIsTurnRight); float maxAngle = 15f; Vector3 rotationA = PlayerTran.localEulerAngles; if (AutoFireScript.CheckPlayerDownIsHit()) { rotationA = PlayerTran.localEulerAngles; } float angleZ = -(mSteerTimeCur * maxAngle) / maxSteerTime; if (angleZ < -maxAngle) { angleZ = -maxAngle; } else if (angleZ > maxAngle) { angleZ = maxAngle; } rotationA.z = angleZ; if (CartoonShootPlayerCtrl.IsActiveRunPlayer) { return; } PlayerTran.localEulerAngles = rotationA; }