Finished up improving static object colliders. Added network improvements to interactions, still half-baked.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
using FishNet.Object;
|
||||
using FMOD.Studio;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
|
||||
using static MouseLook;
|
||||
|
||||
public class CarDrivingRoutine : MonoBehaviour
|
||||
public class CarDrivingRoutine : NetworkBehaviour
|
||||
{
|
||||
public AudioSource _stopSound;
|
||||
public AudioSource _tireSound;
|
||||
@@ -124,7 +124,7 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{;
|
||||
if (other.GetComponent<XROrigin>() == null) return;
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed)); // Smoothly halt in 1 second
|
||||
_tireSound.Stop();
|
||||
_stopSound.Play();
|
||||
@@ -135,7 +135,7 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
if (other.GetComponent<XROrigin>() == null) return;
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed)); // Smoothly resume speed in 1 second
|
||||
_stopSound.Stop();
|
||||
_tireSound.Play();
|
||||
|
||||
Reference in New Issue
Block a user