diff --git a/Assets/CameraObjec.cs b/Assets/CameraObjec.cs deleted file mode 100644 index d92832d6..00000000 --- a/Assets/CameraObjec.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class CameraObjec : MonoBehaviour -{ - public Transform player; - private Rigidbody playerRB; - public Vector3 Offset; - public float speed; - // Start is called before the first frame update - void Start() - { - playerRB = player.GetComponent(); - } - - // Update is called once per frame - void FixedUpdate() - { - Vector3 playerForward = (playerRB.velocity + player.transform.forward).normalized; - transform.position = Vector3.Lerp(transform.position, - player.position + player.transform.TransformVector(Offset) - + playerForward * (-5f), - speed * Time.deltaTime); - transform.LookAt(player); - } -} diff --git a/Assets/CameraObjec.cs.meta b/Assets/CameraObjec.cs.meta deleted file mode 100644 index bf7bbc83..00000000 --- a/Assets/CameraObjec.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6482ad70cbb280a41b1911ed2b71f491 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Prefab/Cars/Chellendger_1969_2.prefab b/Assets/Prefab/Cars/Chellendger_1969_2.prefab index ce330560..7d36be9c 100644 Binary files a/Assets/Prefab/Cars/Chellendger_1969_2.prefab and b/Assets/Prefab/Cars/Chellendger_1969_2.prefab differ diff --git a/Assets/Prefab/Cars/Toyota_MR2.prefab b/Assets/Prefab/Cars/Toyota_MR2.prefab index 8a580846..9a33937c 100644 Binary files a/Assets/Prefab/Cars/Toyota_MR2.prefab and b/Assets/Prefab/Cars/Toyota_MR2.prefab differ diff --git a/Assets/Prefab/Timer/vector-ink-circle-border-free-png-png-gallery-pomo_30614_wh860-Photoroom.png-Photoroom.png b/Assets/Prefab/Timer/vector-ink-circle-border-free-png-png-gallery-pomo_30614_wh860-Photoroom.png-Photoroom.png index 994ccb56..521f8503 100644 --- a/Assets/Prefab/Timer/vector-ink-circle-border-free-png-png-gallery-pomo_30614_wh860-Photoroom.png-Photoroom.png +++ b/Assets/Prefab/Timer/vector-ink-circle-border-free-png-png-gallery-pomo_30614_wh860-Photoroom.png-Photoroom.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f11b468d4520b6e89cbe5b37524cc1fc967f14bd2ace5ce4b44990976b4963a2 -size 183567 +oid sha256:da93bf8067fb3d2d9dae4bd74603cceace68dd549981e830b9fc8fa59f975cc4 +size 156434 diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index 55874713..c2bdb186 100644 Binary files a/Assets/Scenes/GameScene.unity and b/Assets/Scenes/GameScene.unity differ diff --git a/Assets/Scripts/Camera/CameraController.cs b/Assets/Scripts/Camera/CameraController.cs index 3cd811b9..1e902e61 100644 --- a/Assets/Scripts/Camera/CameraController.cs +++ b/Assets/Scripts/Camera/CameraController.cs @@ -24,7 +24,6 @@ namespace RootMotion [Header("Position")] public bool smoothFollow; // If > 0, camera will smoothly interpolate towards the target - public Vector3 offset = new Vector3(0, 1.5f, 0.5f); // The offset from target relative to camera rotation public float followSpeed = 10f; // Smooth follow speed [Header("Rotation")] @@ -45,7 +44,6 @@ namespace RootMotion public float blockingRadius = 1f; public float blockingSmoothTime = 0.1f; public float blockingOriginOffset; - [Range(0f, 1f)] public float blockedOffset = 0.5f; public float x { get; private set; } // The current x rotation of the camera public float y { get; private set; } // The current y rotation of the camera @@ -59,7 +57,6 @@ namespace RootMotion private float fixedDeltaTime; private Quaternion r = Quaternion.identity; private Vector3 lastUp; - private float blockedDistance = 10f, blockedDistanceV; //Rotation @@ -79,31 +76,19 @@ namespace RootMotion // Initiate, set the params to the current transformation of the camera relative to the target protected virtual void Awake() { - Vector3 angles = transform.eulerAngles; - x = angles.y; - y = angles.x; + //Vector3 angles = transform.eulerAngles; + //x = angles.y; + //y = angles.x; distanceTarget = distance; smoothPosition = transform.position; cam = GetComponent(); - //_rotate = new Controller(); - //_rotate.Player.CameraRotation.performed += context => UpdateInput(); - - - //lastUp = rotationSpace != null ? rotationSpace.up : Vector3.up; + } - //private void OnEnable() - //{ - // _rotate.Enable(); - //} - - //private void OnDisable() - //{ - // _rotate.Disable(); - //} + protected virtual void Update() { @@ -174,33 +159,11 @@ namespace RootMotion // Distance distance += (distanceTarget - distance) * zoomSpeed * deltaTime; - // Smooth follow - if (!smoothFollow) smoothPosition = target.position; - else smoothPosition = Vector3.Lerp(smoothPosition, target.position, deltaTime * followSpeed); - - // Position - Vector3 t = smoothPosition + rotation * offset; - Vector3 f = rotation * -Vector3.forward; - - if (blockingLayers != -1) - { - RaycastHit hit; - if (Physics.SphereCast(t - f * blockingOriginOffset, blockingRadius, f, out hit, blockingOriginOffset + distanceTarget - blockingRadius, blockingLayers)) - { - blockedDistance = Mathf.SmoothDamp(blockedDistance, hit.distance + blockingRadius * (1f - blockedOffset) - blockingOriginOffset, ref blockedDistanceV, blockingSmoothTime); - } - else blockedDistance = distanceTarget; - - distance = Mathf.Min(distance, blockedDistance); - } - - position = t + f * distance; - - // Translating the camera - transform.position = position; + + } - transform.rotation = rotation; + //transform.rotation = rotation; } // Zoom input diff --git a/Assets/Scripts/UI/DriftScore.cs b/Assets/Scripts/UI/DriftScore.cs index 40a63adf..df179215 100644 --- a/Assets/Scripts/UI/DriftScore.cs +++ b/Assets/Scripts/UI/DriftScore.cs @@ -110,7 +110,7 @@ public class DriftScore : MonoBehaviour void ManageUI() { - totalScoreText.text = "Рекорд: " + (totalScore).ToString("###,###, ##0"); + totalScoreText.text = "Очки: " + (totalScore).ToString("###,###, ##0"); factorText.text = driftFactor.ToString("###,###,##0.0") + "X"; currentScoreText.text = currentScore.ToString("###,###,000"); driftAngleText.text = driftAngle.ToString("###,##0");