public float RespawnCar()
    {
        StartCoroutine(RespawnSetKinematic());
        StartCoroutine(RespawnSetIsRespawning());

        RespawnCheckpoint respawnCheckpoint = GetComponent <Player>().lastRespawnCheckpoint;
        float             yaw = respawnCheckpoint.transform.rotation.eulerAngles.y;

        transform.DOMove(respawnCheckpoint.transform.position, fallRespawnTime);
        // transform.DOLocalRotate(new Vector3(0.0f, yaw, 0.0f), fallRespawnTime);
        transform.DOLocalRotateQuaternion(Quaternion.Euler(0.0f, yaw, 0.0f), fallRespawnTime);

        return(fallRespawnTime);
    }
Пример #2
0
 public void PassedRespawnCheckpoint(RespawnCheckpoint checkpoint)
 {
     lastRespawnCheckpoint = checkpoint;
 }
Пример #3
0
 // Start is called before the first frame update
 void Start()
 {
     _respawnCheckpoint = startingRespawn.GetComponent <RespawnCheckpoint>();
 }