some old sounds are added
This commit is contained in:
@@ -2,6 +2,8 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
|
||||
using static MouseLook;
|
||||
|
||||
public class CarDrivingRoutine : MonoBehaviour
|
||||
@@ -23,10 +25,21 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
public List<GameObject> FrontTires;
|
||||
public List<GameObject> BackTires;
|
||||
|
||||
|
||||
private EventInstance CarMovement;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
CarMovement = AudioManager.Instance.CreateInstance(FMODEvents.Instance.BoltCarSimpleDriving); //initialising the variable
|
||||
CarMovement.setParameterByName("EasyBoltLogic", 0); //"Driving - 0 in FMOD"
|
||||
CarMovement.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); //setting 3d attributes
|
||||
}
|
||||
private void Start()
|
||||
{
|
||||
targetSpeed = StraightSpeed;
|
||||
targetRotationSpeed = rotationSpeed;
|
||||
|
||||
CarMovement.start(); //starting the car sound here
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@@ -73,6 +86,8 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
// Proceed to the next waypoint
|
||||
_waypoint = _waypoint.Next;
|
||||
}
|
||||
|
||||
CarMovement.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject)); //updating the attributes
|
||||
}
|
||||
|
||||
private void rollTires()
|
||||
@@ -106,6 +121,9 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed)); // Smoothly halt in 1 second
|
||||
_tireSound.Stop();
|
||||
_stopSound.Play();
|
||||
|
||||
CarMovement.setParameterByName("EasyBoltLogic", 1);
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -114,6 +132,9 @@ public class CarDrivingRoutine : MonoBehaviour
|
||||
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed)); // Smoothly resume speed in 1 second
|
||||
_stopSound.Stop();
|
||||
_tireSound.Play();
|
||||
|
||||
CarMovement.setParameterByName("EasyBoltLogic", 0);
|
||||
CarMovement.start();
|
||||
}
|
||||
|
||||
private IEnumerator SmoothAdjustSpeed(float targetStraightSpeed, float targetRotationSpeed, float duration)
|
||||
|
||||
@@ -37,6 +37,8 @@ public class PassangerSeat : LocomotionProvider
|
||||
|
||||
Vector3 cameraShift = cameraTransform.localPosition;
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorOpen, gameObject);
|
||||
|
||||
currentPassanger = player;
|
||||
player.transform.SetParent(this.transform);
|
||||
player.transform.localPosition = -cameraShift;
|
||||
@@ -75,7 +77,9 @@ public class PassangerSeat : LocomotionProvider
|
||||
|
||||
Transform cameraTransform = cameraChild.transform.parent.transform;
|
||||
|
||||
// Set the player<65>s parent to null (making it part of the scene hierarchy)
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.DoorClose, gameObject);
|
||||
|
||||
// Set the player<65>s parent to null (making it part of the scene hierarchy)
|
||||
currentPassanger.transform.SetParent(null);
|
||||
|
||||
// Put the player outside;
|
||||
|
||||
Reference in New Issue
Block a user