Сохранение версии, так как сейчас пойдёт редактирование камеры
This commit is contained in:
parent
50ec58d9a8
commit
ce43ecdef8
27
Assets/CameraObjec.cs
Normal file
27
Assets/CameraObjec.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
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<Rigidbody>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
11
Assets/CameraObjec.cs.meta
Normal file
11
Assets/CameraObjec.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6482ad70cbb280a41b1911ed2b71f491
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Binary file not shown.
@ -110,7 +110,7 @@ public class DriftScore : MonoBehaviour
|
|||||||
|
|
||||||
void ManageUI()
|
void ManageUI()
|
||||||
{
|
{
|
||||||
totalScoreText.text = "Ðåêîðä: " + (totalScore).ToString("###,###,000");
|
totalScoreText.text = "Ðåêîðä: " + (totalScore).ToString("###,###, ##0");
|
||||||
factorText.text = driftFactor.ToString("###,###,##0.0") + "X";
|
factorText.text = driftFactor.ToString("###,###,##0.0") + "X";
|
||||||
currentScoreText.text = currentScore.ToString("###,###,000");
|
currentScoreText.text = currentScore.ToString("###,###,000");
|
||||||
driftAngleText.text = driftAngle.ToString("###,##0");
|
driftAngleText.text = driftAngle.ToString("###,##0");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user