started car customization screen
This commit is contained in:
32
Assets/Scripts/Car Customization Camera.cs
Normal file
32
Assets/Scripts/Car Customization Camera.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class CarCustomizationCamera : MonoBehaviour
|
||||
{
|
||||
new Transform transform;
|
||||
public Transform car;
|
||||
public float rotateSpeed;
|
||||
Vector3 startPosition;
|
||||
Quaternion startRotation;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
transform = GetComponent<Transform>();
|
||||
startPosition = transform.position;
|
||||
startRotation = transform.rotation;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
transform.LookAt(car);
|
||||
// transform.Translate(Vector3.right * Time.deltaTime);
|
||||
transform.position += transform.right * Time.deltaTime * rotateSpeed;
|
||||
}
|
||||
|
||||
private void OnEnable() {
|
||||
transform.position = startPosition;
|
||||
transform.rotation = startRotation;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user