meta xr, auto fix, occlusion additions
This commit is contained in:
Binary file not shown.
BIN
Assets/Plugins/FMOD/platforms/win/lib/x86_64/MetaLogo.png
LFS
Normal file
BIN
Assets/Plugins/FMOD/platforms/win/lib/x86_64/MetaLogo.png
LFS
Normal file
Binary file not shown.
124
Assets/Plugins/FMOD/platforms/win/lib/x86_64/MetaLogo.png.meta
Normal file
124
Assets/Plugins/FMOD/platforms/win/lib/x86_64/MetaLogo.png.meta
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0a872fd50be2db447a17fb4bc7ae6e6f
|
||||||
|
TextureImporter:
|
||||||
|
internalIDToNameTable: []
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 12
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
sRGBTexture: 1
|
||||||
|
linearTexture: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapsPreserveCoverage: 0
|
||||||
|
alphaTestReferenceValue: 0.5
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
flipGreenChannel: 0
|
||||||
|
isReadable: 0
|
||||||
|
streamingMipmaps: 0
|
||||||
|
streamingMipmapsPriority: 0
|
||||||
|
vTOnly: 0
|
||||||
|
ignoreMipmapLimit: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: 1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
filterMode: 1
|
||||||
|
aniso: 1
|
||||||
|
mipBias: 0
|
||||||
|
wrapU: 0
|
||||||
|
wrapV: 0
|
||||||
|
wrapW: 0
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
|
alphaUsage: 1
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
spriteTessellationDetail: -1
|
||||||
|
textureType: 0
|
||||||
|
textureShape: 1
|
||||||
|
singleChannelComponent: 0
|
||||||
|
flipbookRows: 1
|
||||||
|
flipbookColumns: 1
|
||||||
|
maxTextureSizeSet: 0
|
||||||
|
compressionQualitySet: 0
|
||||||
|
textureFormatSet: 0
|
||||||
|
ignorePngGamma: 0
|
||||||
|
applyGammaDecoding: 0
|
||||||
|
swizzle: 50462976
|
||||||
|
cookieLightType: 0
|
||||||
|
platformSettings:
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: DefaultTexturePlatform
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Standalone
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: Server
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
spriteSheet:
|
||||||
|
serializedVersion: 2
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
physicsShape: []
|
||||||
|
bones: []
|
||||||
|
spriteID:
|
||||||
|
internalID: 0
|
||||||
|
vertices: []
|
||||||
|
indices:
|
||||||
|
edges: []
|
||||||
|
weights: []
|
||||||
|
secondaryTextures: []
|
||||||
|
nameFileIdTable: {}
|
||||||
|
mipmapLimitGroupName:
|
||||||
|
pSDRemoveMatte: 0
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Plugins/FMOD/platforms/win/lib/x86_64/MetaXRAudioFMOD.dll
LFS
Normal file
BIN
Assets/Plugins/FMOD/platforms/win/lib/x86_64/MetaXRAudioFMOD.dll
LFS
Normal file
Binary file not shown.
@@ -0,0 +1,27 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 99296f87424cb724baddf545125501a2
|
||||||
|
PluginImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
defineConstraints: []
|
||||||
|
isPreloaded: 0
|
||||||
|
isOverridable: 0
|
||||||
|
isExplicitlyReferenced: 0
|
||||||
|
validateReferences: 1
|
||||||
|
platformData:
|
||||||
|
- first:
|
||||||
|
Any:
|
||||||
|
second:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
- first:
|
||||||
|
Editor: Editor
|
||||||
|
second:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,227 @@
|
|||||||
|
studio.plugins.registerPluginDescription("MetaXRAudio Spatializer", {
|
||||||
|
companyName: "Meta",
|
||||||
|
productName: "MetaXRAudio Source",
|
||||||
|
parameters: {
|
||||||
|
"Acoustics": { displayName: "Enable Acoustics" },
|
||||||
|
"Reverb Send": { displayName: "Reverb Send" },
|
||||||
|
"HRTF Intensity": { displayName: "HRTF Intensity" },
|
||||||
|
"V. Radius": { displayName: "Volumetric Radius" },
|
||||||
|
"Refl. Send": { displayName: "Early Reflections Send" },
|
||||||
|
"Directivity": { displayName: "Directivity Pattern", enumeration: ["None", "Human Voice"], },
|
||||||
|
"Dtv. Intensity": { displayName: "Directivity Intensity" },
|
||||||
|
"Direct Enabled": { displayName: "Direct Enabled" },
|
||||||
|
"Reverb Reach": { displayName: "Reverb Reach" },
|
||||||
|
"Occl. Intensity": { displayName: "Occlusion Intensity" },
|
||||||
|
"Medium Absrp.": { displayName: "Medium Absorption" },
|
||||||
|
},
|
||||||
|
|
||||||
|
deckUi: {
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.HBoxLayout,
|
||||||
|
spacing: 8,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.HBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 6 },
|
||||||
|
spacing: 2,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.GridLayout,
|
||||||
|
contentsMargins: { left: 6, right: 6 },
|
||||||
|
spacing: 2,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.DistanceRolloffGraph,
|
||||||
|
row: 0,
|
||||||
|
column: 0,
|
||||||
|
columnSpan: 2,
|
||||||
|
minimumDistanceBinding: 'Atten. Min',
|
||||||
|
maximumDistanceBinding: 'Atten. Max',
|
||||||
|
rolloffTypeBinding: 'Atten. Mode',
|
||||||
|
rolloffTypes: {
|
||||||
|
0: studio.project.distanceRolloffType.LinearSquared,
|
||||||
|
1: studio.project.distanceRolloffType.Linear,
|
||||||
|
2: studio.project.distanceRolloffType.Inverse,
|
||||||
|
3: studio.project.distanceRolloffType.InverseTapered,
|
||||||
|
4: studio.project.distanceRolloffType.Custom,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Button,
|
||||||
|
binding: "Acoustics",
|
||||||
|
row: 1,
|
||||||
|
column: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial,
|
||||||
|
binding: "Reverb Send",
|
||||||
|
row: 1,
|
||||||
|
column: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.HBoxLayout,
|
||||||
|
contentsMargins: { left: 0, right: 14 },
|
||||||
|
isFramed: true,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 10 },
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Label,
|
||||||
|
text: "Experimental Controls:",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Pixmap,
|
||||||
|
filePath: __dirname + "/MetaLogo.png",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dropdown, binding: "Directivity",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 10 },
|
||||||
|
spacing: 14,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "Dtv. Intensity",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Button, binding: "Medium Absrp.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.GridLayout,
|
||||||
|
contentsMargins: { left: 30, right: 30 },
|
||||||
|
spacing: 14,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "Refl. Send",
|
||||||
|
row: 0,
|
||||||
|
column: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "V. Radius",
|
||||||
|
row: 1,
|
||||||
|
column: 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 10 },
|
||||||
|
spacing: 14,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "HRTF Intensity",
|
||||||
|
row: 1,
|
||||||
|
column: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Button, binding: "Direct Enabled",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 10 },
|
||||||
|
spacing: 14,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "Reverb Reach",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "Occl. Intensity",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.OutputMeter, },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
studio.plugins.registerPluginDescription("MetaXRAudio Ambisonics", {
|
||||||
|
companyName: "Meta",
|
||||||
|
productName: "MetaXRAudio Ambisonics",
|
||||||
|
parameters: {},
|
||||||
|
|
||||||
|
deckUi: {
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 6, top: 6 },
|
||||||
|
spacing: 40,
|
||||||
|
items: [
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.Pixmap, filePath: __dirname + "/MetaLogo.png", },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
studio.plugins.registerPluginDescription("MetaXRAudio Reflections", {
|
||||||
|
companyName: "Meta",
|
||||||
|
productName: "MetaXRAudio Reflections",
|
||||||
|
parameters: {
|
||||||
|
"Early Refl.": { displayName: "Early Reflections Enabled" },
|
||||||
|
"Reverb Enabled": { displayName: "Reverb Enabled" },
|
||||||
|
"Reverb Level": { displayName: "Reverb Level" },
|
||||||
|
"Voice Limit": { displayName: "Voice Limit" },
|
||||||
|
},
|
||||||
|
|
||||||
|
deckUi: {
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.HBoxLayout,
|
||||||
|
contentsMargins: { left: 6, right: 6 },
|
||||||
|
spacing: 12,
|
||||||
|
items: [
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.Pixmap, filePath: __dirname + "/MetaLogo.png" },
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.HBoxLayout,
|
||||||
|
contentsMargins: { left: 0, right: 14 },
|
||||||
|
spacing: 8,
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 0, right: 20 },
|
||||||
|
spacing: 14,
|
||||||
|
items: [
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.Button, binding: "Early Refl.", },
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.Button, binding: "Reverb Enabled", },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
deckWidgetType: studio.ui.deckWidgetType.Layout,
|
||||||
|
layout: studio.ui.layoutType.VBoxLayout,
|
||||||
|
contentsMargins: { left: 0, right: 0 },
|
||||||
|
spacing: 14,
|
||||||
|
items: [
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.Dial, binding: "Reverb Level", },
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.NumberBox, binding: "Voice Limit", },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{ deckWidgetType: studio.ui.deckWidgetType.OutputMeter, },
|
||||||
|
],
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab37959ba9271d444953f8895308ff56
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
8
Assets/Resources.meta
Normal file
8
Assets/Resources.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: cea7bca5f2b0981489443a1ab4b97e7f
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
Assets/Resources/MetaXRAcousticSettings.asset
LFS
Normal file
BIN
Assets/Resources/MetaXRAcousticSettings.asset
LFS
Normal file
Binary file not shown.
8
Assets/Resources/MetaXRAcousticSettings.asset.meta
Normal file
8
Assets/Resources/MetaXRAcousticSettings.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2af207a59ff0c77449a495a5ff852a9f
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -24,6 +24,9 @@ public class CarDrivingRoutine : NetworkBehaviour
|
|||||||
private bool stopSoundPlayed = false;
|
private bool stopSoundPlayed = false;
|
||||||
private float stopThreshold = 0.05f; // consider speed "0" when below this
|
private float stopThreshold = 0.05f; // consider speed "0" when below this
|
||||||
|
|
||||||
|
private bool isBeingStoppedByPlayer = false;
|
||||||
|
|
||||||
|
|
||||||
[Header("Tires")]
|
[Header("Tires")]
|
||||||
public List<GameObject> FrontTires;
|
public List<GameObject> FrontTires;
|
||||||
public List<GameObject> BackTires;
|
public List<GameObject> BackTires;
|
||||||
@@ -54,26 +57,27 @@ public class CarDrivingRoutine : NetworkBehaviour
|
|||||||
|
|
||||||
rollTires(); // Just an aesthetic improvement.
|
rollTires(); // Just an aesthetic improvement.
|
||||||
|
|
||||||
if (Quaternion.Angle(transform.rotation, desiredRotation) > 1f) // If the car is turning.
|
if (!isBeingStoppedByPlayer)
|
||||||
|
{
|
||||||
|
if (Quaternion.Angle(transform.rotation, desiredRotation) > 1f)
|
||||||
{
|
{
|
||||||
if (!isTurning)
|
if (!isTurning)
|
||||||
{
|
{
|
||||||
AudioController.SetRPM(1300); //set externally in CarAudioController.cs
|
|
||||||
setTireRotation(tireTurnAngle);
|
setTireRotation(tireTurnAngle);
|
||||||
|
AudioController.SetRPM(1300);
|
||||||
}
|
}
|
||||||
|
|
||||||
isTurning = true;
|
isTurning = true;
|
||||||
}
|
}
|
||||||
if (Quaternion.Angle(transform.rotation, desiredRotation) <= 1f) // Reset the turn value.
|
else
|
||||||
{
|
{
|
||||||
if (isTurning)
|
if (isTurning)
|
||||||
{
|
{
|
||||||
AudioController.SetRPM(1450);
|
|
||||||
setTireRotation(-tireTurnAngle);
|
setTireRotation(-tireTurnAngle);
|
||||||
|
AudioController.SetRPM(1450);
|
||||||
}
|
}
|
||||||
|
|
||||||
isTurning = false;
|
isTurning = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if close enough to the waypoint
|
// Check if close enough to the waypoint
|
||||||
if (Vector3.Distance(transform.position, targetPosition) <= waypointProximityThreshold &&
|
if (Vector3.Distance(transform.position, targetPosition) <= waypointProximityThreshold &&
|
||||||
@@ -84,13 +88,15 @@ public class CarDrivingRoutine : NetworkBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (StraightSpeed <= stopThreshold && !stopSoundPlayed)
|
if (StraightSpeed <= stopThreshold && !stopSoundPlayed)
|
||||||
|
{
|
||||||
|
float currentRPM = AudioController.GetCurrentRPM();
|
||||||
|
//Debug.LogError(currentRPM);
|
||||||
|
if (currentRPM <= 550f) // confirms we are in the correct engine state
|
||||||
{
|
{
|
||||||
stopSoundPlayed = true;
|
stopSoundPlayed = true;
|
||||||
|
|
||||||
// Play the sound normally from your audio controller
|
|
||||||
//AudioController.SetRPM(475);
|
|
||||||
AudioController.PlayStopSound();
|
AudioController.PlayStopSound();
|
||||||
|
//Debug.LogError("piiks");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,29 +126,29 @@ public class CarDrivingRoutine : NetworkBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void OnTriggerEnter(Collider other)
|
private void OnTriggerEnter(Collider other)
|
||||||
{;
|
{
|
||||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||||
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed)); // Smoothly halt in 1 second
|
|
||||||
//_tireSound.Stop();
|
isBeingStoppedByPlayer = true;
|
||||||
//_stopSound.Play();
|
|
||||||
|
StartCoroutine(SmoothAdjustSpeed(0, 0, haltspeed));
|
||||||
|
|
||||||
AudioController.SetRPM(475);
|
AudioController.SetRPM(475);
|
||||||
//AudioController.PlayStopSound();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTriggerExit(Collider other)
|
private void OnTriggerExit(Collider other)
|
||||||
{
|
{
|
||||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||||
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed)); // Smoothly resume speed in 1 second
|
|
||||||
//_stopSound.Stop();
|
isBeingStoppedByPlayer = false;
|
||||||
//_tireSound.Play();
|
|
||||||
|
StartCoroutine(SmoothAdjustSpeed(targetSpeed, targetRotationSpeed, haltspeed));
|
||||||
|
|
||||||
AudioController.SetRPM(1450);
|
AudioController.SetRPM(1450);
|
||||||
stopSoundPlayed = false;
|
stopSoundPlayed = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private IEnumerator SmoothAdjustSpeed(float targetStraightSpeed, float targetRotationSpeed, float duration)
|
private IEnumerator SmoothAdjustSpeed(float targetStraightSpeed, float targetRotationSpeed, float duration)
|
||||||
{
|
{
|
||||||
float initialStraightSpeed = StraightSpeed;
|
float initialStraightSpeed = StraightSpeed;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using FMOD.Studio;
|
|||||||
public class CarAudioController : MonoBehaviour
|
public class CarAudioController : MonoBehaviour
|
||||||
{
|
{
|
||||||
private EventInstance carMovementInstance;
|
private EventInstance carMovementInstance;
|
||||||
|
private EventInstance carStopInstance;
|
||||||
private FirstPersonOcclusion occlusion;
|
private FirstPersonOcclusion occlusion;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
@@ -15,13 +16,21 @@ public class CarAudioController : MonoBehaviour
|
|||||||
//Debug.LogError("Car Simple Driving:");
|
//Debug.LogError("Car Simple Driving:");
|
||||||
//Debug.LogError(FMODEvents.Instance.BoltCarSimpleDriving);
|
//Debug.LogError(FMODEvents.Instance.BoltCarSimpleDriving);
|
||||||
carMovementInstance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.CarModulatedDriving);
|
carMovementInstance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.CarModulatedDriving);
|
||||||
|
carStopInstance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.BoltCarStopSound);
|
||||||
|
|
||||||
carMovementInstance.setParameterByName("RPM", 1450);
|
carMovementInstance.setParameterByName("RPM", 1450);
|
||||||
carMovementInstance.setParameterByName("Load", 0);
|
carMovementInstance.setParameterByName("Load", 0);
|
||||||
|
|
||||||
carMovementInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
carMovementInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||||
|
carStopInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||||
|
|
||||||
occlusion = GetComponent<FirstPersonOcclusion>();
|
occlusion = GetComponent<FirstPersonOcclusion>();
|
||||||
|
|
||||||
if (occlusion != null)
|
if (occlusion != null)
|
||||||
occlusion.InitialiseWithInstance(carMovementInstance);
|
{
|
||||||
|
occlusion.InitialiseWithInstance(carMovementInstance); // main looping engine sound
|
||||||
|
occlusion.AddInstance(carStopInstance); // additional sound
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
@@ -34,6 +43,7 @@ public class CarAudioController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
// Always update 3D position to follow the car model transform
|
// Always update 3D position to follow the car model transform
|
||||||
carMovementInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
carMovementInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||||
|
carStopInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(gameObject));
|
||||||
}
|
}
|
||||||
|
|
||||||
// These methods are called externally by CarDrivingRoutine
|
// These methods are called externally by CarDrivingRoutine
|
||||||
@@ -44,8 +54,13 @@ public class CarAudioController : MonoBehaviour
|
|||||||
|
|
||||||
public void PlayStopSound()
|
public void PlayStopSound()
|
||||||
{
|
{
|
||||||
|
carStopInstance.start();
|
||||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BoltCarStopSound, gameObject);
|
//AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.BoltCarStopSound, gameObject);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public float GetCurrentRPM()
|
||||||
|
{
|
||||||
|
carMovementInstance.getParameterByName("RPM", out float value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -2,6 +2,7 @@ using UnityEngine;
|
|||||||
using FMODUnity;
|
using FMODUnity;
|
||||||
using FMOD.Studio;
|
using FMOD.Studio;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using System.Collections.Generic; // ADDED
|
||||||
|
|
||||||
public class FirstPersonOcclusion : MonoBehaviour
|
public class FirstPersonOcclusion : MonoBehaviour
|
||||||
{
|
{
|
||||||
@@ -26,6 +27,10 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
|
|
||||||
private bool initialisedExternally = false;
|
private bool initialisedExternally = false;
|
||||||
|
|
||||||
|
// ADDED: now stores ALL event instances that must be occluded
|
||||||
|
private List<EventInstance> managedInstances = new List<EventInstance>();
|
||||||
|
|
||||||
|
|
||||||
public void InitialiseWithInstance(EventInstance instance)
|
public void InitialiseWithInstance(EventInstance instance)
|
||||||
{
|
{
|
||||||
AudioOccluded = instance;
|
AudioOccluded = instance;
|
||||||
@@ -37,9 +42,28 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
GetComponent<Rigidbody>()
|
GetComponent<Rigidbody>()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
managedInstances.Add(AudioOccluded); // ADDED
|
||||||
|
|
||||||
AudioOccluded.getDescription(out AudioDes);
|
AudioOccluded.getDescription(out AudioDes);
|
||||||
AudioDes.getMinMaxDistance(out float min, out MaxDistance);
|
AudioDes.getMinMaxDistance(out float min, out MaxDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ADDED: allows adding extra FMOD instances for occlusion
|
||||||
|
public void AddInstance(EventInstance instance)
|
||||||
|
{
|
||||||
|
if (instance.isValid())
|
||||||
|
{
|
||||||
|
RuntimeManager.AttachInstanceToGameObject(
|
||||||
|
instance,
|
||||||
|
gameObject,
|
||||||
|
GetComponent<Rigidbody>()
|
||||||
|
);
|
||||||
|
|
||||||
|
managedInstances.Add(instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private IEnumerator Start()
|
private IEnumerator Start()
|
||||||
{
|
{
|
||||||
// If already initialised, skip internal creation
|
// If already initialised, skip internal creation
|
||||||
@@ -47,13 +71,18 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
if (!initialisedExternally)
|
if (!initialisedExternally)
|
||||||
{
|
{
|
||||||
AudioOccluded = RuntimeManager.CreateInstance(SelectAudio);
|
AudioOccluded = RuntimeManager.CreateInstance(SelectAudio);
|
||||||
|
|
||||||
// 2. Attaching Instance
|
// 2. Attaching Instance
|
||||||
RuntimeManager.AttachInstanceToGameObject(AudioOccluded, gameObject);
|
RuntimeManager.AttachInstanceToGameObject(AudioOccluded, gameObject);
|
||||||
|
|
||||||
// 3. Starting Audio
|
// 3. Starting Audio
|
||||||
AudioOccluded.start();
|
AudioOccluded.start();
|
||||||
|
|
||||||
// 4. Releasing Instance (This allows the event to self-manage its lifetime, which is fine)
|
// 4. Releasing Instance (This allows the event to self-manage its lifetime, which is fine)
|
||||||
AudioOccluded.release();
|
AudioOccluded.release();
|
||||||
|
|
||||||
|
managedInstances.Add(AudioOccluded); // ADDED
|
||||||
|
|
||||||
// 5. Getting Event Description and Max Distance
|
// 5. Getting Event Description and Max Distance
|
||||||
AudioDes = RuntimeManager.GetEventDescription(SelectAudio);
|
AudioDes = RuntimeManager.GetEventDescription(SelectAudio);
|
||||||
AudioDes.getMinMaxDistance(out float minDistance, out MaxDistance);
|
AudioDes.getMinMaxDistance(out float minDistance, out MaxDistance);
|
||||||
@@ -64,6 +93,7 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
Listener = FindObjectOfType<StudioListener>();
|
Listener = FindObjectOfType<StudioListener>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
{
|
{
|
||||||
if (Listener == null) return;
|
if (Listener == null) return;
|
||||||
@@ -82,6 +112,7 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
lineCastHitCount = 0f;
|
lineCastHitCount = 0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OccludeBetween(Vector3 sound, Vector3 listener)
|
private void OccludeBetween(Vector3 sound, Vector3 listener)
|
||||||
{
|
{
|
||||||
// 9. Calculate Points (Log only a few to avoid clutter)
|
// 9. Calculate Points (Log only a few to avoid clutter)
|
||||||
@@ -117,6 +148,7 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
SetParameter();
|
SetParameter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Vector3 CalculatePoint(Vector3 a, Vector3 b, float m, bool posOrneg)
|
private Vector3 CalculatePoint(Vector3 a, Vector3 b, float m, bool posOrneg)
|
||||||
{
|
{
|
||||||
float n = Vector3.Distance(new Vector3(a.x, 0f, a.z), new Vector3(b.x, 0f, b.z));
|
float n = Vector3.Distance(new Vector3(a.x, 0f, a.z), new Vector3(b.x, 0f, b.z));
|
||||||
@@ -139,9 +171,11 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
return new Vector3(x, a.y, z);
|
return new Vector3(x, a.y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void CastLine(Vector3 Start, Vector3 End)
|
private void CastLine(Vector3 Start, Vector3 End)
|
||||||
{
|
{
|
||||||
RaycastHit hit;
|
RaycastHit hit;
|
||||||
|
|
||||||
// 11. Raycast result
|
// 11. Raycast result
|
||||||
bool isHit = Physics.Linecast(Start, End, out hit, OcclusionLayer);
|
bool isHit = Physics.Linecast(Start, End, out hit, OcclusionLayer);
|
||||||
|
|
||||||
@@ -156,10 +190,18 @@ public class FirstPersonOcclusion : MonoBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void SetParameter()
|
private void SetParameter()
|
||||||
{
|
{
|
||||||
float occlusionValue = lineCastHitCount / 11;
|
float occlusionValue = lineCastHitCount / 11;
|
||||||
|
|
||||||
// 12. Final Parameter Value
|
// 12. Final Parameter Value
|
||||||
AudioOccluded.setParameterByName("Occlusion", occlusionValue);
|
foreach (var inst in managedInstances)
|
||||||
|
{
|
||||||
|
if (inst.isValid())
|
||||||
|
{
|
||||||
|
inst.setParameterByName("Occlusion", occlusionValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
DeltaVRFMOD/.cache/fsbcache/Desktop/5D33D248.fobj
Normal file
BIN
DeltaVRFMOD/.cache/fsbcache/Desktop/5D33D248.fobj
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
DeltaVRFMOD/.cache/fsbcache/Desktop/8C5437C9.fobj
Normal file
BIN
DeltaVRFMOD/.cache/fsbcache/Desktop/8C5437C9.fobj
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
DeltaVRFMOD/.cache/fsbcache/Desktop/9627BD63.fobj
Normal file
BIN
DeltaVRFMOD/.cache/fsbcache/Desktop/9627BD63.fobj
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user