26 lines
609 B
C#
26 lines
609 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class CarLoader : MonoBehaviour
|
|
{
|
|
public GameObject Hotrod;
|
|
GameObject playerCar;
|
|
void Start()
|
|
{
|
|
playerCar = GameObject.Find("Car Data").GetComponent<CarData>().playerCar;
|
|
|
|
replaceCar(Hotrod);
|
|
|
|
}
|
|
|
|
void replaceCar(GameObject car)
|
|
{
|
|
Transform carTransform = car.transform;
|
|
|
|
playerCar.transform.position = carTransform.position;
|
|
playerCar.transform.rotation = carTransform.rotation;
|
|
playerCar.transform.localScale = carTransform.localScale;
|
|
}
|
|
}
|