43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
public class LoadDixia : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
|
|
public Transform car;
|
|
public Transform carpos;
|
|
public GameObject obj1;
|
|
public GameObject obj2;
|
|
public GameObject obj3;
|
|
|
|
private void Start()
|
|
{
|
|
// car.GetComponent<UnityStandardAssets.Vehicles.Car.CarUserControl>().enabled = false;
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.JoystickButton10))
|
|
{
|
|
|
|
SceneManager.LoadScene("Parking");
|
|
}
|
|
if (Input.GetKeyDown(KeyCode.JoystickButton6))
|
|
{
|
|
|
|
obj1.SetActive(false);
|
|
obj2.SetActive(false);
|
|
obj3.SetActive(true );
|
|
|
|
car.GetComponent<Rigidbody>().isKinematic = true;
|
|
car.GetComponent<Rigidbody>().isKinematic = false;
|
|
car.transform.position= carpos.transform.position;
|
|
car.transform.rotation = carpos.transform.rotation;
|
|
this.gameObject.SetActive(false);
|
|
// car.GetComponent<UnityStandardAssets.Vehicles.Car.CarUserControl>().enabled = true;
|
|
}
|
|
}
|
|
}
|