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;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Car Customization Camera.cs.meta
Normal file
11
Assets/Scripts/Car Customization Camera.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc607b4c1721b87489346376014622d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
56
Assets/Scripts/Garage.cs
Normal file
56
Assets/Scripts/Garage.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Garage : MonoBehaviour
|
||||
{
|
||||
public Button HotrodButton;
|
||||
public GameObject HotrodGarage;
|
||||
public Button RacecarButton;
|
||||
public GameObject RacecarGarage;
|
||||
public Button FordButton;
|
||||
public GameObject FordGarage;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
HotrodButton.onClick.AddListener(SelectHotrod);
|
||||
RacecarButton.onClick.AddListener(SelectRacecar);
|
||||
FordButton.onClick.AddListener(SelectFord);
|
||||
|
||||
disable();
|
||||
HotrodGarage.SetActive(true);
|
||||
}
|
||||
|
||||
void enable()
|
||||
{
|
||||
HotrodGarage.SetActive(true);
|
||||
RacecarGarage.SetActive(true);
|
||||
FordGarage.SetActive(true);
|
||||
}
|
||||
|
||||
void disable()
|
||||
{
|
||||
HotrodGarage.SetActive(false);
|
||||
RacecarGarage.SetActive(false);
|
||||
FordGarage.SetActive(false);
|
||||
}
|
||||
|
||||
void SelectHotrod()
|
||||
{
|
||||
disable();
|
||||
HotrodGarage.SetActive(true);
|
||||
}
|
||||
|
||||
void SelectRacecar()
|
||||
{
|
||||
disable();
|
||||
RacecarGarage.SetActive(true);
|
||||
}
|
||||
|
||||
void SelectFord()
|
||||
{
|
||||
disable();
|
||||
FordGarage.SetActive(true);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Garage.cs.meta
Normal file
11
Assets/Scripts/Garage.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea7f5c00b75e3d64085fe575137469f8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user