diff --git a/Assets/Editor Default Resources.meta b/Assets/Editor Default Resources.meta new file mode 100644 index 0000000..5bd64c9 --- /dev/null +++ b/Assets/Editor Default Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d93fe6b043643843915980a6ed75c49 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD.meta b/Assets/Editor Default Resources/FMOD.meta new file mode 100644 index 0000000..c6fa978 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0098ee476320b9141b1c92a2ddc5f9fa +folderAsset: yes +timeCreated: 1447698325 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/AddIcon.png b/Assets/Editor Default Resources/FMOD/AddIcon.png new file mode 100644 index 0000000..62d6e58 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/AddIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:860e3a60f97b4f9961eda80617e922ceffeb67aa145077ba0599863ca306a467 +size 380 diff --git a/Assets/Editor Default Resources/FMOD/AddIcon.png.meta b/Assets/Editor Default Resources/FMOD/AddIcon.png.meta new file mode 100644 index 0000000..87abf7b --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/AddIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 3300e81f02e64924eb7cb7782713b126 +timeCreated: 1455151837 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/ArrowDown.png b/Assets/Editor Default Resources/FMOD/ArrowDown.png new file mode 100644 index 0000000..9dbaac7 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/ArrowDown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9e31ec900dc41ae904e18080e63cd3056c7a6fd1c2ce44d83e54155e06e6a4b +size 236 diff --git a/Assets/Editor Default Resources/FMOD/ArrowDown.png.meta b/Assets/Editor Default Resources/FMOD/ArrowDown.png.meta new file mode 100644 index 0000000..90ebe28 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/ArrowDown.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: d5400a23002b107479debec613434ad6 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/ArrowIcon.png b/Assets/Editor Default Resources/FMOD/ArrowIcon.png new file mode 100644 index 0000000..d618441 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/ArrowIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ad41545295b579cf3d262f069c5b9ec48b03bd5a1f64a465b7af44272f66cb7 +size 292 diff --git a/Assets/Editor Default Resources/FMOD/ArrowIcon.png.meta b/Assets/Editor Default Resources/FMOD/ArrowIcon.png.meta new file mode 100644 index 0000000..8f97b20 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/ArrowIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 01c0101f357b9da4ba78b8f58c290f86 +timeCreated: 1455161898 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/ArrowUp.png b/Assets/Editor Default Resources/FMOD/ArrowUp.png new file mode 100644 index 0000000..9b6c4a8 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/ArrowUp.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fc5383250bed6ec513be8612f5fdad476dd10a78eac0b103b5d617682d63a30 +size 291 diff --git a/Assets/Editor Default Resources/FMOD/ArrowUp.png.meta b/Assets/Editor Default Resources/FMOD/ArrowUp.png.meta new file mode 100644 index 0000000..89d6f69 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/ArrowUp.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 82ff72577988cdb4a95bd92f1d0bc129 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 7 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + 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 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: -1 + nPOTScale: 0 + 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: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: PS4 + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Windows Store Apps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/BankIcon.png b/Assets/Editor Default Resources/FMOD/BankIcon.png new file mode 100644 index 0000000..2de820b --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/BankIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:057c16f44a3725bb4228401150c905b384ce1e1dfde6902ab074b8405c05b7c7 +size 3699 diff --git a/Assets/Editor Default Resources/FMOD/BankIcon.png.meta b/Assets/Editor Default Resources/FMOD/BankIcon.png.meta new file mode 100644 index 0000000..f6396d7 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/BankIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a7e06068a7215854a84bf5ed8280ed15 +timeCreated: 1433208188 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/Border.png b/Assets/Editor Default Resources/FMOD/Border.png new file mode 100644 index 0000000..4d9969e --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/Border.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe700034ded2e2586d707689971698310ce5964018d1a774fb6c6ed9f9060d27 +size 179 diff --git a/Assets/Editor Default Resources/FMOD/Border.png.meta b/Assets/Editor Default Resources/FMOD/Border.png.meta new file mode 100644 index 0000000..77553fe --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/Border.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 40848578d1961334d820821bec6175a4 +timeCreated: 1455150446 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/BrowserIcon.png b/Assets/Editor Default Resources/FMOD/BrowserIcon.png new file mode 100644 index 0000000..6e0acd4 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/BrowserIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e45e42c47b7bf4214d50dcdca6ee7c7b47cce163eb948f8ffcdbf99837fe504c +size 3194 diff --git a/Assets/Editor Default Resources/FMOD/BrowserIcon.png.meta b/Assets/Editor Default Resources/FMOD/BrowserIcon.png.meta new file mode 100644 index 0000000..9bcd7f0 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/BrowserIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: c783b763d12874147876e070661b66ab +timeCreated: 1455688158 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/CopyIcon.png b/Assets/Editor Default Resources/FMOD/CopyIcon.png new file mode 100644 index 0000000..41013f2 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/CopyIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2b04ee62fd5d8072051bce97cf0edb1465ed43e71ac14485869297157ea05a9 +size 552 diff --git a/Assets/Editor Default Resources/FMOD/CopyIcon.png.meta b/Assets/Editor Default Resources/FMOD/CopyIcon.png.meta new file mode 100644 index 0000000..62cfdfd --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/CopyIcon.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 6e164dcb85fc8ad4b9ab2f1e883862d2 +timeCreated: 1455688729 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/Delete.png b/Assets/Editor Default Resources/FMOD/Delete.png new file mode 100644 index 0000000..3bbc094 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/Delete.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ca01b263c0395dce602ba7ff5a836d7f461216d860427a0e3df55a7ab71efa6 +size 221 diff --git a/Assets/Editor Default Resources/FMOD/Delete.png.meta b/Assets/Editor Default Resources/FMOD/Delete.png.meta new file mode 100644 index 0000000..6f6c62e --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/Delete.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 196080340db65c44883dd3f599556fb9 +timeCreated: 1434604329 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/EventIcon.png b/Assets/Editor Default Resources/FMOD/EventIcon.png new file mode 100644 index 0000000..639d035 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/EventIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:846f36969a9193bb47cde4c12d2b39c76d3eaa9db4d8ba8b16eb76d21225f24b +size 705 diff --git a/Assets/Editor Default Resources/FMOD/EventIcon.png.meta b/Assets/Editor Default Resources/FMOD/EventIcon.png.meta new file mode 100644 index 0000000..ca11cc5 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/EventIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a602f206f9cb31f439c79a2fe23687c5 +timeCreated: 1432616010 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/FolderIconClosed.png b/Assets/Editor Default Resources/FMOD/FolderIconClosed.png new file mode 100644 index 0000000..014196b --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/FolderIconClosed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e0e2cfe75a26e20382f957b843f704ce604a0b24e5152470ebd28208cfac212 +size 2963 diff --git a/Assets/Editor Default Resources/FMOD/FolderIconClosed.png.meta b/Assets/Editor Default Resources/FMOD/FolderIconClosed.png.meta new file mode 100644 index 0000000..faed9a3 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/FolderIconClosed.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 70efeb6d97126f843b30b8ed62d18a4f +timeCreated: 1432621560 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/FolderIconOpen.png b/Assets/Editor Default Resources/FMOD/FolderIconOpen.png new file mode 100644 index 0000000..ffded31 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/FolderIconOpen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a5f22962370823cae68458fcc089dd0759636aff6d1e2f45bd701d740aa5598 +size 3221 diff --git a/Assets/Editor Default Resources/FMOD/FolderIconOpen.png.meta b/Assets/Editor Default Resources/FMOD/FolderIconOpen.png.meta new file mode 100644 index 0000000..8d2fdfb --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/FolderIconOpen.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: d2b54e4f7f80b9448a41d3c5985f5672 +timeCreated: 1432621574 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/LevelMeter.png b/Assets/Editor Default Resources/FMOD/LevelMeter.png new file mode 100644 index 0000000..23b5111 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/LevelMeter.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4cf62566605f580f6d86b49e60cf394d9c8f235f0bea6daba15381fd4548d55 +size 767 diff --git a/Assets/Editor Default Resources/FMOD/LevelMeter.png.meta b/Assets/Editor Default Resources/FMOD/LevelMeter.png.meta new file mode 100644 index 0000000..c7c11f4 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/LevelMeter.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 21e7a3d41a926364a8b9a6704ebe80d8 +timeCreated: 1433917421 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/LevelMeterOff.png b/Assets/Editor Default Resources/FMOD/LevelMeterOff.png new file mode 100644 index 0000000..b647cb1 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/LevelMeterOff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7291826c4db602ab5501fb0e4e51e0aef4d4c7ead86c58ac354e9f5fcad590fd +size 635 diff --git a/Assets/Editor Default Resources/FMOD/LevelMeterOff.png.meta b/Assets/Editor Default Resources/FMOD/LevelMeterOff.png.meta new file mode 100644 index 0000000..35d5a1e --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/LevelMeterOff.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 48dc5470d93f669419f294fcd33f7b7c +timeCreated: 1434426551 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/NotFound.png b/Assets/Editor Default Resources/FMOD/NotFound.png new file mode 100644 index 0000000..ca6e7b5 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/NotFound.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ae518102dd2ae8fab1a9bd2f526c8897de491f55f28ceb72ac3a4e0365d330d +size 3139 diff --git a/Assets/Editor Default Resources/FMOD/NotFound.png.meta b/Assets/Editor Default Resources/FMOD/NotFound.png.meta new file mode 100644 index 0000000..315e989 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/NotFound.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 1138ab068176f29499337d7a73dfecd9 +timeCreated: 1432798099 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/SearchIcon.png b/Assets/Editor Default Resources/FMOD/SearchIcon.png new file mode 100644 index 0000000..5136fc9 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SearchIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39f685e06bcf2883c73bc080bbb167f0e898baa36e95e36d26be9aeb85438977 +size 2974 diff --git a/Assets/Editor Default Resources/FMOD/SearchIcon.png.meta b/Assets/Editor Default Resources/FMOD/SearchIcon.png.meta new file mode 100644 index 0000000..6f4d3a1 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SearchIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 1b785acb38b002542a02d6c4cbb1fa6f +timeCreated: 1432696384 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/SearchIconBlack.png b/Assets/Editor Default Resources/FMOD/SearchIconBlack.png new file mode 100644 index 0000000..4118e53 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SearchIconBlack.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17a08ec9844a6c30a78346c21d4ea627645fa217d8e1e6ef8225885e80c663ef +size 3025 diff --git a/Assets/Editor Default Resources/FMOD/SearchIconBlack.png.meta b/Assets/Editor Default Resources/FMOD/SearchIconBlack.png.meta new file mode 100644 index 0000000..03a227c --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SearchIconBlack.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 99471facfde9fb84dbe4a81ad570ebce +timeCreated: 1434602090 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/Selected.png b/Assets/Editor Default Resources/FMOD/Selected.png new file mode 100644 index 0000000..8afface --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/Selected.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e516e263de4dfbb9a7f193fe9ac3e380b837bd28bacf300f6c29c0f7e3a535f7 +size 191 diff --git a/Assets/Editor Default Resources/FMOD/Selected.png.meta b/Assets/Editor Default Resources/FMOD/Selected.png.meta new file mode 100644 index 0000000..361c9be --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/Selected.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 38be8eaefa585de4aa1781acb0adc866 +timeCreated: 1432797507 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/SelectedAlt.png b/Assets/Editor Default Resources/FMOD/SelectedAlt.png new file mode 100644 index 0000000..b39f163 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SelectedAlt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9450a6d1836697cc7b196df8d9b829c66dc9e38400cd00e78abc0fa0d4290b84 +size 170 diff --git a/Assets/Editor Default Resources/FMOD/SelectedAlt.png.meta b/Assets/Editor Default Resources/FMOD/SelectedAlt.png.meta new file mode 100644 index 0000000..448ef6a --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SelectedAlt.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 8ce9b717b1bc7564cbe35664f2f178a7 +timeCreated: 1455161898 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/SnapshotIcon.png b/Assets/Editor Default Resources/FMOD/SnapshotIcon.png new file mode 100644 index 0000000..86ac78d --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SnapshotIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a64f883f76eec0a308b9af0607394b4030b3c0b25e22afaae48779b7525c2ef9 +size 737 diff --git a/Assets/Editor Default Resources/FMOD/SnapshotIcon.png.meta b/Assets/Editor Default Resources/FMOD/SnapshotIcon.png.meta new file mode 100644 index 0000000..e0e9ec8 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/SnapshotIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: cf2bba5fb8be7e64ca39979f18eb372a +timeCreated: 1434600422 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/StudioIcon.png b/Assets/Editor Default Resources/FMOD/StudioIcon.png new file mode 100644 index 0000000..d5b631b --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/StudioIcon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adb4854cc54817bc18bab8f51b6b9f5dd49220f7019877e596cb02fddf009dd8 +size 3581 diff --git a/Assets/Editor Default Resources/FMOD/StudioIcon.png.meta b/Assets/Editor Default Resources/FMOD/StudioIcon.png.meta new file mode 100644 index 0000000..d9adb84 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/StudioIcon.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: a4edfa5854cdec34b98b1c55f0562bdd +timeCreated: 1434601223 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/TransportOpen.png b/Assets/Editor Default Resources/FMOD/TransportOpen.png new file mode 100644 index 0000000..cd382e1 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportOpen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09901dc10713d986ef1df3b28d6d637d978263f86eebd18fddb57b8d7d3cf472 +size 4234 diff --git a/Assets/Editor Default Resources/FMOD/TransportOpen.png.meta b/Assets/Editor Default Resources/FMOD/TransportOpen.png.meta new file mode 100644 index 0000000..78eda48 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportOpen.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: b0fb832e401d1514a9611735d8d340b1 +timeCreated: 1453178387 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/TransportPlayButtonOff.png b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOff.png new file mode 100644 index 0000000..382eaf7 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7235df4b7a8cc331595984bae5f2f11f18a2da8808a92cbc268454ad7836999d +size 3525 diff --git a/Assets/Editor Default Resources/FMOD/TransportPlayButtonOff.png.meta b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOff.png.meta new file mode 100644 index 0000000..61b5d12 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOff.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 29258b1336a580946bc144df00b74ac1 +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/TransportPlayButtonOn.png b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOn.png new file mode 100644 index 0000000..71dc6f0 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b3ef1497d5583fc59777d3e32b7f0841a1b40cad462f6c7b76e02b600cbe7d2 +size 3715 diff --git a/Assets/Editor Default Resources/FMOD/TransportPlayButtonOn.png.meta b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOn.png.meta new file mode 100644 index 0000000..f066772 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportPlayButtonOn.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: 2d777c9a14189d241aea1afeeeff448c +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/TransportStopButtonOff.png b/Assets/Editor Default Resources/FMOD/TransportStopButtonOff.png new file mode 100644 index 0000000..7cb939f --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportStopButtonOff.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3813b737ddf9a4c4ccbad813498d029e168f5d2bdb55ac4940f380f0ef34b9b +size 3290 diff --git a/Assets/Editor Default Resources/FMOD/TransportStopButtonOff.png.meta b/Assets/Editor Default Resources/FMOD/TransportStopButtonOff.png.meta new file mode 100644 index 0000000..4397ce5 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportStopButtonOff.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: cafa069c15865d543a07375373f0a18e +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/TransportStopButtonOn.png b/Assets/Editor Default Resources/FMOD/TransportStopButtonOn.png new file mode 100644 index 0000000..d913100 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportStopButtonOn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b575ed82986cacca2633358315b4ff642d81fd277825afd54f4ddc5d97880b32 +size 3463 diff --git a/Assets/Editor Default Resources/FMOD/TransportStopButtonOn.png.meta b/Assets/Editor Default Resources/FMOD/TransportStopButtonOn.png.meta new file mode 100644 index 0000000..a8eff38 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/TransportStopButtonOn.png.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: eab53cb0959d1244aadeacf8b76c755c +timeCreated: 1453177025 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 7 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/preview.png b/Assets/Editor Default Resources/FMOD/preview.png new file mode 100644 index 0000000..b4416d3 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5442882e67f6bd03f05d5cdaf38b12ab53099e2fc002c17ff9d75fe74d917ad1 +size 17576 diff --git a/Assets/Editor Default Resources/FMOD/preview.png.meta b/Assets/Editor Default Resources/FMOD/preview.png.meta new file mode 100644 index 0000000..4b2c539 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/preview.png.meta @@ -0,0 +1,56 @@ +fileFormatVersion: 2 +guid: 0793eda432fc5df4ab1291e6baacd771 +timeCreated: 1434430906 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + linearTexture: 1 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -3 + maxTextureSize: 2048 + textureSettings: + filterMode: 1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + allowsAlphaSplitting: 0 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 1 + textureType: 2 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor Default Resources/FMOD/previewemitter.png b/Assets/Editor Default Resources/FMOD/previewemitter.png new file mode 100644 index 0000000..bbbbe10 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/previewemitter.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d555a49c7381486bc846b226dbaedf52ae4bf3206e7f150c07756641b3228e88 +size 278 diff --git a/Assets/Editor Default Resources/FMOD/previewemitter.png.meta b/Assets/Editor Default Resources/FMOD/previewemitter.png.meta new file mode 100644 index 0000000..9ae72c0 --- /dev/null +++ b/Assets/Editor Default Resources/FMOD/previewemitter.png.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 9519043db3741934fa01455c47683e8c +timeCreated: 1434431177 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FMOD.meta b/Assets/FMOD.meta new file mode 100644 index 0000000..c4ea117 --- /dev/null +++ b/Assets/FMOD.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da05093b3ca45b740959fec07b1f8ecc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FMOD/Desktop.meta b/Assets/FMOD/Desktop.meta new file mode 100644 index 0000000..f25cd0e --- /dev/null +++ b/Assets/FMOD/Desktop.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c069489cf72d0b54fa260c00c157ea0a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FMOD/Desktop/Master.bank b/Assets/FMOD/Desktop/Master.bank new file mode 100644 index 0000000..2ea5513 Binary files /dev/null and b/Assets/FMOD/Desktop/Master.bank differ diff --git a/Assets/FMOD/Desktop/Master.bank.meta b/Assets/FMOD/Desktop/Master.bank.meta new file mode 100644 index 0000000..615cd6e --- /dev/null +++ b/Assets/FMOD/Desktop/Master.bank.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b8af3ba47b52d44478abb14d6314aca8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FMOD/Desktop/Master.strings.bank b/Assets/FMOD/Desktop/Master.strings.bank new file mode 100644 index 0000000..14cb29f Binary files /dev/null and b/Assets/FMOD/Desktop/Master.strings.bank differ diff --git a/Assets/FMOD/Desktop/Master.strings.bank.meta b/Assets/FMOD/Desktop/Master.strings.bank.meta new file mode 100644 index 0000000..55b9ada --- /dev/null +++ b/Assets/FMOD/Desktop/Master.strings.bank.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc64b8541a020ca4a82de670fa5c79e1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Gizmos.meta b/Assets/Gizmos.meta new file mode 100644 index 0000000..f3a77af --- /dev/null +++ b/Assets/Gizmos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 260420ad62bc2b248890315210cca36e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Gizmos/FMOD.meta b/Assets/Gizmos/FMOD.meta new file mode 100644 index 0000000..5884c10 --- /dev/null +++ b/Assets/Gizmos/FMOD.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3241fc823f0d846449c68b4f7ccd4335 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Gizmos/FMOD/FMODEmitter.tiff b/Assets/Gizmos/FMOD/FMODEmitter.tiff new file mode 100644 index 0000000..cac7d9c --- /dev/null +++ b/Assets/Gizmos/FMOD/FMODEmitter.tiff @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2434768b7999507c8e02877d5bfaf1d698fd60b166cc745840fe10f3b2737590 +size 2204 diff --git a/Assets/Gizmos/FMOD/FMODEmitter.tiff.meta b/Assets/Gizmos/FMOD/FMODEmitter.tiff.meta new file mode 100644 index 0000000..9bb7828 --- /dev/null +++ b/Assets/Gizmos/FMOD/FMODEmitter.tiff.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: 392af304825cbe847bbf4e603852e4dd +timeCreated: 1433142042 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + cubemapConvolution: 0 + cubemapConvolutionSteps: 8 + cubemapConvolutionExponent: 1.5 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + rGBM: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD.meta b/Assets/Plugins/FMOD.meta new file mode 100644 index 0000000..9783e18 --- /dev/null +++ b/Assets/Plugins/FMOD.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 06ae579381df01a4a87bb149dec89954 +folderAsset: yes +timeCreated: 1429061260 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Cache.meta b/Assets/Plugins/FMOD/Cache.meta new file mode 100644 index 0000000..d233906 --- /dev/null +++ b/Assets/Plugins/FMOD/Cache.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 399618523f73e624688f86b01b832ae9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Cache/Editor.meta b/Assets/Plugins/FMOD/Cache/Editor.meta new file mode 100644 index 0000000..37bfa74 --- /dev/null +++ b/Assets/Plugins/FMOD/Cache/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b3ab2ca7595571f488f1e7b0268c7729 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset b/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset new file mode 100644 index 0000000..244e16b --- /dev/null +++ b/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset @@ -0,0 +1,125 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-7041380604813623769 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c18180ecb35941f4682ae60107b85b7c, type: 3} + m_Name: bank:/Desktop/Master.bank + m_EditorClassIdentifier: + Path: ../FMOD Studio/Lucidity/lucidity/Build/Desktop/Master.bank + Name: Desktop/Master + lastModified: 637454772174970597 + LoadResult: 0 + FileSizes: [] + Exists: 0 +--- !u!114 &-5408626126966111271 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c18180ecb35941f4682ae60107b85b7c, type: 3} + m_Name: bank:/Master.bank + m_EditorClassIdentifier: + Path: Assets/FMOD/Desktop/Master.bank + Name: Master + lastModified: 637454772435834869 + LoadResult: 0 + FileSizes: [] + Exists: 1 +--- !u!114 &-827201015612902519 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ceb653cd98e289a4e8697a1af55201f2, type: 3} + m_Name: event:/Music + m_EditorClassIdentifier: + Path: event:/Music + guid: b4991bd47dedca4fa65a3c05cba6875c + Banks: + - {fileID: -5408626126966111271} + IsStream: 1 + Is3D: 0 + IsOneShot: 0 + Parameters: [] + MinDistance: 0 + MaxDistance: 0 + Length: 226634 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d32cf7c32a3ed8347bac48ef5ed56d82, type: 3} + m_Name: FMODStudioCache + m_EditorClassIdentifier: + EditorBanks: + - {fileID: 6606792957875447575} + - {fileID: -5408626126966111271} + EditorEvents: + - {fileID: -827201015612902519} + EditorParameters: [] + MasterBanks: + - {fileID: -5408626126966111271} + StringsBanks: + - {fileID: 6606792957875447575} + stringsBankWriteTime: 637454772435864900 + cacheVersion: 4 +--- !u!114 &6606792957875447575 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c18180ecb35941f4682ae60107b85b7c, type: 3} + m_Name: bank:/Master.strings.bank + m_EditorClassIdentifier: + Path: Assets/FMOD/Desktop/Master.strings.bank + Name: Master.strings + lastModified: 637454772435864900 + LoadResult: 0 + FileSizes: + - Name: + Value: 730 + Exists: 1 +--- !u!114 &8339078117211280506 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c18180ecb35941f4682ae60107b85b7c, type: 3} + m_Name: bank:/Desktop/Master.strings.bank + m_EditorClassIdentifier: + Path: ../FMOD Studio/Lucidity/lucidity/Build/Desktop/Master.strings.bank + Name: Desktop/Master.strings + lastModified: 637454772175010630 + LoadResult: 0 + FileSizes: + - Name: + Value: 730 + Exists: 0 diff --git a/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset.meta b/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset.meta new file mode 100644 index 0000000..1b434d9 --- /dev/null +++ b/Assets/Plugins/FMOD/Cache/Editor/FMODStudioCache.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7172f2a70e7264b4b9901ce3929857d7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/FMODUnity.asmdef b/Assets/Plugins/FMOD/FMODUnity.asmdef new file mode 100644 index 0000000..9ab5171 --- /dev/null +++ b/Assets/Plugins/FMOD/FMODUnity.asmdef @@ -0,0 +1,21 @@ +{ + "name": "FMODUnity", + "references": [ + "Unity.Timeline" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.timeline", + "expression": "1.0.0", + "define": "UNITY_TIMELINE_EXIST" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/FMODUnity.asmdef.meta b/Assets/Plugins/FMOD/FMODUnity.asmdef.meta new file mode 100644 index 0000000..4dce579 --- /dev/null +++ b/Assets/Plugins/FMOD/FMODUnity.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0c752da273b17c547ae705acf0f2adf2 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/LICENSE.TXT b/Assets/Plugins/FMOD/LICENSE.TXT new file mode 100644 index 0000000..c2f8863 --- /dev/null +++ b/Assets/Plugins/FMOD/LICENSE.TXT @@ -0,0 +1,157 @@ + FMOD END USER LICENCE AGREEMENT + =============================== + +This End User Licence Agreement (EULA) is a legal agreement between you and +Firelight Technologies Pty Ltd (ACN 099 182 448) (us or we) and governs your use +of FMOD Studio Authoring Tool and FMOD Studio Engine, together the Software. + +1. GRANT OF LICENCE + +1.1 FMOD Studio Authoring Tool + +This EULA grants you the right to use FMOD Studio Authoring Tool for all use, +including Commercial use, subject to the following: + + i. FMOD Studio Authoring Tool is used to create content for use with the + FMOD Studio Engine only; + + ii. FMOD Studio Authoring Tool is not redistributed in any form. + +1.2 FMOD Studio Engine + +This EULA grants you the right to use FMOD Studio Engine, for personal +(hobbyist), educational (students and teachers) or Non-Commercial use only, +subject to the following: + + i. FMOD Studio Engine is integrated and redistributed in a software + application (Product) only; + + ii. FMOD Studio Engine is not distributed as part of a game engine or tool + set; + + iii. FMOD Studio Engine is not used in any Commercial enterprise or for any + Commercial production or subcontracting, except for the purposes of + Evaluation or Development of a Commercial Product; + + iv. Non-Commercial use does not involve any form of monetisation, + sponsorship or promotion; + + v. Product includes attribution in accordance with Clause 3. + +2.OTHER USE + +For all Commercial use, and any Non Commercial use not permitted by this +license, a separate license is required. Refer to www.fmod.com/licensing for +information. + +3. CREDITS + +All Products require an in game credit line which must include the words “FMOD +Studio” and “Firelight Technologies Pty Ltd”. Refer to www.fmod.com/attribution +for examples. + +4. INTELLECTUAL PROPERTY RIGHTS + +We are and remain at all times the owner of the Software (including all +intellectual property rights in or to the Software). For the avoidance of doubt, +nothing in this EULA may be deemed to grant or assign to you any proprietary or +ownership interest or intellectual property rights in or to the Software other +than the rights licensed pursuant to Clause 1. + +You acknowledge and agree that you have no right, title or interest in and to +the intellectual property rights in the Software. + +5. SECURITY AND RISK + +You are responsible for protecting the Software and any related materials at all +times from unauthorised access, use or damage. + +6. WARRANTY AND LIMITATION OF LIABILITY + +The Software is provided by us “as is” and, to the maximum extent permitted by +law, any express or implied warranties of any kind, including (but not limited +to) all implied warranties of merchantability and fitness for a particular +purpose are disclaimed. + +In no event shall we (and our employees, contractors and subcontractors), +developers and contributors be liable for any direct, special, indirect or +consequential damages whatsoever resulting from loss of data or profits, whether +in an action of contract, negligence or other tortious conduct, arising out of +or in connection with the use or performance of the Software. + +7. OGG VORBIS CODEC + +FMOD uses the Ogg Vorbis codec © 2002, Xiph.Org Foundation. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + i. Redistributions of source code must retain the above copyright notice, + the list of conditions and the following disclaimer. + + ii. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other material provided with the distribution. + + iii. Neither the name of the Xiph.org Foundation nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +8. RESONANCE AUDIO SDK + +FMOD includes Resonance Audio SDK, licensed under the Apache Licence, Version +2.0 (the Licence); you may not use this file except in compliance with the +License. You may obtain a copy of the License at: + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +8. ANDROID PLATFORM CODE + +Copyright (C) 2010 The Android Open Source Project All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +9. AUDIOMOTORS DEMO CONTENT + +The audiogaming_audiomotors_demo_engine.agp file is provided for evaluation +purposes only and is not to be redistributed. AudioMotors V2 Pro is required to +create your own engine content. Refer to https://lesound.io for information. diff --git a/Assets/Plugins/FMOD/LICENSE.TXT.meta b/Assets/Plugins/FMOD/LICENSE.TXT.meta new file mode 100644 index 0000000..a753e30 --- /dev/null +++ b/Assets/Plugins/FMOD/LICENSE.TXT.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 96ea3cc59f035fd4c87c33b81f06d134 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Resources.meta b/Assets/Plugins/FMOD/Resources.meta new file mode 100644 index 0000000..142b9a9 --- /dev/null +++ b/Assets/Plugins/FMOD/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26f1c5562d211904d9a571ad20dd216f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset new file mode 100644 index 0000000..9ed6c9f --- /dev/null +++ b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset @@ -0,0 +1,84 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: eef8d824ea7b63742966aaa0e94ac383, type: 3} + m_Name: FMODStudioSettings + m_EditorClassIdentifier: + SwitchSettingsMigration: 1 + HasSourceProject: 0 + HasPlatforms: 0 + sourceProjectPath: ../FMOD Studio/Lucidity/lucidity/lucidity.fspro + sourceBankPath: Assets/FMOD/Desktop + SourceBankPathUnformatted: + AutomaticEventLoading: 1 + BankLoadType: 0 + AutomaticSampleLoading: 0 + EncryptionKey: + ImportType: 0 + TargetAssetPath: FMODBanks + LoggingLevel: 2 + SpeakerModeSettings: + - Platform: 2 + Value: 3 + - Platform: 20 + Value: 3 + SampleRateSettings: + - Platform: 1 + Value: 48000 + - Platform: 2 + Value: 0 + - Platform: 20 + Value: 0 + LiveUpdateSettings: + - Platform: 1 + Value: 1 + - Platform: 2 + Value: 0 + - Platform: 20 + Value: 0 + OverlaySettings: + - Platform: 1 + Value: 1 + - Platform: 2 + Value: 0 + - Platform: 20 + Value: 0 + LoggingSettings: + - Platform: 1 + Value: 1 + - Platform: 2 + Value: 0 + - Platform: 20 + Value: 0 + BankDirectorySettings: + - Platform: 2 + Value: Desktop + VirtualChannelSettings: + - Platform: 1 + Value: 1024 + - Platform: 2 + Value: 128 + - Platform: 20 + Value: 128 + RealChannelSettings: + - Platform: 1 + Value: 256 + - Platform: 2 + Value: 32 + - Platform: 20 + Value: 32 + Plugins: [] + MasterBanks: + - Master + Banks: [] + BanksToLoad: [] + LiveUpdatePort: 9264 + AndroidUseOBB: 0 diff --git a/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset.meta b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset.meta new file mode 100644 index 0000000..632376d --- /dev/null +++ b/Assets/Plugins/FMOD/Resources/FMODStudioSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 252cc041ba859254b818102aa1e26fe0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons.meta b/Assets/Plugins/FMOD/addons.meta new file mode 100644 index 0000000..b25d6e1 --- /dev/null +++ b/Assets/Plugins/FMOD/addons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd4d5d7e08f1771409ff5dfccf9d5a7b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio.meta new file mode 100644 index 0000000..75d1719 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a39280e2af5eeae428824806b03bd0ea +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor.meta new file mode 100644 index 0000000..5b9d995 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11a26c9955b87aa4697209661611497c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef new file mode 100644 index 0000000..3063883 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "FMODUnityResonanceEditor", + "references": [ + "FMODUnityResonance" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef.meta new file mode 100644 index 0000000..140f4b8 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FMODUnityResonanceEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 194213485063a984b98ce9410892267a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs new file mode 100644 index 0000000..3cea854 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs @@ -0,0 +1,115 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using UnityEngine; +using UnityEditor; +using System.Collections; + +/// A custom editor for properties on the FmodResonanceAudioRoom script. This appears in the +/// Inspector window of a FmodResonanceAudioRoom object. +[CustomEditor(typeof(FmodResonanceAudioRoom))] +[CanEditMultipleObjects] +public class FmodResonanceAudioRoomEditor : Editor { + private SerializedProperty leftWall = null; + private SerializedProperty rightWall = null; + private SerializedProperty floor = null; + private SerializedProperty ceiling = null; + private SerializedProperty backWall = null; + private SerializedProperty frontWall = null; + private SerializedProperty reflectivity = null; + private SerializedProperty reverbGainDb = null; + private SerializedProperty reverbBrightness = null; + private SerializedProperty reverbTime = null; + private SerializedProperty size = null; + + private GUIContent surfaceMaterialsLabel = new GUIContent("Surface Materials", + "Room surface materials to calculate the acoustic properties of the room."); + private GUIContent surfaceMaterialLabel = new GUIContent("Surface Material", + "Surface material used to calculate the acoustic properties of the room."); + private GUIContent reflectivityLabel = new GUIContent("Reflectivity", + "Adjusts what proportion of the direct sound is reflected back by each surface, after an " + + "appropriate delay. Reverberation is unaffected by this setting."); + private GUIContent reverbGainLabel = new GUIContent("Gain (dB)", + "Applies a gain adjustment to the reverberation in the room. The default value will leave " + + "reverb unaffected."); + private GUIContent reverbPropertiesLabel = new GUIContent("Reverb Properties", + "Parameters to adjust the reverb properties of the room."); + private GUIContent reverbBrightnessLabel = new GUIContent("Brightness", + "Adjusts the balance between high and low frequencies in the reverb."); + private GUIContent reverbTimeLabel = new GUIContent("Time", + "Adjusts the overall duration of the reverb by a positive scaling factor."); + private GUIContent sizeLabel = new GUIContent("Size", "Sets the room dimensions."); + + void OnEnable () { + leftWall = serializedObject.FindProperty("leftWall"); + rightWall = serializedObject.FindProperty("rightWall"); + floor = serializedObject.FindProperty("floor"); + ceiling = serializedObject.FindProperty("ceiling"); + backWall = serializedObject.FindProperty("backWall"); + frontWall = serializedObject.FindProperty("frontWall"); + reflectivity = serializedObject.FindProperty("reflectivity"); + reverbGainDb = serializedObject.FindProperty("reverbGainDb"); + reverbBrightness = serializedObject.FindProperty("reverbBrightness"); + reverbTime = serializedObject.FindProperty("reverbTime"); + size = serializedObject.FindProperty("size"); + } + + /// @cond + public override void OnInspectorGUI () { + serializedObject.Update(); + + // Add clickable script field, as would have been provided by DrawDefaultInspector() + MonoScript script = MonoScript.FromMonoBehaviour (target as MonoBehaviour); + EditorGUI.BeginDisabledGroup (true); + EditorGUILayout.ObjectField ("Script", script, typeof(MonoScript), false); + EditorGUI.EndDisabledGroup (); + + EditorGUILayout.LabelField(surfaceMaterialsLabel); + ++EditorGUI.indentLevel; + DrawSurfaceMaterial(leftWall); + DrawSurfaceMaterial(rightWall); + DrawSurfaceMaterial(floor); + DrawSurfaceMaterial(ceiling); + DrawSurfaceMaterial(backWall); + DrawSurfaceMaterial(frontWall); + --EditorGUI.indentLevel; + + EditorGUILayout.Separator(); + + EditorGUILayout.Slider(reflectivity, 0.0f, FmodResonanceAudio.maxReflectivity, reflectivityLabel); + + EditorGUILayout.Separator(); + + EditorGUILayout.LabelField(reverbPropertiesLabel); + ++EditorGUI.indentLevel; + EditorGUILayout.Slider(reverbGainDb, FmodResonanceAudio.minGainDb, FmodResonanceAudio.maxGainDb, + reverbGainLabel); + EditorGUILayout.Slider(reverbBrightness, FmodResonanceAudio.minReverbBrightness, + FmodResonanceAudio.maxReverbBrightness, reverbBrightnessLabel); + EditorGUILayout.Slider(reverbTime, 0.0f, FmodResonanceAudio.maxReverbTime, reverbTimeLabel); + --EditorGUI.indentLevel; + + EditorGUILayout.Separator(); + + EditorGUILayout.PropertyField(size, sizeLabel); + + serializedObject.ApplyModifiedProperties(); + } + /// @endcond + + private void DrawSurfaceMaterial (SerializedProperty surfaceMaterial) { + surfaceMaterialLabel.text = surfaceMaterial.displayName; + EditorGUILayout.PropertyField(surfaceMaterial, surfaceMaterialLabel); + } +} diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs.meta new file mode 100644 index 0000000..e7c41dd --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Editor/FmodResonanceAudioRoomEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 935c6716e27bd481e97897dd9e1de595 +timeCreated: 1511395157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts.meta new file mode 100644 index 0000000..2131d19 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9251978b5358a434c917eecc129bed38 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef new file mode 100644 index 0000000..a23912c --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef @@ -0,0 +1,15 @@ +{ + "name": "FMODUnityResonance", + "references": [ + "FMODUnity" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef.meta new file mode 100644 index 0000000..7286b11 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FMODUnityResonance.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 44d09cf463b68274884d8a3c8a94e528 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs new file mode 100644 index 0000000..dd0f70c --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs @@ -0,0 +1,262 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using UnityEngine; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using FMODUnity; + +/// This is the main Resonance Audio class that communicates with the FMOD Unity integration. Native +/// functions of the system can only be called through this class to preserve the internal system +/// functionality. +public static class FmodResonanceAudio { + /// Updates the room effects of the environment with given |room| properties. + /// @note This should only be called from the main Unity thread. + public static void UpdateAudioRoom(FmodResonanceAudioRoom room, bool roomEnabled) { + // Update the enabled rooms list. + if (roomEnabled) { + if (!enabledRooms.Contains(room)) { + enabledRooms.Add(room); + } + } else { + enabledRooms.Remove(room); + } + // Update the current room effects to be applied. + if (enabledRooms.Count > 0) { + FmodResonanceAudioRoom currentRoom = enabledRooms[enabledRooms.Count - 1]; + RoomProperties roomProperties = GetRoomProperties(currentRoom); + // Pass the room properties into a pointer. + IntPtr roomPropertiesPtr = Marshal.AllocHGlobal(roomPropertiesSize); + Marshal.StructureToPtr(roomProperties, roomPropertiesPtr, false); + ListenerPlugin.setParameterData (roomPropertiesIndex, GetBytes(roomPropertiesPtr, + roomPropertiesSize)); + Marshal.FreeHGlobal(roomPropertiesPtr); + } else { + // Set the room properties to a null room, which will effectively disable the room effects. + ListenerPlugin.setParameterData (roomPropertiesIndex, GetBytes(IntPtr.Zero, 0)); + } + } + + /// Returns whether the listener is currently inside the given |room| boundaries. + public static bool IsListenerInsideRoom(FmodResonanceAudioRoom room) { + // Compute the room position relative to the listener. + FMOD.VECTOR unused; + RuntimeManager.CoreSystem.get3DListenerAttributes(0, out listenerPositionFmod, out unused, + out unused, out unused); + Vector3 listenerPosition = new Vector3(listenerPositionFmod.x, listenerPositionFmod.y, + listenerPositionFmod.z); + Vector3 relativePosition = listenerPosition - room.transform.position; + Quaternion rotationInverse = Quaternion.Inverse(room.transform.rotation); + // Set the size of the room as the boundary and return whether the listener is inside. + bounds.size = Vector3.Scale(room.transform.lossyScale, room.size); + return bounds.Contains(rotationInverse * relativePosition); + } + + /// Maximum allowed gain value in decibels. + public const float maxGainDb = 24.0f; + + /// Minimum allowed gain value in decibels. + public const float minGainDb = -24.0f; + + /// Maximum allowed reverb brightness modifier value. + public const float maxReverbBrightness = 1.0f; + + /// Minimum allowed reverb brightness modifier value. + public const float minReverbBrightness = -1.0f; + + /// Maximum allowed reverb time modifier value. + public const float maxReverbTime = 3.0f; + + /// Maximum allowed reflectivity multiplier of a room surface material. + public const float maxReflectivity = 2.0f; + + [StructLayout(LayoutKind.Sequential)] + private struct RoomProperties { + // Center position of the room in world space. + public float positionX; + public float positionY; + public float positionZ; + + // Rotation (quaternion) of the room in world space. + public float rotationX; + public float rotationY; + public float rotationZ; + public float rotationW; + + // Size of the shoebox room in world space. + public float dimensionsX; + public float dimensionsY; + public float dimensionsZ; + + // Material name of each surface of the shoebox room. + public FmodResonanceAudioRoom.SurfaceMaterial materialLeft; + public FmodResonanceAudioRoom.SurfaceMaterial materialRight; + public FmodResonanceAudioRoom.SurfaceMaterial materialBottom; + public FmodResonanceAudioRoom.SurfaceMaterial materialTop; + public FmodResonanceAudioRoom.SurfaceMaterial materialFront; + public FmodResonanceAudioRoom.SurfaceMaterial materialBack; + + // User defined uniform scaling factor for reflectivity. This parameter has no effect when set + // to 1.0f. + public float reflectionScalar; + + // User defined reverb tail gain multiplier. This parameter has no effect when set to 0.0f. + public float reverbGain; + + // Adjusts the reverberation time across all frequency bands. RT60 values are multiplied by this + // factor. Has no effect when set to 1.0f. + public float reverbTime; + + // Controls the slope of a line from the lowest to the highest RT60 values (increases high + // frequency RT60s when positive, decreases when negative). Has no effect when set to 0.0f. + public float reverbBrightness; + }; + + // Returns the FMOD Resonance Audio Listener Plugin. + private static FMOD.DSP ListenerPlugin { + get { + if (!listenerPlugin.hasHandle()) { + listenerPlugin = Initialize(); + } + return listenerPlugin; + } + } + + // Converts given |db| value to its amplitude equivalent where 'dB = 20 * log10(amplitude)'. + private static float ConvertAmplitudeFromDb (float db) { + return Mathf.Pow(10.0f, 0.05f * db); + } + + // Converts given |position| and |rotation| from Unity space to audio space. + private static void ConvertAudioTransformFromUnity (ref Vector3 position, + ref Quaternion rotation) { + // Compose the transformation matrix. + Matrix4x4 transformMatrix = Matrix4x4.TRS(position, rotation, Vector3.one); + // Convert the transformation matrix from left-handed to right-handed. + transformMatrix = flipZ * transformMatrix * flipZ; + // Update |position| and |rotation| respectively. + position = transformMatrix.GetColumn(3); + rotation = Quaternion.LookRotation(transformMatrix.GetColumn(2), transformMatrix.GetColumn(1)); + } + + // Returns a byte array of |length| created from |ptr|. + private static byte[] GetBytes(IntPtr ptr, int length) { + if (ptr != IntPtr.Zero) { + byte[] byteArray = new byte[length]; + Marshal.Copy(ptr, byteArray, 0, length); + return byteArray; + } + // Return an empty array if the pointer is null. + return new byte[1]; + } + + // Returns room properties of the given |room|. + private static RoomProperties GetRoomProperties(FmodResonanceAudioRoom room) { + RoomProperties roomProperties; + Vector3 position = room.transform.position; + Quaternion rotation = room.transform.rotation; + Vector3 scale = Vector3.Scale(room.transform.lossyScale, room.size); + ConvertAudioTransformFromUnity(ref position, ref rotation); + roomProperties.positionX = position.x; + roomProperties.positionY = position.y; + roomProperties.positionZ = position.z; + roomProperties.rotationX = rotation.x; + roomProperties.rotationY = rotation.y; + roomProperties.rotationZ = rotation.z; + roomProperties.rotationW = rotation.w; + roomProperties.dimensionsX = scale.x; + roomProperties.dimensionsY = scale.y; + roomProperties.dimensionsZ = scale.z; + roomProperties.materialLeft = room.leftWall; + roomProperties.materialRight = room.rightWall; + roomProperties.materialBottom = room.floor; + roomProperties.materialTop = room.ceiling; + roomProperties.materialFront = room.frontWall; + roomProperties.materialBack = room.backWall; + roomProperties.reverbGain = ConvertAmplitudeFromDb(room.reverbGainDb); + roomProperties.reverbTime = room.reverbTime; + roomProperties.reverbBrightness = room.reverbBrightness; + roomProperties.reflectionScalar = room.reflectivity; + return roomProperties; + } + + // Initializes and returns the FMOD Resonance Audio Listener Plugin. + private static FMOD.DSP Initialize() { + // Search through all busses on in banks. + int numBanks = 0; + FMOD.DSP dsp = new FMOD.DSP(); + FMOD.Studio.Bank[] banks = null; + RuntimeManager.StudioSystem.getBankCount(out numBanks); + RuntimeManager.StudioSystem.getBankList(out banks); + for (int currentBank = 0; currentBank < numBanks; ++currentBank) { + int numBusses = 0; + FMOD.Studio.Bus[] busses = null; + banks[currentBank].getBusCount(out numBusses); + banks[currentBank].getBusList(out busses); + RuntimeManager.StudioSystem.flushCommands(); + for (int currentBus = 0; currentBus < numBusses; ++currentBus) { + // Make sure the channel group of the current bus is assigned properly. + string busPath = null; + busses[currentBus].getPath(out busPath); + RuntimeManager.StudioSystem.getBus(busPath, out busses[currentBus]); + RuntimeManager.StudioSystem.flushCommands(); + FMOD.ChannelGroup channelGroup; + busses[currentBus].getChannelGroup(out channelGroup); + RuntimeManager.StudioSystem.flushCommands(); + if (channelGroup.hasHandle()) { + int numDsps = 0; + channelGroup.getNumDSPs(out numDsps); + for (int currentDsp = 0; currentDsp < numDsps; ++currentDsp) { + channelGroup.getDSP(currentDsp, out dsp); + string dspNameSb; + int unusedInt = 0; + uint unusedUint = 0; + dsp.getInfo(out dspNameSb, out unusedUint, out unusedInt, out unusedInt, out unusedInt); + if (dspNameSb.ToString().Equals(listenerPluginName) && dsp.hasHandle()) { + return dsp; + } + } + } + } + } + Debug.LogError(listenerPluginName + " not found in the FMOD project."); + return dsp; + } + + // Right-handed to left-handed matrix converter (and vice versa). + private static readonly Matrix4x4 flipZ = Matrix4x4.Scale(new Vector3(1, 1, -1)); + + // Get a handle to the Resonance Audio Listener FMOD Plugin. + private static readonly string listenerPluginName = "Resonance Audio Listener"; + + // Size of |RoomProperties| struct in bytes. + private static readonly int roomPropertiesSize = Marshal.SizeOf(typeof(RoomProperties)); + + // Plugin data parameter index for the room properties. + private static readonly int roomPropertiesIndex = 1; + + // Boundaries instance to be used in room detection logic. + private static Bounds bounds = new Bounds(Vector3.zero, Vector3.zero); + + // Container to store the currently active rooms in the scene. + private static List enabledRooms = new List(); + + // Current listener position. + private static FMOD.VECTOR listenerPositionFmod = new FMOD.VECTOR(); + + // FMOD Resonance Audio Listener Plugin. + private static FMOD.DSP listenerPlugin; +} diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs.meta new file mode 100644 index 0000000..d6b2c6e --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6794e6301575a445d8588930a0752568 +timeCreated: 1511395157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs new file mode 100644 index 0000000..e933b59 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs @@ -0,0 +1,100 @@ +// Copyright 2017 Google Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using UnityEngine; +using System.Collections; + +/// Resonance Audio room component that simulates environmental effects of a room with respect to +/// the properties of the attached game object. +[AddComponentMenu("ResonanceAudio/FmodResonanceAudioRoom")] +public class FmodResonanceAudioRoom : MonoBehaviour { + /// Material type that determines the acoustic properties of a room surface. + public enum SurfaceMaterial { + Transparent = 0, ///< Transparent + AcousticCeilingTiles = 1, ///< Acoustic ceiling tiles + BrickBare = 2, ///< Brick, bare + BrickPainted = 3, ///< Brick, painted + ConcreteBlockCoarse = 4, ///< Concrete block, coarse + ConcreteBlockPainted = 5, ///< Concrete block, painted + CurtainHeavy = 6, ///< Curtain, heavy + FiberglassInsulation = 7, ///< Fiberglass insulation + GlassThin = 8, ///< Glass, thin + GlassThick = 9, ///< Glass, thick + Grass = 10, ///< Grass + LinoleumOnConcrete = 11, ///< Linoleum on concrete + Marble = 12, ///< Marble + Metal = 13, ///< Galvanized sheet metal + ParquetOnConcrete = 14, ///< Parquet on concrete + PlasterRough = 15, ///< Plaster, rough + PlasterSmooth = 16, ///< Plaster, smooth + PlywoodPanel = 17, ///< Plywood panel + PolishedConcreteOrTile = 18, ///< Polished concrete or tile + Sheetrock = 19, ///< Sheetrock + WaterOrIceSurface = 20, ///< Water or ice surface + WoodCeiling = 21, ///< Wood ceiling + WoodPanel = 22 ///< Wood panel + } + + /// Room surface material in negative x direction. + public SurfaceMaterial leftWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Room surface material in positive x direction. + public SurfaceMaterial rightWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Room surface material in negative y direction. + public SurfaceMaterial floor = SurfaceMaterial.ParquetOnConcrete; + + /// Room surface material in positive y direction. + public SurfaceMaterial ceiling = SurfaceMaterial.PlasterRough; + + /// Room surface material in negative z direction. + public SurfaceMaterial backWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Room surface material in positive z direction. + public SurfaceMaterial frontWall = SurfaceMaterial.ConcreteBlockCoarse; + + /// Reflectivity scalar for each surface of the room. + public float reflectivity = 1.0f; + + /// Reverb gain modifier in decibels. + public float reverbGainDb = 0.0f; + + /// Reverb brightness modifier. + public float reverbBrightness = 0.0f; + + /// Reverb time modifier. + public float reverbTime = 1.0f; + + /// Size of the room (normalized with respect to scale of the game object). + public Vector3 size = Vector3.one; + + void OnEnable () { + FmodResonanceAudio.UpdateAudioRoom(this, FmodResonanceAudio.IsListenerInsideRoom(this)); + } + + void OnDisable () { + FmodResonanceAudio.UpdateAudioRoom(this, false); + } + + void Update () { + FmodResonanceAudio.UpdateAudioRoom(this, FmodResonanceAudio.IsListenerInsideRoom(this)); + } + + void OnDrawGizmosSelected () { + // Draw shoebox model wireframe of the room. + Gizmos.color = Color.yellow; + Gizmos.matrix = transform.localToWorldMatrix; + Gizmos.DrawWireCube(Vector3.zero, size); + } +} diff --git a/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs.meta b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs.meta new file mode 100644 index 0000000..cacea33 --- /dev/null +++ b/Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6b0c5e63920ee4f55b7ec5248525af4b +timeCreated: 1511395157 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib.meta b/Assets/Plugins/FMOD/lib.meta new file mode 100644 index 0000000..b6ce282 --- /dev/null +++ b/Assets/Plugins/FMOD/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60f0d6077bac3254b9fd9ec4f16d6162 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android.meta b/Assets/Plugins/FMOD/lib/android.meta new file mode 100644 index 0000000..ea98158 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fd5916d407f55e443abead0579284ce8 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a.meta b/Assets/Plugins/FMOD/lib/android/arm64-v8a.meta new file mode 100644 index 0000000..d8346bf --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54305e5cd6046514181f9b21fb0c44ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmod.so b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmod.so new file mode 100644 index 0000000..79506a9 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmod.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03b3b4f8f941c29c430cb8e9ae5927b5b1fcb0e3bf854348157e6e790013f121 +size 1157168 diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmod.so.meta b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmod.so.meta new file mode 100644 index 0000000..9538424 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: 159cb3726937c6c498fa49eb627b0d96 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodL.so b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodL.so new file mode 100644 index 0000000..956c3e6 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc642ef8c273c06acf0d10fed16b2dc03c0cd8b9e0ec300f64a4ccbaf5a9d427 +size 1502408 diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodL.so.meta b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodL.so.meta new file mode 100644 index 0000000..09c68d2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: 6f74d8321b529d948a7672da4ca54356 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudio.so b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudio.so new file mode 100644 index 0000000..0783a6c --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:597cddfaa08c0f7def19234c850fa00e89720140bc73bf66f23d2183d921993e +size 1070832 diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudio.so.meta b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudio.so.meta new file mode 100644 index 0000000..17e07ba --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: e4d6c68823f34e440bfe4e4ecba4c113 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudioL.so b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudioL.so new file mode 100644 index 0000000..7b95fd6 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudioL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cc60ed1abd16373bddd709b0779ce2c87d4bef4207bf690aa02833a1da26667 +size 2082696 diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudioL.so.meta new file mode 100644 index 0000000..d262319 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 1 +guid: 85af50ee41bfd9c4fbd8107aee814c50 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARM64 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libresonanceaudio.so b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libresonanceaudio.so new file mode 100644 index 0000000..e1db017 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libresonanceaudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6d2349af2167490c4c7a82e43c68d67e5062004160e86c2cc5cd05db601b39f +size 990344 diff --git a/Assets/Plugins/FMOD/lib/android/arm64-v8a/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libresonanceaudio.so.meta new file mode 100644 index 0000000..cbd974d --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/arm64-v8a/libresonanceaudio.so.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 2bd9aca31d63ca248bf159e7562a3609 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: + CPU: ARM64 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a.meta b/Assets/Plugins/FMOD/lib/android/armeabi-v7a.meta new file mode 100644 index 0000000..afa8b9e --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 49cc70c20e469a541a7974182c9f588a +folderAsset: yes +timeCreated: 1447698325 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmod.so b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmod.so new file mode 100644 index 0000000..e051f8e --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmod.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4b74d08dd9839b129353c0d199ed50aaa3cc1be1704f1b0a71c8347b431f768 +size 956272 diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmod.so.meta b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmod.so.meta new file mode 100644 index 0000000..5ad7d56 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: f71c8f89be7646142baed6d482d5e89c +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodL.so b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodL.so new file mode 100644 index 0000000..28c15b3 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:033b8af20484838e76555f24a0f32dfe3f864cf037a0ab1a16240ff51758b08e +size 1161584 diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodL.so.meta b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodL.so.meta new file mode 100644 index 0000000..d6a8b58 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0e95029f987dfa248934eaa63745b504 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudio.so b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudio.so new file mode 100644 index 0000000..8507729 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3b011304808f474beef06292c67f06bdf9dd3db62286fc713e5e3cbc0f29706 +size 689780 diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudio.so.meta b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudio.so.meta new file mode 100644 index 0000000..cf4c024 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: cf01ad74bd6e5df46996c61b81ba590c +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudioL.so b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudioL.so new file mode 100644 index 0000000..31c0874 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudioL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d929b66560026392a39a9dfe31f12131f55d60f7f99a0af2f42a9da5f3d2e122 +size 1373812 diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudioL.so.meta new file mode 100644 index 0000000..2435201 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 8de47c7524234f64fb6a7d661154b1a3 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libresonanceaudio.so b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libresonanceaudio.so new file mode 100644 index 0000000..10c9024 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libresonanceaudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8b3085fe95f5e014a15dadc0b27da330045bceaef35aa8789051dbf5264d9b4 +size 669728 diff --git a/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libresonanceaudio.so.meta new file mode 100644 index 0000000..78ad526 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/armeabi-v7a/libresonanceaudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: fb0aabfc61c4c1548ac6990286c84327 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/fmod.jar b/Assets/Plugins/FMOD/lib/android/fmod.jar new file mode 100644 index 0000000..abd95ab --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/fmod.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a28ba37d6d15d2ef3f64b96902eed8cf2a298e9a7cd4e35b63b0f284852f650 +size 9946 diff --git a/Assets/Plugins/FMOD/lib/android/fmod.jar.meta b/Assets/Plugins/FMOD/lib/android/fmod.jar.meta new file mode 100644 index 0000000..e818fd0 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/fmod.jar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: cba124c31f7e10640bc2ff9464f8ac15 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/x86.meta b/Assets/Plugins/FMOD/lib/android/x86.meta new file mode 100644 index 0000000..4c37291 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 95bcdcdca315ef640bec049de80ee3eb +folderAsset: yes +timeCreated: 1447698325 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmod.so b/Assets/Plugins/FMOD/lib/android/x86/libfmod.so new file mode 100644 index 0000000..5db231a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmod.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e537f414312d551da7a14e6f360d627cdfedd36c4e799af82d6c0989874b1ce +size 1287808 diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmod.so.meta b/Assets/Plugins/FMOD/lib/android/x86/libfmod.so.meta new file mode 100644 index 0000000..46cc678 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmod.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 099e80baee62d0c439475fae45e69f4e +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmodL.so b/Assets/Plugins/FMOD/lib/android/x86/libfmodL.so new file mode 100644 index 0000000..2224893 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmodL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df09515e8e453c04dab8f382fdfa52ab2e90a69f82ba740163c8f6f8aeb9fff7 +size 1628288 diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmodL.so.meta b/Assets/Plugins/FMOD/lib/android/x86/libfmodL.so.meta new file mode 100644 index 0000000..ad48cdb --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmodL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 54236e4c5b88f494598efb4d226b44f0 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmodstudio.so b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudio.so new file mode 100644 index 0000000..98a946c --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65c0fd357cd803ea81651b6c819bbc9bff1fc593964fd62e0177e35ed29718c4 +size 1099264 diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmodstudio.so.meta b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudio.so.meta new file mode 100644 index 0000000..4b1d323 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: a20d361b085100b4997c4e5b0b83af31 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmodstudioL.so b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudioL.so new file mode 100644 index 0000000..1628b3d --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudioL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d58e811c9e002d212ae6286359d858551bc00f85485f0f6a55e32f2b8efccfec +size 2139648 diff --git a/Assets/Plugins/FMOD/lib/android/x86/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudioL.so.meta new file mode 100644 index 0000000..fa35551 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libfmodstudioL.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 0975b093811db4e4e9e67bc483ad2299 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/android/x86/libresonanceaudio.so b/Assets/Plugins/FMOD/lib/android/x86/libresonanceaudio.so new file mode 100644 index 0000000..791e279 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libresonanceaudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9b2ec781e1c84397dfa615d5e9ca1bdc3fc8b68902819d9181f3eec58c6f321 +size 1030328 diff --git a/Assets/Plugins/FMOD/lib/android/x86/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/lib/android/x86/libresonanceaudio.so.meta new file mode 100644 index 0000000..b5b5456 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/android/x86/libresonanceaudio.so.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 5c35d7fa6769b114aa63172aaf1fd782 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 1 + settings: + CPU: x86 + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/html5.meta b/Assets/Plugins/FMOD/lib/html5.meta new file mode 100644 index 0000000..efd4387 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/html5.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2197fbd8fe97d334796721324e4e9b37 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/html5/libfmodstudiounityplugin.bc b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounityplugin.bc new file mode 100644 index 0000000..20930d4 Binary files /dev/null and b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounityplugin.bc differ diff --git a/Assets/Plugins/FMOD/lib/html5/libfmodstudiounityplugin.bc.meta b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounityplugin.bc.meta new file mode 100644 index 0000000..b8d3c9d --- /dev/null +++ b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounityplugin.bc.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 254f6ee9df4d3024d9c550104ea5feaf +timeCreated: 1518408468 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WebGL: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/html5/libfmodstudiounitypluginL.bc b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounitypluginL.bc new file mode 100644 index 0000000..b3e0de2 Binary files /dev/null and b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounitypluginL.bc differ diff --git a/Assets/Plugins/FMOD/lib/html5/libfmodstudiounitypluginL.bc.meta b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounitypluginL.bc.meta new file mode 100644 index 0000000..0dcaadb --- /dev/null +++ b/Assets/Plugins/FMOD/lib/html5/libfmodstudiounitypluginL.bc.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 2dab3dda051681d4a9ea3ed67cb9877f +timeCreated: 1518408468 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WebGL: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios.meta b/Assets/Plugins/FMOD/lib/ios.meta new file mode 100644 index 0000000..0cba436 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 17c2d7a6bf1d69b40babc6a644e721d3 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounityplugin.a b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounityplugin.a new file mode 100644 index 0000000..6bb5325 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounityplugin.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60a83a5d17b94d1849cc8f254fd3c396a794f0dd585f356f55544666fde423cf +size 69775920 diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounityplugin.a.meta b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounityplugin.a.meta new file mode 100644 index 0000000..4469cb9 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounityplugin.a.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 79c89db1833831740aee981c0d90d2d4 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + iOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginL.a b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginL.a new file mode 100644 index 0000000..1ac6c34 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginL.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52088ee93ed46048d20ff4160cfc43d0a5d0744d2fe4b78b51de51d09bba6ca6 +size 87703584 diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginL.a.meta b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginL.a.meta new file mode 100644 index 0000000..465f32b --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginL.a.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 5aa4057a8deee1c45a69677125e2c241 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + iOS: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulator.a b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulator.a new file mode 100644 index 0000000..789f243 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulator.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd5e7963f359d7cd538112cb1dd98e85b13d0fe5f7444c4becaf3266056d05ee +size 11755144 diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulator.a.meta b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulator.a.meta new file mode 100644 index 0000000..92865c0 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulator.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 26235204f425d41479c8e41c99e96f50 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulatorL.a b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulatorL.a new file mode 100644 index 0000000..5f50aa4 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulatorL.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:95e65b0e3276b5777b9e8f300b608defbfaaeae6c1a51bfca664ffdf0dde5c24 +size 17174472 diff --git a/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulatorL.a.meta b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulatorL.a.meta new file mode 100644 index 0000000..cdaff51 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libfmodstudiounitypluginsimulatorL.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 9aed261b7fbc24099a9b58cbbf374583 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios/libresonanceaudio.a b/Assets/Plugins/FMOD/lib/ios/libresonanceaudio.a new file mode 100644 index 0000000..4ec34d4 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libresonanceaudio.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c812e8a9562ea7abca001ab8c90c97d848506de48f3e9d366fc24750acca9405 +size 9222840 diff --git a/Assets/Plugins/FMOD/lib/ios/libresonanceaudio.a.meta b/Assets/Plugins/FMOD/lib/ios/libresonanceaudio.a.meta new file mode 100644 index 0000000..b8a6b21 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libresonanceaudio.a.meta @@ -0,0 +1,61 @@ +fileFormatVersion: 2 +guid: bc5d15d8f7607af478126b815040cbd2 +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 0 + settings: + CPU: None + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 0 + settings: + CPU: None + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/ios/libresonanceaudiosimulator.a b/Assets/Plugins/FMOD/lib/ios/libresonanceaudiosimulator.a new file mode 100644 index 0000000..14f81af --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libresonanceaudiosimulator.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71e68dd2074c913be65ee634fe7b45666c9e7cbd68020408e00c62ef64a541a2 +size 6105984 diff --git a/Assets/Plugins/FMOD/lib/ios/libresonanceaudiosimulator.a.meta b/Assets/Plugins/FMOD/lib/ios/libresonanceaudiosimulator.a.meta new file mode 100644 index 0000000..ad06f69 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/ios/libresonanceaudiosimulator.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 5ad1791b3b48a4ba39c30a2b4f438486 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux.meta b/Assets/Plugins/FMOD/lib/linux.meta new file mode 100644 index 0000000..4ac8b8a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b47242049d92f634aa42fe352278b041 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86.meta b/Assets/Plugins/FMOD/lib/linux/x86.meta new file mode 100644 index 0000000..cbf2c39 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afdb5f99154ccdd4186f76440c2a8bf3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudio.so b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudio.so new file mode 100644 index 0000000..c0f4ad9 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c02626d3bdfb84569d71d0b1939d6eeecbaeb6acce5ca66b2ef7d005191f83c +size 3149952 diff --git a/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudio.so.meta b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudio.so.meta new file mode 100644 index 0000000..c36e88f --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudio.so.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 4495168029c64a340a80fbfa8e0f1209 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: x86 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudioL.so b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudioL.so new file mode 100644 index 0000000..ddadd7a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudioL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a02e309fc539be2321e5d27e4fdf52665b4e32de453759e661477235d5ff1e2 +size 4366976 diff --git a/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudioL.so.meta new file mode 100644 index 0000000..40b9710 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86/libfmodstudioL.so.meta @@ -0,0 +1,82 @@ +fileFormatVersion: 2 +guid: f97044b07bd9b4555b0669530d6ca6f2 +timeCreated: 1481780142 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 1 + Exclude LinuxUniversal: 0 + Exclude OSXIntel: 1 + Exclude OSXIntel64: 1 + Exclude OSXUniversal: 1 + Exclude SamsungTV: 1 + Exclude Tizen: 1 + Exclude WebGL: 1 + Exclude Win: 0 + Exclude Win64: 0 + Exclude iOS: 1 + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: x86 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_15 + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: None + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64.meta b/Assets/Plugins/FMOD/lib/linux/x86_64.meta new file mode 100644 index 0000000..6f2f611 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2977bd0307cd31a42913afa5bcb27f8a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudio.so b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudio.so new file mode 100644 index 0000000..8b9ca2f --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7172d820e81d603fce42429359369853129db6a2c9fc633866c42473ba85aae0 +size 3049640 diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudio.so.meta b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudio.so.meta new file mode 100644 index 0000000..5218650 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudio.so.meta @@ -0,0 +1,65 @@ +fileFormatVersion: 2 +guid: 9063aa11b1fcfcf4cb6030a076d14a30 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_15 + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 0 + settings: + CPU: None + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudioL.so b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudioL.so new file mode 100644 index 0000000..670a579 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudioL.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c3c6b72f840239915b86aa061cf5c9b43c7f864c744dcf322e10146684c747e +size 4041928 diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudioL.so.meta b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudioL.so.meta new file mode 100644 index 0000000..5b580a2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64/libfmodstudioL.so.meta @@ -0,0 +1,65 @@ +fileFormatVersion: 2 +guid: ab75dd6bc4ee544bca23421ff8bff0f9 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_15 + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 0 + settings: + CPU: None + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64/libresonanceaudio.so b/Assets/Plugins/FMOD/lib/linux/x86_64/libresonanceaudio.so new file mode 100644 index 0000000..dc87eb5 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64/libresonanceaudio.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22d175f75d2a216af4bf114e04a24426065fed4e3bdd7227307dcb54cbcfc069 +size 939264 diff --git a/Assets/Plugins/FMOD/lib/linux/x86_64/libresonanceaudio.so.meta b/Assets/Plugins/FMOD/lib/linux/x86_64/libresonanceaudio.so.meta new file mode 100644 index 0000000..7a77080 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/linux/x86_64/libresonanceaudio.so.meta @@ -0,0 +1,69 @@ +fileFormatVersion: 2 +guid: bca6f630c310b4945b52486d2ed1da0a +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: ARMv7 + Any: + enabled: 0 + settings: + CPU: AnyCPU + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Linux + Linux: + enabled: 0 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: None + OSXIntel64: + enabled: 0 + settings: + CPU: None + OSXUniversal: + enabled: 0 + settings: + CPU: None + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_15 + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Assets/Plugins/FMOD/lib/mac.meta b/Assets/Plugins/FMOD/lib/mac.meta new file mode 100644 index 0000000..dc96919 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 69b60a71f98065745802045a52dc9f15 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle.meta new file mode 100644 index 0000000..976e5b5 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle.meta @@ -0,0 +1,68 @@ +fileFormatVersion: 2 +guid: 4f94b6752a0d5ad489274786cbfbc6e5 +folderAsset: yes +timeCreated: 1442816865 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: OSX + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents.meta new file mode 100644 index 0000000..f4f4817 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 2879b055c8551c44caa264ce7208ea17 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/Info.plist b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/Info.plist new file mode 100644 index 0000000..98befae --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + BuildMachineOSBuild + 17G4015 + CFBundleDevelopmentRegion + English + CFBundleExecutable + fmodstudio + CFBundleIdentifier + com.fmod.fmodstudio + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.0 + CSResourcesFileMapped + no + LSRequiresIPhoneOS + + MinimumOSVersion + 10.7 + NSHighResolutionCapable + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/Info.plist.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/Info.plist.meta new file mode 100644 index 0000000..968a02f --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9a03a9a0a1243ba4e9f903c553eeda75 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS.meta new file mode 100644 index 0000000..7c72f6a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4c7ef954631945d4981884adcc603e81 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS/fmodstudio b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS/fmodstudio new file mode 100644 index 0000000..8bc27f9 Binary files /dev/null and b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS/fmodstudio differ diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS/fmodstudio.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS/fmodstudio.meta new file mode 100644 index 0000000..5b10ad2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/MacOS/fmodstudio.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: c5e926e235023354fb6b94bc154a8d2c +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature.meta new file mode 100644 index 0000000..3e14eb2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 070f9d9cae456a440a741d4d8c052479 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature/CodeResources b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature/CodeResources new file mode 100644 index 0000000..d5d0fd7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature/CodeResources.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 0000000..95c4ebb --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudio.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ea91a2c9a5984a489e12e9a48ce9554 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle.meta new file mode 100644 index 0000000..47cb9b0 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle.meta @@ -0,0 +1,68 @@ +fileFormatVersion: 2 +guid: 17156b5dbba3da94e9d70a06add50376 +folderAsset: yes +timeCreated: 1442816865 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: OSX + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 1 + settings: + CPU: AnyCPU + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents.meta new file mode 100644 index 0000000..d28a325 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3ee033c1fbe25354097a9e4f56806fd5 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/Info.plist b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/Info.plist new file mode 100644 index 0000000..2760ee7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + BuildMachineOSBuild + 17G4015 + CFBundleDevelopmentRegion + English + CFBundleExecutable + fmodstudioL + CFBundleIdentifier + com.fmod.fmodstudioL + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.0 + CSResourcesFileMapped + no + LSRequiresIPhoneOS + + MinimumOSVersion + 10.7 + NSHighResolutionCapable + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/Info.plist.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/Info.plist.meta new file mode 100644 index 0000000..1f03a56 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0d04c2f212e12ad41b834389e6401982 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS.meta new file mode 100644 index 0000000..31476a2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d31dcfc39fb2ce943a0f3b1a5fe3d574 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS/fmodstudioL b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS/fmodstudioL new file mode 100644 index 0000000..81c3a62 Binary files /dev/null and b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS/fmodstudioL differ diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS/fmodstudioL.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS/fmodstudioL.meta new file mode 100644 index 0000000..809a441 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/MacOS/fmodstudioL.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccbd5fd69ea0cd145a1b6ab7543f3b8d +timeCreated: 1429825705 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature.meta new file mode 100644 index 0000000..c2bc736 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 45b5ab30fdc9f354db9c68d1bd309490 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources new file mode 100644 index 0000000..d5d0fd7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources.meta b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 0000000..a32d023 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/fmodstudioL.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f06694e4ec5e7dc4b8ed475aa9623e81 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle.meta new file mode 100644 index 0000000..4ba8649 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle.meta @@ -0,0 +1,59 @@ +fileFormatVersion: 2 +guid: 04e20ff877bea8747ae257229c720dcc +folderAsset: yes +timeCreated: 1511469544 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 0 + settings: + CPU: None + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents.meta new file mode 100644 index 0000000..6ac39f0 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a5e43a852000e2443a14695f63ceffd7 +folderAsset: yes +timeCreated: 1511469545 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/Info.plist b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/Info.plist new file mode 100644 index 0000000..95ee74a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/Info.plist @@ -0,0 +1,36 @@ + + + + + BuildMachineOSBuild + 17G4015 + CFBundleDevelopmentRegion + English + CFBundleExecutable + resonanceaudio + CFBundleIdentifier + com.fmod.resonanceaudio + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.0 + CSResourcesFileMapped + no + LSRequiresIPhoneOS + + MinimumOSVersion + 10.7 + NSHighResolutionCapable + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/Info.plist.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/Info.plist.meta new file mode 100644 index 0000000..d40dca7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/Info.plist.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e05b95c28c489764ca23ecd848ed4968 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS.meta new file mode 100644 index 0000000..04da10c --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 242a6e2e6d91dcf45a7ef7bdd7bfe227 +folderAsset: yes +timeCreated: 1511469545 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS/resonanceaudio b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS/resonanceaudio new file mode 100644 index 0000000..2510f4b Binary files /dev/null and b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS/resonanceaudio differ diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS/resonanceaudio.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS/resonanceaudio.meta new file mode 100644 index 0000000..85373b8 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/MacOS/resonanceaudio.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2e2968e9faea7be4ea2b24d5bd144749 +timeCreated: 1511469545 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature.meta new file mode 100644 index 0000000..67e5c9f --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e1530040be7c4545ab48d1688653124 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources new file mode 100644 index 0000000..d5d0fd7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources @@ -0,0 +1,115 @@ + + + + + files + + files2 + + rules + + ^Resources/ + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^Resources/ + + weight + 20 + + ^Resources/.*\.lproj/ + + optional + + weight + 1000 + + ^Resources/.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Resources/Base\.lproj/ + + weight + 1010 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources.meta b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources.meta new file mode 100644 index 0000000..7b79166 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/mac/resonanceaudio.bundle/Contents/_CodeSignature/CodeResources.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f0ba67a2d761cf94a8cf2d5d2cd07b9d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/tvos.meta b/Assets/Plugins/FMOD/lib/tvos.meta new file mode 100644 index 0000000..3380403 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 857bc61def44e6344ba0fa6ab2fb8e9b +folderAsset: yes +timeCreated: 1477604800 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounityplugin.a b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounityplugin.a new file mode 100644 index 0000000..9c8eaee --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounityplugin.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3606fc73bb579f672cf07bfce2bde66b369df1c9ab0b9c03f0b46792011aedd5 +size 36532504 diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounityplugin.a.meta b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounityplugin.a.meta new file mode 100644 index 0000000..eb186b5 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounityplugin.a.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4abc247d0f34143ec95396c7b6bec6a8 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + tvOS: + enabled: 1 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginL.a b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginL.a new file mode 100644 index 0000000..d9a7e9e --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginL.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21bbe693609ec056dccae809829ce700c87e7dc8425d436a7183bf3c9ef73a58 +size 45342224 diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginL.a.meta b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginL.a.meta new file mode 100644 index 0000000..8ac512f --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginL.a.meta @@ -0,0 +1,20 @@ +fileFormatVersion: 2 +guid: 982978af662f9ea43b7979c7f61bbad3 +timeCreated: 1507179416 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulator.a b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulator.a new file mode 100644 index 0000000..046b884 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulator.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bb6de0f569470788168e93e73e455e5d5baa57059333b497412768838a32c87 +size 8112664 diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulator.a.meta b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulator.a.meta new file mode 100644 index 0000000..91e6fe7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulator.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 86d28a38815714041bf19dc4cc59ce65 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulatorL.a b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulatorL.a new file mode 100644 index 0000000..7e9e268 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulatorL.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7eb3bdc10dfe61fb5bf0558aa228fd1feb84e0458418b405c65ae934c83ffff2 +size 11838040 diff --git a/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulatorL.a.meta b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulatorL.a.meta new file mode 100644 index 0000000..a28d94a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/tvos/libfmodstudiounitypluginsimulatorL.a.meta @@ -0,0 +1,113 @@ +fileFormatVersion: 2 +guid: 649598f6abf894e128aa33102756da99 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + Exclude tvOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp.meta b/Assets/Plugins/FMOD/lib/uwp.meta new file mode 100644 index 0000000..1a6eb98 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: be8af5ff3d289a14ba8508f34a77d6bb +folderAsset: yes +timeCreated: 1457062767 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/arm.meta b/Assets/Plugins/FMOD/lib/uwp/arm.meta new file mode 100644 index 0000000..e51475b --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 0cddbb9418c24f44d87fc49581769340 +folderAsset: yes +timeCreated: 1457408139 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmod.dll b/Assets/Plugins/FMOD/lib/uwp/arm/fmod.dll new file mode 100644 index 0000000..b6709d2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33829b8def9e9ae60637ef2344e6875a0f8be350b25a93ae3798d88702451b77 +size 1069568 diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmod.dll.meta b/Assets/Plugins/FMOD/lib/uwp/arm/fmod.dll.meta new file mode 100644 index 0000000..bf1e982 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmod.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 907f4331811d73442b58d50627a775d4 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmodL.dll b/Assets/Plugins/FMOD/lib/uwp/arm/fmodL.dll new file mode 100644 index 0000000..b075ea8 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmodL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:748531c42370a1ed33d1a3ee1ffe6e9487b909b25ad946063962abc36df4afb4 +size 1235968 diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmodL.dll.meta b/Assets/Plugins/FMOD/lib/uwp/arm/fmodL.dll.meta new file mode 100644 index 0000000..0635f92 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmodL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 82bacb4b0f3cc85418d2a1aa2ca57df6 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudio.dll b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudio.dll new file mode 100644 index 0000000..8966296 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a031fc0e8f34539c3f6565ce465c4faff0f4a1ac2436d84ef8e2ae39bf3eac63 +size 668160 diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudio.dll.meta b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudio.dll.meta new file mode 100644 index 0000000..02ad01d --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudio.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: a7c1eb40b6cc0b8468c161b5ba9a6df6 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudioL.dll b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudioL.dll new file mode 100644 index 0000000..23c761a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad76311f5477da89952466bd0a427b3a4289aa454b27e95d86204776e535eb34 +size 1111040 diff --git a/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudioL.dll.meta new file mode 100644 index 0000000..4287f47 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/arm/fmodstudioL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 5476dd86ee3260f4bb2283aef1d9a883 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: ARM + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x64.meta b/Assets/Plugins/FMOD/lib/uwp/x64.meta new file mode 100644 index 0000000..184f917 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 81189b2e21a815647a28e3437c86beb2 +folderAsset: yes +timeCreated: 1457064777 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmod.dll b/Assets/Plugins/FMOD/lib/uwp/x64/fmod.dll new file mode 100644 index 0000000..c7f148a --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da63d03e58fedbcd717ceefd29e80ae9fbd1c6ea188ae97552a451c5024ee043 +size 1533440 diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmod.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x64/fmod.dll.meta new file mode 100644 index 0000000..2ebcd84 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmod.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 68f9a982a926833498d438319388a455 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmodL.dll b/Assets/Plugins/FMOD/lib/uwp/x64/fmodL.dll new file mode 100644 index 0000000..8cdba8c --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmodL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af88efe1359823cb37ded28ba429f3981d425798c20ba36aaa00079fdfc5390d +size 1723904 diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmodL.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x64/fmodL.dll.meta new file mode 100644 index 0000000..fe1d3de --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmodL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: d15f9d3e1089b114a8f625e994fea839 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudio.dll b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudio.dll new file mode 100644 index 0000000..9f24871 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82c4a41c416520ab79577a1317b674e2a4f145bfe459a40cb97d1d8859bd0d18 +size 991232 diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudio.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudio.dll.meta new file mode 100644 index 0000000..7153516 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudio.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 29800d7cce1a5fc46ae163c8a68d8346 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudioL.dll b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudioL.dll new file mode 100644 index 0000000..050a396 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f86a43c606ced57709a492be1abf5de3351ada31b6b2c01202ccfb10fbd1ae91 +size 1457664 diff --git a/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudioL.dll.meta new file mode 100644 index 0000000..c8594af --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x64/fmodstudioL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 813ca429588de5d40b5c8a184a15bcd9 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X64 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x86.meta b/Assets/Plugins/FMOD/lib/uwp/x86.meta new file mode 100644 index 0000000..f9365d2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: fa5c1a42d40246b4a83af1e8192b6bdf +folderAsset: yes +timeCreated: 1457063023 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmod.dll b/Assets/Plugins/FMOD/lib/uwp/x86/fmod.dll new file mode 100644 index 0000000..d81fdc4 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmod.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16970f80d42e1de433d6d1911173e87aa4a5b68bee2b8231722bb89fdb091e11 +size 1299456 diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmod.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x86/fmod.dll.meta new file mode 100644 index 0000000..3b3a7fa --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmod.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 39f9a761a2a032045a853a069db31081 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmodL.dll b/Assets/Plugins/FMOD/lib/uwp/x86/fmodL.dll new file mode 100644 index 0000000..a2c0e76 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmodL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d093de133b41ab8275d3e4f31d71e5d5c9a32bbb02cb891ccdeac93cad08d1f +size 1469952 diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmodL.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x86/fmodL.dll.meta new file mode 100644 index 0000000..12a74a8 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmodL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 243e8fba07980f74b8d49ef345dadd64 +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudio.dll b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudio.dll new file mode 100644 index 0000000..aedf7a6 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008b09556ef45553de8c65c61dd49b8e51de80181d1936e1666126cee898f527 +size 754176 diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudio.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudio.dll.meta new file mode 100644 index 0000000..de2d682 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudio.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: ecb0cc0019197154b9baeef623b6ec0a +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudioL.dll b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudioL.dll new file mode 100644 index 0000000..393d6b1 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudioL.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ff81ec705a40ca914aaeb62c2fc2ea01cb23eb82c72c4e21940ada270737929 +size 1175552 diff --git a/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudioL.dll.meta b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudioL.dll.meta new file mode 100644 index 0000000..37190ff --- /dev/null +++ b/Assets/Plugins/FMOD/lib/uwp/x86/fmodstudioL.dll.meta @@ -0,0 +1,58 @@ +fileFormatVersion: 2 +guid: 43ab9a198caf2d841b813eb81e02486d +timeCreated: 1457408139 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 1 + settings: + CPU: X86 + DontProcess: False + PlaceholderPath: + SDK: UWP + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win.meta b/Assets/Plugins/FMOD/lib/win.meta new file mode 100644 index 0000000..801450b --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6dece3ad8b907764382662199c6bd580 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86.meta b/Assets/Plugins/FMOD/lib/win/x86.meta new file mode 100644 index 0000000..de32cf7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 03f590b69e4afe14fa1c73f89a98a203 +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86/fmodstudio.dll b/Assets/Plugins/FMOD/lib/win/x86/fmodstudio.dll new file mode 100644 index 0000000..82da3e2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21af4baa76f9fcd81ec4ae6d8c5a31050b0e1988e13492770fe9fe7206a3f956 +size 2439680 diff --git a/Assets/Plugins/FMOD/lib/win/x86/fmodstudio.dll.meta b/Assets/Plugins/FMOD/lib/win/x86/fmodstudio.dll.meta new file mode 100644 index 0000000..cda4ae6 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86/fmodstudio.dll.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 1550e5c882b8c2445a1f14f8b1b23d41 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: None + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86/fmodstudiol.dll b/Assets/Plugins/FMOD/lib/win/x86/fmodstudiol.dll new file mode 100644 index 0000000..267efc7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86/fmodstudiol.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f21df7ef1fa83ffbc5ac6c252eced1dee19891eb8a3f7b70090f533fd1d77207 +size 3250176 diff --git a/Assets/Plugins/FMOD/lib/win/x86/fmodstudiol.dll.meta b/Assets/Plugins/FMOD/lib/win/x86/fmodstudiol.dll.meta new file mode 100644 index 0000000..ce236f8 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86/fmodstudiol.dll.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 6e48bf6e640baa24f9e87619d1a61e8d +timeCreated: 1429083373 +licenseType: Pro +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: x86 + Linux64: + enabled: 1 + settings: + CPU: None + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 1 + settings: + CPU: None + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86/resonanceaudio.dll b/Assets/Plugins/FMOD/lib/win/x86/resonanceaudio.dll new file mode 100644 index 0000000..0f60b5f --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86/resonanceaudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3b5b27d0e8fa811882b5e86211dcfbdddc384ef4faecaa32f6a37cdb02a9647 +size 706560 diff --git a/Assets/Plugins/FMOD/lib/win/x86/resonanceaudio.dll.meta b/Assets/Plugins/FMOD/lib/win/x86/resonanceaudio.dll.meta new file mode 100644 index 0000000..ca31234 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86/resonanceaudio.dll.meta @@ -0,0 +1,55 @@ +fileFormatVersion: 2 +guid: b2c11f1e03736f748bd861d7bf4f8952 +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Editor: + enabled: 0 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 1 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86_64.meta b/Assets/Plugins/FMOD/lib/win/x86_64.meta new file mode 100644 index 0000000..11c9bea --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8105cca2fc4eb2e488e010278c3ea1bf +folderAsset: yes +timeCreated: 1432606678 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudio.dll b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudio.dll new file mode 100644 index 0000000..c53d1eb --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a9de73e55d8f354c9433401d680bf5a3346e713d634275627edc3a58d54ed67 +size 3006976 diff --git a/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudio.dll.meta b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudio.dll.meta new file mode 100644 index 0000000..310cbb7 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudio.dll.meta @@ -0,0 +1,78 @@ +fileFormatVersion: 2 +guid: 684d4d47a018ed14080e15f4c99b8e86 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: None + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudiol.dll b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudiol.dll new file mode 100644 index 0000000..1c8776c --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudiol.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32e1fa01c262f4d3485b31839c71358bd64ca543c2321f26f42e8344f23c9a48 +size 3970048 diff --git a/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudiol.dll.meta b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudiol.dll.meta new file mode 100644 index 0000000..939a4f9 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64/fmodstudiol.dll.meta @@ -0,0 +1,80 @@ +fileFormatVersion: 2 +guid: 8514ea8d6deab804895ec1cab6902681 +timeCreated: 1429083373 +licenseType: Pro +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Windows + Linux: + enabled: 1 + settings: + CPU: None + Linux64: + enabled: 1 + settings: + CPU: x86_64 + LinuxUniversal: + enabled: 1 + settings: + CPU: AnyCPU + OSXIntel: + enabled: 1 + settings: + CPU: None + OSXIntel64: + enabled: 1 + settings: + CPU: AnyCPU + OSXUniversal: + enabled: 1 + settings: + CPU: AnyCPU + SamsungTV: + enabled: 0 + settings: + STV_MODEL: STANDARD_13 + WP8: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + WindowsStoreApps: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: False + PlaceholderPath: + SDK: AnySDK + iOS: + enabled: 0 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/lib/win/x86_64/resonanceaudio.dll b/Assets/Plugins/FMOD/lib/win/x86_64/resonanceaudio.dll new file mode 100644 index 0000000..4a3b1a0 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64/resonanceaudio.dll @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fec74c93409d5a8b4b99fc98d0f5629bfdcdad48b170d672af41602bff19aab7 +size 860160 diff --git a/Assets/Plugins/FMOD/lib/win/x86_64/resonanceaudio.dll.meta b/Assets/Plugins/FMOD/lib/win/x86_64/resonanceaudio.dll.meta new file mode 100644 index 0000000..b169bc2 --- /dev/null +++ b/Assets/Plugins/FMOD/lib/win/x86_64/resonanceaudio.dll.meta @@ -0,0 +1,50 @@ +fileFormatVersion: 2 +guid: 4c8fb9b92ea2eae4f9112a3941c4f128 +timeCreated: 1511469552 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Android: + enabled: 0 + settings: + CPU: AnyCPU + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: None + Win64: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/platform_ios.mm b/Assets/Plugins/FMOD/platform_ios.mm new file mode 100644 index 0000000..62b44bd --- /dev/null +++ b/Assets/Plugins/FMOD/platform_ios.mm @@ -0,0 +1,27 @@ +#import +#import + +void (*gSuspendCallback)(bool suspend); + +extern "C" void RegisterSuspendCallback(void (*callback)(bool)) +{ + if (!gSuspendCallback) + { + gSuspendCallback = callback; + + [[NSNotificationCenter defaultCenter] addObserverForName:AVAudioSessionInterruptionNotification object:nil queue:nil usingBlock:^(NSNotification *notification) + { + bool began = [[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] intValue] == AVAudioSessionInterruptionTypeBegan; + + if (!began) + { + [[AVAudioSession sharedInstance] setActive:TRUE error:nil]; + } + + if (gSuspendCallback) + { + gSuspendCallback(began); + } + }]; + } +} diff --git a/Assets/Plugins/FMOD/platform_ios.mm.meta b/Assets/Plugins/FMOD/platform_ios.mm.meta new file mode 100644 index 0000000..6937d22 --- /dev/null +++ b/Assets/Plugins/FMOD/platform_ios.mm.meta @@ -0,0 +1,101 @@ +fileFormatVersion: 2 +guid: fc7eb3c9194584004bdf04921e5cb057 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 0 + Exclude tvOS: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + iPhone: iOS + second: + enabled: 1 + settings: + AddToEmbeddedBinaries: false + CompileFlags: + FrameworkDependencies: + - first: + tvOS: tvOS + second: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src.meta b/Assets/Plugins/FMOD/src.meta new file mode 100644 index 0000000..571d6ca --- /dev/null +++ b/Assets/Plugins/FMOD/src.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 74fccc88986a8934683411b7b6b03e64 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor.meta b/Assets/Plugins/FMOD/src/Editor.meta new file mode 100644 index 0000000..bd0d9b4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: beefffa06690c354c97a5aea51cf213b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs new file mode 100644 index 0000000..53ad587 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs @@ -0,0 +1,66 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomPropertyDrawer(typeof(BankRefAttribute))] + class BankRefDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + Texture browseIcon = EditorGUIUtility.Load("FMOD/SearchIconBlack.png") as Texture; + + SerializedProperty pathProperty = property; + + EditorGUI.BeginProperty(position, label, property); + + Event e = Event.current; + if (e.type == EventType.DragPerform && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + pathProperty.stringValue = ((EditorBankRef)DragAndDrop.objectReferences[0]).Name; + + e.Use(); + } + } + if (e.type == EventType.DragUpdated && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + float baseHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + var buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = buttonStyle.padding.bottom = 1; + + Rect searchRect = new Rect(position.x + position.width - browseIcon.width - 15, position.y, browseIcon.width + 10, baseHeight); + Rect pathRect = new Rect(position.x, position.y, searchRect.x - position.x - 5, baseHeight); + + EditorGUI.PropertyField(pathRect, pathProperty, GUIContent.none); + if (GUI.Button(searchRect, new GUIContent(browseIcon, "Select FMOD Bank"), buttonStyle)) + { + var eventBrowser = EventBrowser.CreateInstance(); + + eventBrowser.SelectBank(property); + var windowRect = position; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = searchRect.height + 1; + eventBrowser.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 400)); + } + + EditorGUI.EndProperty(); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs.meta new file mode 100644 index 0000000..347474f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/BankRefDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 49ebe6fea5e4bfc4bb492bba062b2afe +timeCreated: 1433209573 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs new file mode 100644 index 0000000..675e595 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs @@ -0,0 +1,386 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + class CreateEventPopup : EditorWindow + { + class FolderEntry + { + public FolderEntry parent; + public string name; + public string guid; + public List entries = new List(); + public Rect rect; + } + + SerializedProperty outputProperty; + internal void SelectEvent(SerializedProperty property) + { + outputProperty = property; + } + + class BankEntry + { + public string name; + public string guid; + } + + FolderEntry rootFolder; + FolderEntry currentFolder; + List banks; + + public CreateEventPopup() + { + } + + private void BuildTree() + { + var rootGuid = EditorUtils.GetScriptOutput("studio.project.workspace.masterEventFolder.id"); + rootFolder = new FolderEntry(); + rootFolder.guid = rootGuid; + BuildTreeItem(rootFolder); + wantsMouseMove = true; + banks = new List(); + + EditorUtils.GetScriptOutput("children = \"\";"); + EditorUtils.GetScriptOutput("func = function(val) {{ children += \",\" + val.id + val.name; }};"); + EditorUtils.GetScriptOutput("studio.project.workspace.masterBankFolder.items.forEach(func, this); "); + string bankList = EditorUtils.GetScriptOutput("children;"); + string[] bankListSplit = bankList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + foreach(var bank in bankListSplit) + { + var entry = new BankEntry(); + entry.guid = bank.Substring(0, 38); + entry.name = bank.Substring(38); + banks.Add(entry); + } + + banks.Sort((a, b) => a.name.CompareTo(b.name)); + } + + private void BuildTreeItem(FolderEntry entry) + { + // lookup the entry + EditorUtils.GetScriptOutput(string.Format("cur = studio.project.lookup(\"{0}\");", entry.guid)); + + // get child count + string itemCountString = EditorUtils.GetScriptOutput("cur.items.length;"); + int itemCount; + Int32.TryParse(itemCountString, out itemCount); + + // iterate children looking for folder + for (int item = 0; item < itemCount; item++) + { + EditorUtils.GetScriptOutput(String.Format("child = cur.items[{0}]", item)); + + // check if it's a folder + string isFolder = EditorUtils.GetScriptOutput("child.isOfExactType(\"EventFolder\")"); + if (isFolder == "false") + { + continue; + } + + // Get guid and name + string info = EditorUtils.GetScriptOutput("child.id + child.name"); + + var childEntry = new FolderEntry(); + childEntry.guid = info.Substring(0, 38); + childEntry.name = info.Substring(38); + childEntry.parent = entry; + entry.entries.Add(childEntry); + } + + // Recurse for child entries + foreach(var childEntry in entry.entries) + { + BuildTreeItem(childEntry); + } + } + + int lastHover = 0; + string eventFolder = "/"; + string eventName = ""; + string currentFilter = ""; + int selectedBank = 0; + bool resetCursor = true; + Vector2 scrollPos = new Vector2(); + Rect scrollRect = new Rect(); + bool isConnected = false; + + public void OnGUI() + { + var borderIcon = EditorGUIUtility.Load("FMOD/Border.png") as Texture2D; + var border = new GUIStyle(GUI.skin.box); + border.normal.background = borderIcon; + GUI.Box(new Rect(1, 1, position.width - 1, position.height - 1), GUIContent.none, border); + + if (Event.current.type == EventType.Layout) + { + isConnected = EditorUtils.IsConnectedToStudio(); + } + + if (!isConnected) + { + this.ShowNotification(new GUIContent("FMOD Studio not running")); + return; + } + + this.RemoveNotification(); + + if (rootFolder == null) + { + BuildTree(); + currentFolder = rootFolder; + } + + var arrowIcon = EditorGUIUtility.Load("FMOD/ArrowIcon.png") as Texture; + var hoverIcon = EditorGUIUtility.Load("FMOD/SelectedAlt.png") as Texture2D; + var titleIcon = EditorGUIUtility.Load("IN BigTitle") as Texture2D; + + var nextEntry = currentFolder; + + var filteredEntries = currentFolder.entries.FindAll((x) => x.name.StartsWith(currentFilter, StringComparison.CurrentCultureIgnoreCase)); + + // Process key strokes for the folder list + { + if (Event.current.keyCode == KeyCode.UpArrow) + { + if (Event.current.type == EventType.KeyDown) + { + lastHover = Math.Max(lastHover - 1, 0); + if (filteredEntries[lastHover].rect.y < scrollPos.y) + { + scrollPos.y = filteredEntries[lastHover].rect.y; + } + } + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.DownArrow) + { + if (Event.current.type == EventType.KeyDown) + { + lastHover = Math.Min(lastHover + 1, filteredEntries.Count - 1); + if (filteredEntries[lastHover].rect.y + filteredEntries[lastHover].rect.height > scrollPos.y + scrollRect.height) + { + scrollPos.y = filteredEntries[lastHover].rect.y - scrollRect.height + filteredEntries[lastHover].rect.height * 2; + } + } + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.RightArrow) + { + if (Event.current.type == EventType.KeyDown) + nextEntry = filteredEntries[lastHover]; + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.LeftArrow) + { + if (Event.current.type == EventType.KeyDown) + if (currentFolder.parent != null) + { + nextEntry = currentFolder.parent; + } + Event.current.Use(); + } + } + + bool disabled = eventName.Length == 0; + EditorGUI.BeginDisabledGroup(disabled); + if (GUILayout.Button("Create Event")) + { + CreateEventInStudio(); + this.Close(); + } + EditorGUI.EndDisabledGroup(); + + { + GUI.SetNextControlName("name"); + + EditorGUILayout.LabelField("Name"); + eventName = EditorGUILayout.TextField(eventName); + } + + { + EditorGUILayout.LabelField("Bank"); + selectedBank = EditorGUILayout.Popup(selectedBank, banks.Select(x => x.name).ToArray()); + } + + bool updateEventPath = false; + { + GUI.SetNextControlName("folder"); + EditorGUI.BeginChangeCheck(); + EditorGUILayout.LabelField("Path"); + eventFolder = GUILayout.TextField(eventFolder); + if (EditorGUI.EndChangeCheck()) + { + updateEventPath = true; + } + } + + if (resetCursor) + { + resetCursor = false; + + var textEditor = (TextEditor)GUIUtility.GetStateObject(typeof(TextEditor), GUIUtility.keyboardControl); + if (textEditor != null) + { + textEditor.MoveCursorToPosition(new Vector2(9999, 9999)); + } + } + + // Draw the current folder as a title bar, click to go back one level + { + Rect currentRect = EditorGUILayout.GetControlRect(); + + var bg = new GUIStyle(GUI.skin.box); + bg.normal.background = titleIcon; + Rect bgRect = new Rect(currentRect); + bgRect.x = 2; + bgRect.width = position.width-4; + GUI.Box(bgRect, GUIContent.none, bg); + + Rect textureRect = currentRect; + textureRect.width = arrowIcon.width; + if (currentFolder.name != null) + { + GUI.DrawTextureWithTexCoords(textureRect, arrowIcon, new Rect(1, 1, -1, -1)); + } + + Rect labelRect = currentRect; + labelRect.x += arrowIcon.width + 50; + labelRect.width -= arrowIcon.width + 50; + GUI.Label(labelRect, currentFolder.name != null ? currentFolder.name : "Folders", EditorStyles.boldLabel); + + if (Event.current.type == EventType.MouseDown && currentRect.Contains(Event.current.mousePosition) && + currentFolder.parent != null) + { + nextEntry = currentFolder.parent; + Event.current.Use(); + } + } + + var normal = new GUIStyle(GUI.skin.label); + normal.padding.left = 14; + var hover = new GUIStyle(normal); + hover.normal.background = hoverIcon; + + scrollPos = EditorGUILayout.BeginScrollView(scrollPos, false, false); + + for (int i = 0; i < filteredEntries.Count; i++) + { + var entry = filteredEntries[i]; + var content = new GUIContent(entry.name); + var rect = EditorGUILayout.GetControlRect(); + if ((rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseMove) || i == lastHover) + { + lastHover = i; + + GUI.Label(rect, content, hover); + if (rect.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseDown) + { + nextEntry = entry; + } + } + else + { + GUI.Label(rect, content, normal); + } + + Rect textureRect = rect; + textureRect.x = textureRect.width - arrowIcon.width; + textureRect.width = arrowIcon.width; + GUI.DrawTexture(textureRect, arrowIcon); + + if (Event.current.type == EventType.Repaint) + { + entry.rect = rect; + } + } + EditorGUILayout.EndScrollView(); + + if (Event.current.type == EventType.Repaint) + { + scrollRect = GUILayoutUtility.GetLastRect(); + } + + if (currentFolder != nextEntry) + { + lastHover = 0; + currentFolder = nextEntry; + UpdateTextFromList(); + Repaint(); + } + + if (updateEventPath) + { + UpdateListFromText(); + } + + if (Event.current.type == EventType.MouseMove) + { + Repaint(); + } + } + + private void CreateEventInStudio() + { + string eventGuid = EditorUtils.CreateStudioEvent(eventFolder, eventName); + + if (!string.IsNullOrEmpty(eventGuid)) + { + EditorUtils.GetScriptOutput(String.Format("studio.project.lookup(\"{0}\").relationships.banks.add(studio.project.lookup(\"{1}\"));", eventGuid, banks[selectedBank].guid)); + EditorUtils.GetScriptOutput("studio.project.build();"); + + string fullPath = "event:" + eventFolder + eventName; + outputProperty.stringValue = fullPath; + EditorUtils.UpdateParamsOnEmitter(outputProperty.serializedObject, fullPath); + outputProperty.serializedObject.ApplyModifiedProperties(); + } + } + + private void UpdateListFromText() + { + int endFolders = eventFolder.LastIndexOf("/"); + currentFilter = eventFolder.Substring(endFolders + 1); + + var folders = eventFolder.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + FolderEntry entry = rootFolder; + int i; + for (i = 0; i < folders.Length; i++) + { + var newEntry = entry.entries.Find((x) => x.name.Equals(folders[i], StringComparison.CurrentCultureIgnoreCase)); + if (newEntry == null) + { + break; + } + entry = newEntry; + } + currentFolder = entry; + + // Treat an exact filter match as being in that folder and clear the filter + if (entry.name != null && entry.name.Equals(currentFilter, StringComparison.CurrentCultureIgnoreCase)) + { + currentFilter = ""; + } + } + + private void UpdateTextFromList() + { + string path = ""; + var entry = currentFolder; + while (entry.parent != null) + { + path = entry.name + "/" + path; + entry = entry.parent; + } + + eventFolder = "/" + path; + resetCursor = true; + currentFilter = ""; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs.meta b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs.meta new file mode 100644 index 0000000..7920717 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/CreateEventPopup.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9c9773a32ed4a2b429fd42645175c32b +timeCreated: 1455063674 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs new file mode 100644 index 0000000..fb73451 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +namespace FMODUnity +{ + public class EditorBankRef : ScriptableObject + { + public static string CalculateName(string filePath, string basePath) + { + string relativePath = filePath.Substring(basePath.Length + 1); + string extension = System.IO.Path.GetExtension(relativePath); + + string name = relativePath.Substring(0, relativePath.Length - extension.Length); + name = RuntimeUtils.GetCommonPlatformPath(name); + + return name; + } + + public void SetPath(string filePath, string basePath) + { + Path = RuntimeUtils.GetCommonPlatformPath(filePath); + Name = CalculateName(filePath, basePath); + base.name = "bank:/" + Name + System.IO.Path.GetExtension(filePath); + } + + [Serializable] + public class NameValuePair + { + public string Name; + public long Value; + + public NameValuePair(string name, long value) + { + Name = name; + Value = value; + } + } + + [SerializeField] + public string Path; + + [SerializeField] + public string Name; + + [SerializeField] + Int64 lastModified; + public DateTime LastModified + { + get { return new DateTime(lastModified); } + set { lastModified = value.Ticks; } + } + + [SerializeField] + public FMOD.RESULT LoadResult; + + [SerializeField] + public List FileSizes; + + public bool Exists; + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs.meta new file mode 100644 index 0000000..2a0425f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorBankRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c18180ecb35941f4682ae60107b85b7c +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs new file mode 100644 index 0000000..7053174 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + public class EditorEventRef : ScriptableObject + { + [SerializeField] + public string Path; + + [SerializeField] + byte[] guid = new byte[16]; + public Guid Guid + { + get { return new Guid(guid); } + set { Array.Copy(value.ToByteArray(), guid, 16); } + } + + [SerializeField] + public List Banks; + [SerializeField] + public bool IsStream; + [SerializeField] + public bool Is3D; + [SerializeField] + public bool IsOneShot; + [SerializeField] + public List Parameters; + [SerializeField] + public float MinDistance; + [SerializeField] + public float MaxDistance; + [SerializeField] + public int Length; + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs.meta new file mode 100644 index 0000000..9cab898 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorEventRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ceb653cd98e289a4e8697a1af55201f2 +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs new file mode 100644 index 0000000..c2eaffa --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + public class EditorParamRef : ScriptableObject + { + [SerializeField] + public string Name; + [SerializeField] + public float Min; + [SerializeField] + public float Max; + [SerializeField] + public float Default; + [SerializeField] + public FMOD.Studio.PARAMETER_ID ID; + + public bool Exists; + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs.meta new file mode 100644 index 0000000..5d50165 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorParamRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: fecb8ef7f94ca804a8ab72049b86782e +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs new file mode 100644 index 0000000..2b2d1d4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs @@ -0,0 +1,914 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using System.IO; +using System.Text; +using System.Net.Sockets; + +namespace FMODUnity +{ + public enum PreviewState + { + Stopped, + Playing, + Paused, + } + + [InitializeOnLoad] + class EditorUtils : MonoBehaviour + { + public static void CheckResult(FMOD.RESULT result) + { + if (result != FMOD.RESULT.OK) + { + UnityEngine.Debug.LogError(string.Format("FMOD Studio: Encounterd Error: {0} {1}", result, FMOD.Error.String(result))); + } + } + + public const string BuildFolder = "Build"; + + public static string GetBankDirectory() + { + if (Settings.Instance.HasSourceProject && !String.IsNullOrEmpty(Settings.Instance.SourceProjectPath)) + { + string projectPath = Settings.Instance.SourceProjectPath; + string projectFolder = Path.GetDirectoryName(projectPath); + return Path.Combine(projectFolder, BuildFolder); + } + else if (!String.IsNullOrEmpty(Settings.Instance.SourceBankPath)) + { + return Path.GetFullPath(Settings.Instance.SourceBankPath); + } + return null; + } + + public static void ValidateSource(out bool valid, out string reason) + { + valid = true; + reason = ""; + var settings = Settings.Instance; + if (settings.HasSourceProject) + { + if (string.IsNullOrEmpty(settings.SourceProjectPath)) + { + valid = false; + reason = "The FMOD Studio project path must be set to an .fspro file."; + return; + } + if (!File.Exists(settings.SourceProjectPath)) + { + valid = false; + reason = string.Format("The FMOD Studio project path '{0}' does not exist.", settings.SourceProjectPath); + return; + } + + string projectPath = settings.SourceProjectPath; + string projectFolder = Path.GetDirectoryName(projectPath); + string buildFolder = Path.Combine(projectFolder, BuildFolder); + if (!Directory.Exists(buildFolder) || + Directory.GetDirectories(buildFolder).Length == 0 || + Directory.GetFiles(Directory.GetDirectories(buildFolder)[0], "*.bank", SearchOption.AllDirectories).Length == 0 + ) + { + valid = false; + reason = string.Format("The FMOD Studio project '{0}' does not contain any built banks. Please build your project in FMOD Studio.", settings.SourceProjectPath); + return; + } + } + else + { + if (String.IsNullOrEmpty(settings.SourceBankPath)) + { + valid = false; + reason = "The build path has not been set."; + return; + } + if (!Directory.Exists(settings.SourceBankPath)) + { + valid = false; + reason = string.Format("The build path '{0}' does not exist.", settings.SourceBankPath); + return; + } + + if (settings.HasPlatforms) + { + if (Directory.GetDirectories(settings.SourceBankPath).Length == 0) + { + valid = false; + reason = string.Format("Build path '{0}' does not contain any platform sub-directories. Please check that the build path is correct.", settings.SourceBankPath); + return; + } + } + else + { + if (Directory.GetFiles(settings.SourceBankPath, "*.strings.bank").Length == 0) + { + valid = false; + reason = string.Format("Build path '{0}' does not contain any built banks.", settings.SourceBankPath); + return; + } + } + } + } + + public static string[] GetBankPlatforms() + { + string buildFolder = Settings.Instance.SourceBankPath; + try + { + if (Directory.GetFiles(buildFolder, "*.bank").Length == 0) + { + string[] buildDirectories = Directory.GetDirectories(buildFolder); + string[] buildNames = new string[buildDirectories.Length]; + for (int i = 0; i < buildDirectories.Length; i++) + { + buildNames[i] = Path.GetFileNameWithoutExtension(buildDirectories[i]); + } + return buildNames; + } + } + catch + { + } + return new string[0]; + } + + static string VerionNumberToString(uint version) + { + uint major = (version & 0x00FF0000) >> 16; + uint minor = (version & 0x0000FF00) >> 8; + uint patch = (version & 0x000000FF); + + return major.ToString("X1") + "." + minor.ToString("X2") + "." + patch.ToString("X2"); + } + + static EditorUtils() + { + EditorApplication.update += Update; + AssemblyReloadEvents.beforeAssemblyReload += HandleBeforeAssemblyReload; + EditorApplication.playModeStateChanged += HandleOnPlayModeChanged; + EditorApplication.pauseStateChanged += HandleOnPausedModeChanged; + } + + static void HandleBeforeAssemblyReload() + { + DestroySystem(); + } + + static void HandleOnPausedModeChanged(PauseState state) + { + if (RuntimeManager.IsInitialized && RuntimeManager.HasBanksLoaded) + { + RuntimeManager.GetBus("bus:/").setPaused(EditorApplication.isPaused); + RuntimeManager.StudioSystem.update(); + } + } + + static void HandleOnPlayModeChanged(PlayModeStateChange state) + { + // Entering Play Mode will cause scripts to reload, losing all state + // This is the last chance to clean up FMOD and avoid a leak. + if (state == PlayModeStateChange.ExitingEditMode) + { + DestroySystem(); + } + } + + static void Update() + { + // Update the editor system + if (system.isValid()) + { + CheckResult(system.update()); + } + + if (previewEventInstance.isValid()) + { + FMOD.Studio.PLAYBACK_STATE state; + previewEventInstance.getPlaybackState(out state); + if (previewState == PreviewState.Playing && state == FMOD.Studio.PLAYBACK_STATE.STOPPED) + { + PreviewStop(); + } + } + } + + static FMOD.Studio.System system; + + static void DestroySystem() + { + if (system.isValid()) + { + UnityEngine.Debug.Log("FMOD Studio: Destroying editor system instance"); + system.release(); + system.clearHandle(); + } + } + + static void CreateSystem() + { + UnityEngine.Debug.Log("FMOD Studio: Creating editor system instance"); + RuntimeUtils.EnforceLibraryOrder(); + + FMOD.RESULT result = FMOD.Debug.Initialize(FMOD.DEBUG_FLAGS.LOG, FMOD.DEBUG_MODE.FILE, null, "fmod_editor.log"); + if (result != FMOD.RESULT.OK) + { + UnityEngine.Debug.LogWarning("FMOD Studio: Cannot open fmod_editor.log. Logging will be disabled for importing and previewing"); + } + + CheckResult(FMOD.Studio.System.create(out system)); + + FMOD.System lowlevel; + CheckResult(system.getCoreSystem(out lowlevel)); + + // Use play-in-editor speaker mode for event browser preview and metering + lowlevel.setSoftwareFormat(0, (FMOD.SPEAKERMODE)Settings.Instance.GetSpeakerMode(FMODPlatform.Default),0 ); + + CheckResult(system.initialize(256, FMOD.Studio.INITFLAGS.ALLOW_MISSING_PLUGINS | FMOD.Studio.INITFLAGS.SYNCHRONOUS_UPDATE, FMOD.INITFLAGS.NORMAL, IntPtr.Zero)); + + FMOD.ChannelGroup master; + CheckResult(lowlevel.getMasterChannelGroup(out master)); + FMOD.DSP masterHead; + CheckResult(master.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, out masterHead)); + CheckResult(masterHead.setMeteringEnabled(false, true)); + } + + public static void UpdateParamsOnEmitter(SerializedObject serializedObject, string path) + { + if (string.IsNullOrEmpty(path) || EventManager.EventFromPath(path) == null) + { + return; + } + + var eventRef = EventManager.EventFromPath(path); + serializedObject.ApplyModifiedProperties(); + if (serializedObject.isEditingMultipleObjects) + { + foreach (var obj in serializedObject.targetObjects) + { + UpdateParamsOnEmitter(obj, eventRef); + } + } + else + { + UpdateParamsOnEmitter(serializedObject.targetObject, eventRef); + } + serializedObject.Update(); + } + + private static void UpdateParamsOnEmitter(UnityEngine.Object obj, EditorEventRef eventRef) + { + var emitter = obj as StudioEventEmitter; + if (emitter == null) + { + // Custom game object + return; + } + + for (int i = 0; i < emitter.Params.Length; i++) + { + if (!eventRef.Parameters.Exists((x) => x.Name == emitter.Params[i].Name)) + { + int end = emitter.Params.Length - 1; + emitter.Params[i] = emitter.Params[end]; + Array.Resize(ref emitter.Params, end); + i--; + } + } + } + + public static FMOD.Studio.System System + { + get + { + if (!system.isValid()) + { + CreateSystem(); + } + return system; + } + } + + [MenuItem("FMOD/Help/Integration Manual", priority = 3)] + static void OnlineManual() + { + Application.OpenURL("https://fmod.com/resources/documentation-unity"); + } + + [MenuItem("FMOD/Help/API Documentation", priority = 4)] + static void OnlineAPIDocs() + { + Application.OpenURL("https://fmod.com/resources/documentation-api"); + } + + [MenuItem("FMOD/Help/Support Forum", priority = 5)] + static void OnlineQA() + { + Application.OpenURL("https://qa.fmod.com/"); + } + + [MenuItem("FMOD/Help/Revision History", priority = 6)] + static void OnlineRevisions() + { + Application.OpenURL("https://fmod.com/resources/documentation-api?version=2.0&page=welcome-revision-history.html"); + } + + [MenuItem("FMOD/About Integration", priority = 7)] + public static void About() + { + FMOD.System lowlevel; + CheckResult(System.getCoreSystem(out lowlevel)); + + uint version; + CheckResult(lowlevel.getVersion(out version)); + + EditorUtility.DisplayDialog("FMOD Studio Unity Integration", "Version: " + VerionNumberToString(version) + "\n\nCopyright \u00A9 Firelight Technologies Pty, Ltd. 2014-2020 \n\nSee LICENSE.TXT for additional license information.", "OK"); + } + + [MenuItem("FMOD/Consolidate Plugin Files")] + public static void FolderMerge() + { + string root = "Assets/Plugins/FMOD"; + string lib = root + "/lib"; + string src = root + "/src"; + string runtime = src + "/Runtime"; + string editor = src + "/Editor"; + string addons = root + "/addons"; + + bool merge = EditorUtility.DisplayDialog("FMOD Plugin Consolidator", "This will consolidate most of the FMOD files into a single directory (Assets/Plugins/FMOD), only if the files have not been moved from their original location.\n\nThis should only need to be done if upgrading from before 2.0.", "OK", "Cancel"); + if (merge) + { + if (!Directory.Exists(addons)) + AssetDatabase.CreateFolder(root, "addons"); + if (!Directory.Exists(src)) + AssetDatabase.CreateFolder(root, "src"); + if (!Directory.Exists(runtime)) + AssetDatabase.CreateFolder(src, "Runtime"); + if (!Directory.Exists(lib)) + AssetDatabase.CreateFolder(root, "lib"); + if (!Directory.Exists(lib + "/mac")) + AssetDatabase.CreateFolder(lib, "mac"); + if (!Directory.Exists(lib + "/win")) + AssetDatabase.CreateFolder(lib, "win"); + if (!Directory.Exists(lib + "/linux")) + AssetDatabase.CreateFolder(lib, "linux"); + if (!Directory.Exists(lib + "/linux/x86")) + AssetDatabase.CreateFolder(lib + "/linux", "x86"); + if (!Directory.Exists(lib + "/linux/x86_64")) + AssetDatabase.CreateFolder(lib + "/linux", "x86_64"); + if (!Directory.Exists(lib + "/android")) + AssetDatabase.CreateFolder(lib, "android"); + + // Scripts + var files = Directory.GetFiles(root, "*.cs", SearchOption.TopDirectoryOnly); + foreach (var filePath in files) + { + MoveAsset(filePath, runtime + "/" + Path.GetFileName(filePath)); + } + MoveAsset(root + "/fmodplugins.cpp", runtime + "/fmodplugins.cpp"); + MoveAsset(root + "/Timeline", runtime + "/Timeline"); + MoveAsset("Assets/Plugins/FMOD/Wrapper", runtime + "/wrapper"); + MoveAsset("Assets/Plugins/Editor/FMOD", editor); + MoveAsset("Assets/Plugins/Editor/FMOD/Timeline", editor + "/Timeline"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/FMOD/Runtime") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/FMOD/Runtime" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/FMOD/Runtime"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/Editor/FMOD") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/Editor/FMOD" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/Editor/FMOD"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/Editor") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/Editor" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/Editor"); + // GoogleVR + if (AssetDatabase.IsValidFolder("Assets/GoogleVR")) + MoveAsset("Assets/GoogleVR", addons + "/GoogleVR"); + // ResonanceAudio + MoveAsset("Assets/ResonanceAudio", addons + "/ResonanceAudio"); + // GVR Audio + if (AssetDatabase.IsValidFolder("Assets/Plugins/gvraudio.bundle")) + MoveAsset("Assets/Plugins/gvraudio.bundle", lib + "/mac/gvraudio.bundle"); + // Cache files + MoveAsset("Assets/Resources/FMODStudioSettings.asset", root + "/Resources/FMODStudioSettings.asset"); + if (AssetDatabase.IsValidFolder("Assets/Resources") && AssetDatabase.FindAssets("", new string[] { "Assets/Resources" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Resources"); + MoveAsset("Assets/FMODStudioCache.asset", root + "/Resources/FMODStudioCache.asset"); + if (AssetDatabase.FindAssets("Assets/FMODStudioCache.asset").Length != 0) + AssetDatabase.MoveAssetToTrash("Assets/FMODStudioCache.asset"); + // Android libs + string[] archs = new string[] { "armeabi-v7a", "x86", "arm64-v8a" }; + foreach (string arch in archs) + { + MoveAsset("Assets/Plugins/Android/libs/" + arch + "/libfmod.so", lib + "/android/" + arch + "/libfmod.so"); + MoveAsset("Assets/Plugins/Android/libs/" + arch + "/libfmodL.so", lib + "/android/" + arch + "/libfmodL.so"); + MoveAsset("Assets/Plugins/Android/libs/" + arch + "/libfmodstudio.so", lib + "/android/" + arch + "/libfmodstudio.so"); + MoveAsset("Assets/Plugins/Android/libs/" + arch + "/libfmodstudioL.so", lib + "/android/" + arch + "/libfmodstudioL.so"); + MoveAsset("Assets/Plugins/Android/libs/" + arch + "/libresonanceaudio.so", lib + "/android/" + arch + "/libresonanceaudio.so"); + MoveAsset("Assets/Plugins/Android/libs/" + arch + "/libgvraudio.so", lib + "/android/" + arch + "/libgvraudio.so"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/Android/libs/" + arch) && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/Android/libs/" + arch }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/Android/libs/" + arch); + } + MoveAsset("Assets/Plugins/Android/fmod.jar", lib + "/android/fmod.jar"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/Android/libs") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/Android/libs" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/Android/libs"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/Android") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/Android" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/Android"); + AssetDatabase. + // Mac libs + MoveAsset("Assets/Plugins/fmodstudio.bundle", lib + "/mac/fmodstudio.bundle"); + MoveAsset("Assets/Plugins/fmodstudioL.bundle", lib + "/mac/fmodstudioL.bundle"); + MoveAsset("Assets/Plugins/resonanceaudio.bundle", lib + "/mac/resonanceaudio.bundle"); + // iOS libs + MoveAsset("Assets/Plugins/iOS/libfmodstudiounityplugin.a", lib + "/ios/libfmodstudiounityplugin.a"); + MoveAsset("Assets/Plugins/iOS/libfmodstudiounitypluginL.a", lib + "/ios/libfmodstudiounitypluginL.a"); + MoveAsset("Assets/Plugins/iOS/libgvraudio.a", lib + "/ios/libgvraudio.a"); + MoveAsset("Assets/Plugins/iOS/libresonanceaudio.a", lib + "/ios/libresonanceaudio.a"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/iOS") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/iOS" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/iOS"); + // tvOS libs + MoveAsset("Assets/Plugins/tvOS/libfmodstudiounityplugin.a", lib + "/tvos/libfmodstudiounityplugin.a"); + MoveAsset("Assets/Plugins/tvOS/libfmodstudiounitypluginL.a", lib + "/tvos/libfmodstudiounitypluginL.a"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/tvOS") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/tvOS" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/tvOS"); + // UWP libs + archs = new string[] { "arm", "x64", "x86" }; + foreach (string arch in archs) + { + MoveAsset("Assets/Plugins/UWP/" + arch + "/fmod.dll", lib + "/uwp/" + arch + "/fmod.dll"); + MoveAsset("Assets/Plugins/UWP/" + arch + "/fmodL.dll", lib + "/uwp/" + arch + "/fmodL.dll"); + MoveAsset("Assets/Plugins/UWP/" + arch + "/fmodstudio.dll", lib + "/uwp/" + arch + "/fmodstudio.dll"); + MoveAsset("Assets/Plugins/UWP/" + arch + "/fmodstudioL.dll", lib + "/uwp/" + arch + "/fmodstudioL.dll"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/UWP/" + arch) && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/UWP/" + arch }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/UWP/" + arch); + } + if (AssetDatabase.IsValidFolder("Assets/Plugins/UWP") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/UWP" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/UWP"); + // HTML5 libs + MoveAsset("Assets/Plugins/WebGL/libfmodstudiounityplugin.bc", lib + "/html5/libfmodstudiounityplugin.bc"); + MoveAsset("Assets/Plugins/WebGL/libfmodstudiounitypluginL.bc", lib + "/html5/libfmodstudiounitypluginL.bc"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/WebGL") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/WebGL" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/WebGL"); + // PS4 libs (optional) + if (AssetDatabase.IsValidFolder("Assets/Plugins/PS4")) + { + MoveAsset("Assets/Plugins/PS4/libfmod.prx", lib + "/ps4/libfmod.prx"); + MoveAsset("Assets/Plugins/PS4/libfmodL.prx", lib + "/ps4/libfmodL.prx"); + MoveAsset("Assets/Plugins/PS4/libfmodstudio.prx", lib + "/ps4/libfmodstudio.prx"); + MoveAsset("Assets/Plugins/PS4/libfmodstudioL.prx", lib + "/ps4/libfmodstudioL.prx"); + MoveAsset("Assets/Plugins/PS4/resonanceaudio.prx", lib + "/ps4/resonanceaudio.prx"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/PS4") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/PS4" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/PS4"); + } + // Switch libs (optional) + if (AssetDatabase.IsValidFolder("Assets/Plugins/Switch")) + { + MoveAsset("Assets/Plugins/Switch/libfmodstudiounityplugin.a", lib + "/switch/libfmodstudiounityplugin.a"); + MoveAsset("Assets/Plugins/Switch/libfmodstudiounitypluginL.a", lib + "/switch/libfmodstudiounitypluginL.a"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/Switch") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/Switch" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/Switch"); + } + // Xbox One libs (optional) + if (AssetDatabase.IsValidFolder("Assets/Plugins/XboxOne")) + { + MoveAsset("Assets/Plugins/XboxOne/fmod.dll", lib + "/xboxone/fmod.dll"); + MoveAsset("Assets/Plugins/XboxOne/fmodL.dll", lib + "/xboxone/fmodL.dll"); + MoveAsset("Assets/Plugins/XboxOne/fmodstudio.dll", lib + "/xboxone/fmodstudio.dll"); + MoveAsset("Assets/Plugins/XboxOne/fmodstudioL.dll", lib + "/xboxone/fmodstudioL.dll"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/XboxOne") && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/XboxOne" }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/XboxOne"); + } + // Linux libs + archs = new string[] { "x86", "x86_64" }; + foreach (string arch in archs) + { + MoveAsset("Assets/Plugins/" + arch + "/libfmod.so", lib + "/linux/" + arch + "/libfmod.so"); + MoveAsset("Assets/Plugins/" + arch + "/libfmodL.so", lib + "/linux/" + arch + "/libfmodL.so"); + MoveAsset("Assets/Plugins/" + arch + "/libfmodstudio.so", lib + "/linux/" + arch + "/libfmodstudio.so"); + MoveAsset("Assets/Plugins/" + arch + "/libfmodstudioL.so", lib + "/linux/" + arch + "/libfmodstudio.so"); + MoveAsset("Assets/Plugins/" + arch + "/libgvraudio.so", lib + "/linux/" + arch + "/libgvraudio.so"); + MoveAsset("Assets/Plugins/" + arch + "/libresonanceaudio.so", lib + "/linux/" + arch + "/libresonanceaudio.so"); + // The folders will be deleted after the windows libs are moved. + } + // Windows libs + foreach (string arch in archs) + { + MoveAsset("Assets/Plugins/" + arch + "/fmodstudio.dll", lib + "/win/" + arch + "/fmodstudio.dll"); + MoveAsset("Assets/Plugins/" + arch + "/fmodstudioL.dll", lib + "/win/" + arch + "/fmodstudioL.dll"); + MoveAsset("Assets/Plugins/" + arch + "/gvraudio.dll", lib + "/win/" + arch + "/gvraudio.dll"); + MoveAsset("Assets/Plugins/" + arch + "/resonanceaudio.dll", lib + "/win/" + arch + "/resonanceaudio.dll"); + if (AssetDatabase.IsValidFolder("Assets/Plugins/" + arch) && AssetDatabase.FindAssets("", new string[] { "Assets/Plugins/" + arch }).Length == 0) + AssetDatabase.MoveAssetToTrash("Assets/Plugins/" + arch); + } + + Debug.Log("Folder merge finished!"); + } + } + + static void MoveAsset(string from, string to) + { + if (AssetDatabase.IsValidFolder(to)) + { + // Need to move all sub files/folders manually + string[] files = Directory.GetFiles(from, "*", SearchOption.TopDirectoryOnly); + foreach (string fileName in files) + { + AssetDatabase.MoveAsset(fileName, to + '/' + Path.GetFileName(fileName)); + } + string[] directories = Directory.GetDirectories(from, "*", SearchOption.AllDirectories); + foreach (string dir in directories) + { + string subDir = dir.Replace(from, ""); + files = Directory.GetFiles(dir, "*", SearchOption.TopDirectoryOnly); + foreach (string fileName in files) + { + AssetDatabase.MoveAsset(fileName, to + '/' + subDir + '/' + Path.GetFileName(fileName)); + } + } + } + else + { + string result = AssetDatabase.MoveAsset(from, to); + if (!string.IsNullOrEmpty(result)) + { + Debug.LogWarning("[FMOD] Failed to move " + from + " : " + result); + } + } + } + + static List masterBanks = new List(); + static List previewBanks = new List(); + static FMOD.Studio.EventDescription previewEventDesc; + static FMOD.Studio.EventInstance previewEventInstance; + + static PreviewState previewState; + public static PreviewState PreviewState + { + get { return previewState; } + } + + public static void PreviewEvent(EditorEventRef eventRef, Dictionary previewParamValues) + { + bool load = true; + if (previewEventDesc.isValid()) + { + Guid guid; + previewEventDesc.getID(out guid); + if (guid == eventRef.Guid) + { + load = false; + } + else + { + PreviewStop(); + } + } + + if (load) + { + masterBanks.Clear(); + previewBanks.Clear(); + + foreach (EditorBankRef masterBankRef in EventManager.MasterBanks) + { + FMOD.Studio.Bank masterBank; + CheckResult(System.loadBankFile(masterBankRef.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out masterBank)); + masterBanks.Add(masterBank); + } + + if (!EventManager.MasterBanks.Exists(x => eventRef.Banks.Contains(x))) + { + string bankName = eventRef.Banks[0].Name; + var banks = EventManager.Banks.FindAll(x => x.Name.Contains(bankName)); + foreach (var bank in banks) + { + FMOD.Studio.Bank previewBank; + CheckResult(System.loadBankFile(bank.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out previewBank)); + previewBanks.Add(previewBank); + } + } + else + { + foreach (var previewBank in previewBanks) + { + previewBank.clearHandle(); + } + } + + CheckResult(System.getEventByID(eventRef.Guid, out previewEventDesc)); + CheckResult(previewEventDesc.createInstance(out previewEventInstance)); + } + + foreach (EditorParamRef param in eventRef.Parameters) + { + FMOD.Studio.PARAMETER_DESCRIPTION paramDesc; + CheckResult(previewEventDesc.getParameterDescriptionByName(param.Name, out paramDesc)); + param.ID = paramDesc.id; + PreviewUpdateParameter(param.ID, previewParamValues[param.Name]); + } + + CheckResult(previewEventInstance.start()); + previewState = PreviewState.Playing; + } + + public static void PreviewUpdateParameter(FMOD.Studio.PARAMETER_ID id, float paramValue) + { + if (previewEventInstance.isValid()) + { + CheckResult(previewEventInstance.setParameterByID(id, paramValue)); + } + } + + public static void PreviewUpdatePosition(float distance, float orientation) + { + if (previewEventInstance.isValid()) + { + // Listener at origin + FMOD.ATTRIBUTES_3D pos = new FMOD.ATTRIBUTES_3D(); + pos.position.x = (float)Math.Sin(orientation) * distance; + pos.position.y = (float)Math.Cos(orientation) * distance; + pos.forward.x = 1.0f; + pos.up.z = 1.0f; + CheckResult(previewEventInstance.set3DAttributes(pos)); + } + } + + public static void PreviewPause() + { + if (previewEventInstance.isValid()) + { + bool paused; + CheckResult(previewEventInstance.getPaused(out paused)); + CheckResult(previewEventInstance.setPaused(!paused)); + previewState = paused ? PreviewState.Playing : PreviewState.Paused; + } + } + + public static void PreviewStop() + { + if (previewEventInstance.isValid()) + { + previewEventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); + previewEventInstance.release(); + previewEventInstance.clearHandle(); + previewEventDesc.clearHandle(); + previewBanks.ForEach(x => { x.unload(); x.clearHandle(); }); + masterBanks.ForEach(x => { x.unload(); x.clearHandle(); }); + previewState = PreviewState.Stopped; + } + } + + public static float[] GetMetering() + { + FMOD.System lowlevel; + CheckResult(System.getCoreSystem(out lowlevel)); + FMOD.ChannelGroup master; + CheckResult(lowlevel.getMasterChannelGroup(out master)); + FMOD.DSP masterHead; + CheckResult(master.getDSP(FMOD.CHANNELCONTROL_DSP_INDEX.HEAD, out masterHead)); + + FMOD.DSP_METERING_INFO outputMetering; + CheckResult(masterHead.getMeteringInfo(IntPtr.Zero, out outputMetering)); + + FMOD.SPEAKERMODE mode; + int rate, raw; + lowlevel.getSoftwareFormat(out rate, out mode, out raw); + int channels; + lowlevel.getSpeakerModeChannels(mode, out channels); + + float[] data = new float[outputMetering.numchannels > 0 ? outputMetering.numchannels : channels]; + if (outputMetering.numchannels > 0) + { + Array.Copy(outputMetering.rmslevel, data, outputMetering.numchannels); + } + return data; + } + + + const int StudioScriptPort = 3663; + static NetworkStream networkStream = null; + static Socket socket = null; + static IAsyncResult socketConnection = null; + + static NetworkStream ScriptStream + { + get + { + if (networkStream == null) + { + try + { + if (socket == null) + { + socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + } + + if (!socket.Connected) + { + socketConnection = socket.BeginConnect("127.0.0.1", StudioScriptPort, null, null); + socketConnection.AsyncWaitHandle.WaitOne(); + socket.EndConnect(socketConnection); + socketConnection = null; + } + + networkStream = new NetworkStream(socket); + + byte[] headerBytes = new byte[128]; + int read = ScriptStream.Read(headerBytes, 0, 128); + string header = Encoding.UTF8.GetString(headerBytes, 0, read - 1); + if (header.StartsWith("log():")) + { + UnityEngine.Debug.Log("FMOD Studio: Script Client returned " + header.Substring(6)); + } + } + catch (Exception e) + { + UnityEngine.Debug.Log("FMOD Studio: Script Client failed to connect - Check FMOD Studio is running"); + + socketConnection = null; + socket = null; + networkStream = null; + + throw e; + } + } + return networkStream; + } + } + + private static void AsyncConnectCallback(IAsyncResult result) + { + try + { + socket.EndConnect(result); + } + catch (Exception) + { + } + finally + { + socketConnection = null; + } + } + + public static bool IsConnectedToStudio() + { + try + { + if (socket != null && socket.Connected) + { + if (SendScriptCommand("true")) + { + return true; + } + } + + if (socketConnection == null) + { + socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + socketConnection = socket.BeginConnect("127.0.0.1", StudioScriptPort, AsyncConnectCallback, null); + } + + return false; + + } + catch(Exception e) + { + Debug.LogException(e); + return false; + } + } + + public static bool SendScriptCommand(string command) + { + byte[] commandBytes = Encoding.UTF8.GetBytes(command); + try + { + ScriptStream.Write(commandBytes, 0, commandBytes.Length); + byte[] commandReturnBytes = new byte[128]; + int read = ScriptStream.Read(commandReturnBytes, 0, 128); + string result = Encoding.UTF8.GetString(commandReturnBytes, 0, read - 1); + return (result.Contains("true")); + } + catch (Exception) + { + if (networkStream != null) + { + networkStream.Close(); + networkStream = null; + } + return false; + } + } + + + public static string GetScriptOutput(string command) + { + byte[] commandBytes = Encoding.UTF8.GetBytes(command); + try + { + ScriptStream.Write(commandBytes, 0, commandBytes.Length); + byte[] commandReturnBytes = new byte[2048]; + int read = ScriptStream.Read(commandReturnBytes, 0, commandReturnBytes.Length); + string result = Encoding.UTF8.GetString(commandReturnBytes, 0, read - 1); + if (result.StartsWith("out():")) + { + return result.Substring(6).Trim(); + } + return null; + } + catch (Exception) + { + networkStream.Close(); + networkStream = null; + return null; + } + } + + public static bool IsFileOpenByStudio(string path) + { + bool open = true; + try + { + using (var file = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None)) + { + open = false; + } + } + catch (Exception) + { + } + return open; + } + + private static string GetMasterBank() + { + GetScriptOutput(string.Format("masterBankFolder = studio.project.workspace.masterBankFolder;")); + string bankCountString = GetScriptOutput(string.Format("masterBankFolder.items.length;")); + int bankCount = int.Parse(bankCountString); + for (int i = 0; i < bankCount; i++) + { + string isMaster = GetScriptOutput(string.Format("masterBankFolder.items[{1}].isOfExactType(\"MasterBank\");", i)); + if (isMaster == "true") + { + string guid = GetScriptOutput(string.Format("masterBankFolder.items[{1}].id;", i)); + return guid; + } + } + return ""; + } + + private static bool CheckForNameConflict(string folderGuid, string eventName) + { + GetScriptOutput(string.Format("nameConflict = false;")); + GetScriptOutput(string.Format("checkFunction = function(val) {{ nameConflict |= val.name == \"{0}\"; }};", eventName)); + GetScriptOutput(string.Format("studio.project.lookup(\"{0}\").items.forEach(checkFunction, this); ", folderGuid)); + string conflictBool = GetScriptOutput(string.Format("nameConflict;")); + return conflictBool == "1"; + } + + public static string CreateStudioEvent(string eventPath, string eventName) + { + var folders = eventPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + + string folderGuid = EditorUtils.GetScriptOutput("studio.project.workspace.masterEventFolder.id;"); + for (int i = 0; i < folders.Length; i++) + { + string parentGuid = folderGuid; + GetScriptOutput(string.Format("guid = \"\";")); + GetScriptOutput(string.Format("findFunc = function(val) {{ guid = val.isOfType(\"EventFolder\") && val.name == \"{0}\" ? val.id : guid; }};", folders[i])); + GetScriptOutput(string.Format("studio.project.lookup(\"{0}\").items.forEach(findFunc, this);", folderGuid)); + folderGuid = GetScriptOutput(string.Format("guid;")); + if (folderGuid == "") + { + GetScriptOutput(string.Format("folder = studio.project.create(\"EventFolder\");")); + GetScriptOutput(string.Format("folder.name = \"{0}\"", folders[i])); + GetScriptOutput(string.Format("folder.folder = studio.project.lookup(\"{0}\");", parentGuid)); + folderGuid = GetScriptOutput(string.Format("folder.id;")); + } + } + + if (CheckForNameConflict(folderGuid, eventName)) + { + EditorUtility.DisplayDialog("Name Conflict", string.Format("The event {0} already exists under {1}", eventName, eventPath), "OK"); + return null; + } + + GetScriptOutput("event = studio.project.create(\"Event\");"); + GetScriptOutput("event.note = \"Placeholder created via Unity\";"); + GetScriptOutput(string.Format("event.name = \"{0}\"", eventName)); + GetScriptOutput(string.Format("event.folder = studio.project.lookup(\"{0}\");", folderGuid)); + + // Add a group track + GetScriptOutput("track = studio.project.create(\"GroupTrack\");"); + GetScriptOutput("track.mixerGroup.output = event.mixer.masterBus;"); + GetScriptOutput("track.mixerGroup.name = \"Audio 1\";"); + GetScriptOutput("event.relationships.groupTracks.add(track);"); + + // Add tags + GetScriptOutput("tag = studio.project.create(\"Tag\");"); + GetScriptOutput("tag.name = \"placeholder\";"); + GetScriptOutput("tag.folder = studio.project.workspace.masterTagFolder;"); + GetScriptOutput("event.relationships.tags.add(tag);"); + + string eventGuid = GetScriptOutput(string.Format("event.id;")); + return eventGuid; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs.meta b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs.meta new file mode 100644 index 0000000..3cd5e2c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EditorUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2bb4068641d1f71478f95a9b73533f51 +timeCreated: 1432608272 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs new file mode 100644 index 0000000..6a0ea08 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs @@ -0,0 +1,1192 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEngine; +using System.IO; + +namespace FMODUnity +{ + class EventBrowser : EditorWindow, ISerializationCallbackReceiver + { + public enum TreeType : int + { + Events, + Snapshots, + Banks, + GlobalParameters, + } + + [MenuItem("FMOD/Event Browser", priority = 1)] + public static void ShowEventBrowser() + { + EventBrowser eventBrowser = GetWindow("FMOD Events"); + eventBrowser.minSize = new Vector2(280, 600); + eventBrowser.Show(); + } + + void OnDestroy() + { + EditorUtils.PreviewStop(); + } + + List expandedState; + int selectedIndex = -1; + public void OnBeforeSerialize() + { + expandedState = new List(); + Action isExpanded = null; + isExpanded = (x) => { selectedIndex = (x == selectedItem) ? expandedState.Count : selectedIndex; expandedState.Add(x.Expanded); x.Children.ForEach(isExpanded); }; + treeItems.ForEach(isExpanded); + } + + public void OnAfterDeserialize() + { + } + + class TreeItem + { + public string Name; + public bool Expanded = false; + public EditorEventRef EventRef = null; + public EditorBankRef BankRef = null; + public EditorParamRef ParamRef = null; + public List Children = new List(); + public TreeItem Next = null; + public TreeItem Prev = null; + public Rect Rect; + public bool Exists; + } + + [NonSerialized] + List treeItems; + + Texture searchIcon; + Texture eventIcon; + Texture folderOpenIcon; + Texture folderClosedIcon; + Texture bankIcon; + Texture snapshotIcon; + Texture2D borderIcon; + GUIStyle eventStyle; + + [NonSerialized] + TreeItem selectedItem = null; + + Dictionary previewParamValues = new Dictionary(); + float previewDistance = 0; + float previewOrientation = 0; + + string searchString = ""; + + private SerializedProperty outputProperty; + + bool fromInspector = false; + bool showEvents = true; + bool showBanks = true; + bool showParameters = true; + + Vector2 treeScroll; + Vector2 paramScroll; + + [NonSerialized] + TreeItem lastDrawnItem; + [NonSerialized] + int itemCount; + [NonSerialized] + bool forceRepaint; + [NonSerialized] + float lastRepaintTime; + + void Update() + { + if (forceRepaint && lastRepaintTime < Time.time + (1/30.0f)) + { + Repaint(); + lastRepaintTime = Time.time; + } + } + + void SetPreviewEvent(EditorEventRef eventRef) + { + forceRepaint = false; + EditorUtils.PreviewStop(); + previewParamValues.Clear(); + + previewDistance = 0; + previewOrientation = 0; + + if (eventRef != null) + { + foreach (var paramRef in eventRef.Parameters) + { + previewParamValues.Add(paramRef.Name, paramRef.Default); + } + } + eventPosition = new Vector2(0, 0); + } + + void SetSelectedItem(TreeItem item) + { + //if (item != selectedItem) + { + selectedItem = item; + + if (item != null) + { + SetPreviewEvent(item.EventRef); + } + else + { + SetPreviewEvent(null); + } + } + } + + void ShowEventFolder(TreeItem item, Predicate filter) + { + eventStyle.padding.left += 17; + { + // Highlight first found item + if (item.EventRef != null || item.BankRef != null) + { + if (!String.IsNullOrEmpty(searchString) && + itemCount == 0 && + selectedItem == null + ) + { + SetSelectedItem(item); + } + + itemCount++; + } + + item.Next = null; + item.Prev = lastDrawnItem; + if (lastDrawnItem != null) + { + lastDrawnItem.Next = item; + } + lastDrawnItem = item; + } + + if (item.EventRef != null) + { + // Rendering and GUI event handling to show an event + GUIContent content = new GUIContent(item.Name, item.EventRef.Path.StartsWith("snapshot") ? snapshotIcon : eventIcon); + + eventStyle.normal.background = selectedItem == item ? EditorGUIUtility.Load("FMOD/Selected.png") as Texture2D : null; + GUILayout.Label(content, eventStyle, GUILayout.ExpandWidth(true)); + + Event e = Event.current; + + Rect rect = GUILayoutUtility.GetLastRect(); + if (e.type == EventType.MouseDown && + e.button == 0 && + rect.Contains(e.mousePosition)) + { + e.Use(); + + if (fromInspector && e.clickCount >= 2) + { + outputProperty.stringValue = ""; + outputProperty.stringValue = item.EventRef.Path; + EditorUtils.UpdateParamsOnEmitter(outputProperty.serializedObject, item.EventRef.Path); + outputProperty.serializedObject.ApplyModifiedProperties(); + Close(); + } + + SetSelectedItem(item); + } + if (e.type == EventType.MouseDrag && rect.Contains(e.mousePosition) && !fromInspector) + { + DragAndDrop.PrepareStartDrag(); + DragAndDrop.objectReferences = new UnityEngine.Object[] { Instantiate(item.EventRef) }; + DragAndDrop.StartDrag("New FMOD Studio Emitter"); + e.Use(); + } + if (Event.current.type == EventType.Repaint) + { + item.Rect = rect; + } + } + else if (item.BankRef != null) + { + // Rendering and event handling for a bank + GUIContent content = new GUIContent(item.Name, bankIcon); + + eventStyle.normal.background = selectedItem == item ? EditorGUIUtility.Load("FMOD/Selected.png") as Texture2D : null; + GUILayout.Label(content, eventStyle, GUILayout.ExpandWidth(true)); + + Event e = Event.current; + + Rect rect = GUILayoutUtility.GetLastRect(); + if (e.type == EventType.MouseDown && + e.button == 0 && + rect.Contains(e.mousePosition)) + { + e.Use(); + + if (fromInspector && e.clickCount >= 2) + { + outputProperty.stringValue = item.BankRef.Name; + outputProperty.serializedObject.ApplyModifiedProperties(); + Close(); + } + + SetSelectedItem(item); + } + if (e.type == EventType.MouseDrag && rect.Contains(e.mousePosition) && !fromInspector) + { + DragAndDrop.PrepareStartDrag(); + DragAndDrop.objectReferences = new UnityEngine.Object[] { Instantiate(item.BankRef) }; + DragAndDrop.StartDrag("New FMOD Studio Bank Loader"); + e.Use(); + } + if (Event.current.type == EventType.Repaint) + { + item.Rect = rect; + } + } + else if (item.ParamRef != null) + { + // Rendering and event handling for a bank + GUIContent content = new GUIContent(item.Name, eventIcon); + + eventStyle.normal.background = selectedItem == item ? EditorGUIUtility.Load("FMOD/Selected.png") as Texture2D : null; + GUILayout.Label(content, eventStyle, GUILayout.ExpandWidth(true)); + + Event e = Event.current; + + Rect rect = GUILayoutUtility.GetLastRect(); + if (e.type == EventType.MouseDown && + e.button == 0 && + rect.Contains(e.mousePosition)) + { + e.Use(); + + if (fromInspector && e.clickCount >= 2) + { + outputProperty.stringValue = item.ParamRef.Name; + outputProperty.serializedObject.ApplyModifiedProperties(); + Close(); + } + + SetSelectedItem(item); + } + if (e.type == EventType.MouseDrag && rect.Contains(e.mousePosition) && !fromInspector) + { + DragAndDrop.PrepareStartDrag(); + DragAndDrop.objectReferences = new UnityEngine.Object[] { Instantiate(item.ParamRef) }; + DragAndDrop.StartDrag("New FMOD Studio Global Parameter Trigger"); + e.Use(); + } + if (Event.current.type == EventType.Repaint) + { + item.Rect = rect; + } + } + else + { + eventStyle.normal.background = selectedItem == item ? EditorGUIUtility.Load("FMOD/Selected.png") as Texture2D : null; + + bool expanded = item.Expanded || !string.IsNullOrEmpty(searchString); + GUIContent content = new GUIContent(item.Name, expanded ? folderOpenIcon : folderClosedIcon); + GUILayout.Label(content, eventStyle, GUILayout.ExpandWidth(true)); + + Rect rect = GUILayoutUtility.GetLastRect(); + if (Event.current.type == EventType.MouseDown && + Event.current.button == 0 && + rect.Contains(Event.current.mousePosition)) + { + Event.current.Use(); + item.Expanded = !item.Expanded; + SetSelectedItem(item); + } + + if (item.Expanded || !string.IsNullOrEmpty(searchString)) + { + if (item.Name.ToLower().Contains(searchString.ToLower())) + { + foreach(var childFolder in item.Children) + { + ShowEventFolder(childFolder, (x) => true); + } + } + else + { + foreach (var childFolder in item.Children.FindAll(filter)) + { + ShowEventFolder(childFolder, filter); + } + } + } + + if (Event.current.type == EventType.Repaint) + { + item.Rect = rect; + } + } + eventStyle.padding.left -= 17; + } + + Vector2 eventPosition; + + void OnGUI() + { + if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying) + { + // Brute force hack to stop us calling DLL functions while Unity is starting up + // playing in editor mode and will cause us to leak system objects + ShowNotification(new GUIContent("Playing In Editor Starting")); + return; + } + + if (!EventManager.IsValid) + { + ShowNotification(new GUIContent("No FMOD Studio banks loaded. Please check your settings.")); + return; + } + + if (Event.current.type == EventType.Layout) + { + RebuildDisplayFromCache(); + } + + //if (eventStyle == null) + { + eventStyle = new GUIStyle(GUI.skin.button); + eventStyle.normal.background = null; + eventStyle.focused.background = null; + eventStyle.active.background = null; + eventStyle.onFocused.background = null; + eventStyle.onNormal.background = null; + eventStyle.onHover.background = null; + eventStyle.onActive.background = null; + eventStyle.stretchWidth = false; + eventStyle.padding.left = 0; + eventStyle.stretchHeight = false; + eventStyle.fixedHeight = eventStyle.lineHeight + eventStyle.margin.top + eventStyle.margin.bottom; + eventStyle.alignment = TextAnchor.MiddleLeft; + + eventIcon = EditorGUIUtility.Load("FMOD/EventIcon.png") as Texture; + folderOpenIcon = EditorGUIUtility.Load("FMOD/FolderIconOpen.png") as Texture; + folderClosedIcon = EditorGUIUtility.Load("FMOD/FolderIconClosed.png") as Texture; + searchIcon = EditorGUIUtility.Load("FMOD/SearchIcon.png") as Texture; + bankIcon = EditorGUIUtility.Load("FMOD/BankIcon.png") as Texture; + snapshotIcon = EditorGUIUtility.Load("FMOD/SnapshotIcon.png") as Texture; + borderIcon = EditorGUIUtility.Load("FMOD/Border.png") as Texture2D; + } + + if (fromInspector) + { + var border = new GUIStyle(GUI.skin.box); + border.normal.background = borderIcon; + GUI.Box(new Rect(1, 1, position.width - 1, position.height - 1), GUIContent.none, border); + } + + // Split the window int search box, tree view, preview pane (only if full browser) + Rect searchRect, listRect, previewRect; + SplitWindow(out searchRect, out listRect, out previewRect); + + // Scroll the selected item in the tree view - put above the search box otherwise it will take + // our key presses + if (selectedItem != null && Event.current.type == EventType.KeyDown) + { + if (Event.current.keyCode == KeyCode.UpArrow) + { + if (selectedItem.Prev != null) + { + SetSelectedItem(selectedItem.Prev); + + // make sure it's visible + if (selectedItem.Rect.y < treeScroll.y) + { + treeScroll.y = selectedItem.Rect.y; + } + } + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.DownArrow) + { + if (selectedItem.Next != null) + { + SetSelectedItem(selectedItem.Next); + // make sure it's visible + if (selectedItem.Rect.y + selectedItem.Rect.height > treeScroll.y + listRect.height) + { + treeScroll.y += (selectedItem.Rect.y + selectedItem.Rect.height) - listRect.height; + } + } + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.RightArrow) + { + selectedItem.Expanded = true; + Event.current.Use(); + } + if (Event.current.keyCode == KeyCode.LeftArrow) + { + selectedItem.Expanded = false; + Event.current.Use(); + } + } + + // Show the search box at the top + GUILayout.BeginArea(searchRect); + GUILayout.BeginHorizontal(); + GUILayout.Label(new GUIContent(searchIcon), GUILayout.ExpandWidth(false)); + GUI.SetNextControlName("SearchBox"); + searchString = EditorGUILayout.TextField(searchString); + GUILayout.EndHorizontal(); + GUILayout.EndArea(); + + if (fromInspector) + { + EditorGUI.FocusTextInControl("SearchBox"); + + if (selectedItem != null && Event.current.isKey && Event.current.keyCode == KeyCode.Return + && !(selectedItem.EventRef == null && selectedItem.BankRef == null)) + { + Event.current.Use(); + + if (selectedItem.EventRef != null) + { + outputProperty.stringValue = ""; + outputProperty.stringValue = selectedItem.EventRef.Path; + EditorUtils.UpdateParamsOnEmitter(outputProperty.serializedObject, selectedItem.EventRef.Path); + } + else + { + outputProperty.stringValue = selectedItem.BankRef.Name; + } + outputProperty.serializedObject.ApplyModifiedProperties(); + Close(); + } + if (Event.current.isKey && Event.current.keyCode == KeyCode.Escape) + { + Close(); + } + } + + // Show the tree view + Predicate searchFilter = null; + searchFilter = (x) => (x.Name.ToLower().Contains(searchString.ToLower()) || x.Children.Exists(searchFilter)); + + // Check if our selected item still matches the search string + if (selectedItem != null && !String.IsNullOrEmpty(searchString) && selectedItem.Children.Count == 0) + { + Predicate containsSelected = null; + containsSelected = (x) => (x == selectedItem || x.Children.Exists(containsSelected)); + Predicate matchForSelected = null; + matchForSelected = (x) => (x.Name.ToLower().Contains(searchString.ToLower()) && (x == selectedItem || x.Children.Exists(containsSelected))) || x.Children.Exists(matchForSelected); + if (!treeItems.Exists(matchForSelected)) + { + SetSelectedItem(null); + } + } + + GUILayout.BeginArea(listRect); + treeScroll = GUILayout.BeginScrollView(treeScroll, GUILayout.ExpandHeight(true)); + + lastDrawnItem = null; + itemCount = 0; + + if (showEvents) + { + treeItems[(int)TreeType.Events].Expanded = fromInspector ? true : treeItems[(int)TreeType.Events].Expanded; + ShowEventFolder(treeItems[(int)TreeType.Events], searchFilter); + ShowEventFolder(treeItems[(int)TreeType.Snapshots], searchFilter); + } + if (showBanks) + { + treeItems[(int)TreeType.Banks].Expanded = fromInspector ? true : treeItems[(int)TreeType.Banks].Expanded; + ShowEventFolder(treeItems[(int)TreeType.Banks], searchFilter); + } + if (showParameters) + { + treeItems[(int)TreeType.GlobalParameters].Expanded = fromInspector ? true : treeItems[(int)TreeType.GlobalParameters].Expanded; + ShowEventFolder(treeItems[(int)TreeType.GlobalParameters], searchFilter); + } + + GUILayout.EndScrollView(); + GUILayout.EndArea(); + + // If the standalone event browser show a preview of the selected item + if (!fromInspector) + { + GUI.Box(previewRect, GUIContent.none); + + if (selectedItem != null && selectedItem.EventRef != null && selectedItem.EventRef.Path.StartsWith("event:")) + { + PreviewEvent(previewRect, selectedItem.EventRef); + } + + if (selectedItem != null && selectedItem.EventRef != null && selectedItem.EventRef.Path.StartsWith("snapshot:")) + { + PreviewSnapshot(previewRect, selectedItem.EventRef); + } + + if (selectedItem != null && selectedItem.BankRef != null) + { + PreviewBank(previewRect, selectedItem.BankRef); + } + + if (selectedItem != null && selectedItem.ParamRef != null) + { + PreviewParameter(previewRect, selectedItem.ParamRef); + } + } + } + + private void SplitWindow(out Rect searchRect, out Rect listRect, out Rect previewRect) + { + searchRect = new Rect(4, 4, position.width - 8, 16); + float previewBoxHeight = fromInspector ? 0 : 300; + listRect = new Rect(0, searchRect.height + 6, position.width, position.height - previewBoxHeight - searchRect.height - 15); + previewRect = new Rect(0, position.height - previewBoxHeight, position.width, previewBoxHeight); + } + + Rect previewCustomRect; + Rect previewPathRect; + + private void PreviewEvent(Rect previewRect, EditorEventRef selectedEvent) + { + GUILayout.BeginArea(previewRect); + + bool isNarrow = previewRect.width < 400; + + var style = new GUIStyle(EditorStyles.label); + EditorStyles.label.fontStyle = FontStyle.Bold; + EditorGUIUtility.labelWidth = 75; + + var copyIcon = EditorGUIUtility.Load("FMOD/CopyIcon.png") as Texture; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Full Path", selectedEvent.Path, style, GUILayout.ExpandWidth(true)); + if (GUILayout.Button(copyIcon, GUILayout.ExpandWidth(false))) + { + EditorGUIUtility.systemCopyBuffer = selectedEvent.Path; + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.LabelField("Banks", string.Join(", ", selectedEvent.Banks.Select(x => x.Name).ToArray()), style); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Panning", selectedEvent.Is3D ? "3D" : "2D", style); + EditorGUILayout.LabelField("Oneshot", selectedEvent.IsOneShot.ToString(), style); + + TimeSpan t = TimeSpan.FromMilliseconds(selectedEvent.Length); + EditorGUILayout.LabelField("Length", selectedEvent.Length > 0 ? string.Format("{0:D2}:{1:D2}:{2:D3}", t.Minutes, t.Seconds, t.Milliseconds) : "N/A", style); + + if (!isNarrow) EditorGUILayout.LabelField("Streaming", selectedEvent.IsStream.ToString(), style); + EditorGUILayout.EndHorizontal(); + if (isNarrow) EditorGUILayout.LabelField("Streaming", selectedEvent.IsStream.ToString(), style); + + EditorGUIUtility.labelWidth = 0; + EditorStyles.label.fontStyle = FontStyle.Normal; + + if (Event.current.type == EventType.Repaint) + { + var lastRect = GUILayoutUtility.GetLastRect(); + if (!isNarrow) + { + previewCustomRect = new Rect(lastRect.width / 2 - 200, lastRect.yMax + 10, 400, 150); + } + else + { + previewCustomRect = new Rect(lastRect.width / 2 - 130, lastRect.yMax + 10, 260, 150); + } + } + + GUI.Box(new Rect(0, previewCustomRect.yMin, previewRect.width, 1), GUIContent.none); + GUI.Box(new Rect(0, previewCustomRect.yMax, previewRect.width, 1), GUIContent.none); + + GUILayout.BeginArea(previewCustomRect); + + Texture playOff = EditorGUIUtility.Load("FMOD/TransportPlayButtonOff.png") as Texture; + Texture playOn = EditorGUIUtility.Load("FMOD/TransportPlayButtonOn.png") as Texture; + Texture stopOff = EditorGUIUtility.Load("FMOD/TransportStopButtonOff.png") as Texture; + Texture stopOn = EditorGUIUtility.Load("FMOD/TransportStopButtonOn.png") as Texture; + Texture openIcon = EditorGUIUtility.Load("FMOD/transportOpen.png") as Texture; + + var transportButtonStyle = new GUIStyle(); + transportButtonStyle.padding.left = 4; + transportButtonStyle.padding.top = 10; + + var previewState = EditorUtils.PreviewState; + bool playing = previewState == PreviewState.Playing; + bool paused = previewState == PreviewState.Paused; + bool stopped = previewState == PreviewState.Stopped; + EditorGUILayout.BeginVertical(); + if (!isNarrow) GUILayout.FlexibleSpace(); + EditorGUILayout.BeginHorizontal(); + + if (GUILayout.Button(stopped || paused ? stopOn : stopOff, transportButtonStyle, GUILayout.ExpandWidth(false))) + { + forceRepaint = false; + if (paused) + { + EditorUtils.PreviewStop(); + } + if (playing) + { + EditorUtils.PreviewPause(); + } + } + if (GUILayout.Button(playing ? playOn : playOff, transportButtonStyle, GUILayout.ExpandWidth(false))) + { + if (playing || stopped) + { + EditorUtils.PreviewEvent(selectedEvent, previewParamValues); + } + else + { + EditorUtils.PreviewPause(); + } + forceRepaint = true; + } + if (GUILayout.Button(new GUIContent(openIcon, "Show Event in FMOD Studio"), transportButtonStyle, GUILayout.ExpandWidth(false))) + { + string cmd = string.Format("studio.window.navigateTo(studio.project.lookup(\"{0}\"))", selectedEvent.Guid.ToString("b")); + EditorUtils.SendScriptCommand(cmd); + } + + EditorGUILayout.EndHorizontal(); + if (!isNarrow) GUILayout.FlexibleSpace(); + EditorGUILayout.EndVertical(); + + { + Texture circle = EditorGUIUtility.Load("FMOD/preview.png") as Texture; + Texture circle2 = EditorGUIUtility.Load("FMOD/previewemitter.png") as Texture; + + var originalColour = GUI.color; + if (!selectedEvent.Is3D) + { + GUI.color = new Color(1.0f, 1.0f, 1.0f, 0.1f); + } + + Rect rect = new Rect(isNarrow ? 120 : 150, 10, 128, 128); + GUI.DrawTexture(rect, circle); + + Vector2 centre = rect.center; + Rect rect2 = new Rect(rect.center.x + eventPosition.x - 6, rect.center.y + eventPosition.y - 6, 12, 12); + GUI.DrawTexture(rect2, circle2); + + GUI.color = originalColour; + + if (selectedEvent.Is3D && (Event.current.type == EventType.MouseDown || Event.current.type == EventType.MouseDrag) && rect.Contains(Event.current.mousePosition)) + { + var newPosition = Event.current.mousePosition; + Vector2 delta = (newPosition - centre); + float distance = delta.magnitude; + if (distance < 60) + { + eventPosition = newPosition - rect.center; + previewDistance = distance / 60.0f * selectedEvent.MaxDistance; + delta.Normalize(); + float angle = Mathf.Atan2(delta.y, delta.x); + previewOrientation = angle + Mathf.PI * 0.5f; + } + Event.current.Use(); + } + + EditorUtils.PreviewUpdatePosition(previewDistance, previewOrientation); + } + + float hoffset = isNarrow ? 15 : 300; + float voffset = isNarrow ? 50 : 10; + Texture meterOn = EditorGUIUtility.Load("FMOD/LevelMeter.png") as Texture; + Texture meterOff = EditorGUIUtility.Load("FMOD/LevelMeterOff.png") as Texture; + float[] metering = EditorUtils.GetMetering(); + int meterHeight = isNarrow ? 86 : 128; + int meterWidth = (int)((128 / (float)meterOff.height) * meterOff.width); + foreach (float rms in metering) + { + GUI.DrawTexture(new Rect(hoffset, voffset, meterWidth, meterHeight), meterOff); + + float db = 20.0f * Mathf.Log10(rms * Mathf.Sqrt(2.0f)); + db = Mathf.Clamp(db, -80.0f, 10.0f); + float visible = 0; + int[] segmentPixels = new int[] { 0, 18, 38, 60, 89, 130, 187, 244, 300 }; + float[] segmentDB = new float[] { -80.0f, -60.0f, -50.0f, -40.0f, -30.0f, -20.0f, -10.0f, 0, 10.0f }; + int segment = 1; + while (segmentDB[segment] < db) + { + segment++; + } + visible = segmentPixels[segment - 1] + ((db - segmentDB[segment - 1]) / (segmentDB[segment] - segmentDB[segment - 1])) * (segmentPixels[segment] - segmentPixels[segment - 1]); + + visible *= meterHeight / (float)meterOff.height; + + Rect levelPosRect = new Rect(hoffset, meterHeight - visible + voffset, meterWidth, visible); + Rect levelUVRect = new Rect(0, 0, 1.0f, visible / meterHeight); + GUI.DrawTextureWithTexCoords(levelPosRect, meterOn, levelUVRect); + hoffset += meterWidth + 5.0f; + } + + GUILayout.EndArea(); + + Rect paramRect = new Rect(0, previewCustomRect.yMax + 10, previewRect.width, previewRect.height - (previewCustomRect.yMax + 10)); + GUILayout.BeginArea(paramRect); + + paramScroll = GUILayout.BeginScrollView(paramScroll, false, false); + foreach (var paramRef in selectedEvent.Parameters) + { + if (!previewParamValues.ContainsKey(paramRef.Name)) + { + previewParamValues[paramRef.Name] = paramRef.Default; + } + previewParamValues[paramRef.Name] = EditorGUILayout.Slider(paramRef.Name, previewParamValues[paramRef.Name], paramRef.Min, paramRef.Max); + EditorUtils.PreviewUpdateParameter(paramRef.ID, previewParamValues[paramRef.Name]); + } + GUILayout.EndScrollView(); + + GUILayout.EndArea(); + GUILayout.EndArea(); + } + + private void PreviewBank(Rect previewRect, EditorBankRef selectedBank) + { + GUILayout.BeginArea(previewRect); + EditorGUIUtility.labelWidth = 75; + string[] SizeSuffix = { "B", "KB", "MB", "GB" }; + EditorStyles.label.fontStyle = FontStyle.Bold; + EditorGUILayout.LabelField("Platform Bank Sizes"); + EditorStyles.label.fontStyle = FontStyle.Normal; + EditorGUI.indentLevel++; + foreach (var sizeInfo in selectedBank.FileSizes) + { + int order = 0; + long len = sizeInfo.Value; + while (len >= 1024 && order + 1 < SizeSuffix.Length) + { + order++; + len /= 1024; + } + EditorGUILayout.LabelField(sizeInfo.Name, string.Format("{0} {1}", len, SizeSuffix[order])); + } + EditorGUI.indentLevel--; + EditorGUIUtility.labelWidth = 0; + GUILayout.EndArea(); + } + + private void PreviewParameter(Rect previewRect, EditorParamRef selectedParam) + { + GUILayout.BeginArea(previewRect); + var style = new GUIStyle(EditorStyles.label); + EditorStyles.label.fontStyle = FontStyle.Bold; + EditorGUIUtility.labelWidth = 75; + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField("Name", selectedParam.Name, style, GUILayout.ExpandWidth(true)); + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.LabelField("Min", selectedParam.Min.ToString(), style, GUILayout.ExpandWidth(true)); + EditorGUILayout.LabelField("Max", selectedParam.Max.ToString(), style, GUILayout.ExpandWidth(true)); + + EditorGUI.indentLevel--; + EditorGUIUtility.labelWidth = 0; + GUILayout.EndArea(); + } + + private void PreviewSnapshot(Rect previewRect, EditorEventRef selectedEvent) + { + GUILayout.BeginArea(previewRect); + var style = new GUIStyle(EditorStyles.label); + EditorStyles.label.fontStyle = FontStyle.Bold; + EditorGUIUtility.labelWidth = 75; + + EditorGUILayout.LabelField("Full Path", selectedEvent.Path, style); + + EditorGUIUtility.labelWidth = 0; + EditorStyles.label.fontStyle = FontStyle.Normal; + GUILayout.EndArea(); + } + + private void RebuildDisplayFromCache() + { + Action nullEvents = null; + nullEvents = (x) => { x.Exists = false; x.Children.ForEach(nullEvents); }; + Predicate isStale = (x) => !x.Exists; + Action removeStaleChildren = null; + removeStaleChildren = (x) => { x.Children.RemoveAll(isStale); x.Children.ForEach(removeStaleChildren); }; + + if (showEvents) + { + var editorEvents = EventManager.Events; + + treeItems[(int)TreeType.Events].Children.ForEach(nullEvents); + treeItems[(int)TreeType.Snapshots].Children.ForEach(nullEvents); + + foreach (var editorEvent in editorEvents) + { + string[] split = editorEvent.Path.Split('/'); + var level = split[0] == "snapshot:" ? treeItems[(int)TreeType.Snapshots].Children : treeItems[(int)TreeType.Events].Children; + for (int i = 1; i < split.Length; i++) + { + TreeItem item = level.Find((x) => x.Name == split[i]); + if (item != null) + { + if (i == (split.Length - 1)) + { + item.EventRef = editorEvent; + } + else + { + level = item.Children; + } + } + else + { + item = new TreeItem(); + if (i == (split.Length - 1)) + { + item.EventRef = editorEvent; + } + item.Name = split[i]; + level.Add(item); + level.Sort((a, b) => { + if ((a.EventRef == null) != (b.EventRef == null)) + { + // Folders have EventRef == null, and go first in the list + return a.EventRef == null ? -1 : 1; + } + else + { + return EditorUtility.NaturalCompare(a.Name, b.Name); + } + }); + level = item.Children; + } + item.Exists = true; + } + } + + removeStaleChildren(treeItems[(int)TreeType.Events]); + removeStaleChildren(treeItems[(int)TreeType.Snapshots]); + } + + if (showBanks) + { + var editorBanks = EventManager.Banks; + var children = treeItems[(int)TreeType.Banks].Children; + + children.ForEach(nullEvents); + + foreach (var editorBank in editorBanks) + { + TreeItem item = children.Find((x) => x.Name == editorBank.Name); + if (item == null) + { + item = new TreeItem(); + item.Name = editorBank.Name; + item.BankRef = editorBank; + children.Add(item); + } + item.Exists = true; + } + children.Sort((a, b) => EditorUtility.NaturalCompare(a.Name, b.Name)); + + removeStaleChildren(treeItems[(int)TreeType.Banks]); + } + + if (showParameters) + { + var editorParams = EventManager.Parameters; + var children = treeItems[(int)TreeType.GlobalParameters].Children; + + children.ForEach(nullEvents); + + foreach (var editorParam in editorParams) + { + var name = editorParam.Name; + TreeItem item = children.Find((x) => x.Name == name); + if (item == null) + { + item = new TreeItem(); + item.Name = name; + item.ParamRef = editorParam; + children.Add(item); + } + item.Exists = true; + } + children.Sort((a, b) => EditorUtility.NaturalCompare(a.Name, b.Name)); + + removeStaleChildren(treeItems[(int)TreeType.GlobalParameters]); + } + + if (expandedState != null && EventManager.IsLoaded) + { + int i = 0; + Action setExpanded = null; + setExpanded = (x) => { selectedItem = (i == selectedIndex) ? x : selectedItem; x.Expanded = expandedState[i++]; x.Children.ForEach(setExpanded); }; + try + { + treeItems.ForEach(setExpanded); + } + catch + { + } + + expandedState = null; + + if (selectedItem != null) + { + SetPreviewEvent(selectedItem.EventRef); + } + else + { + SetPreviewEvent(null); + } + } + } + + internal void SelectEvent(SerializedProperty property) + { + fromInspector = true; + showBanks = false; + showParameters = false; + outputProperty = property; + JumpToEvent(outputProperty.stringValue); + } + + internal void SelectBank(SerializedProperty property) + { + fromInspector = true; + showEvents = false; + showParameters = false; + outputProperty = property; + JumpToBank(outputProperty.stringValue); + } + + internal void SelectParameter(SerializedProperty property) + { + fromInspector = true; + showBanks = false; + showEvents = false; + outputProperty = property; + JumpToParameter(outputProperty.stringValue); + } + + public void JumpToEvent(string eventPath) + { + if (!string.IsNullOrEmpty(eventPath)) + { + searchString = ""; + RebuildDisplayFromCache(); + TreeItem currentItem = null; + if (eventPath.StartsWith("event:/")) + { + currentItem = treeItems[(int)TreeType.Events]; + eventPath = eventPath.Replace("event:/", ""); + } + else if (eventPath.StartsWith("snapshot:/")) + { + currentItem = treeItems[(int)TreeType.Snapshots]; + eventPath = eventPath.Replace("snapshot:/", ""); + } + else + { + return; + } + + currentItem.Expanded = true; + var pathElements = eventPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + foreach (var pathElement in pathElements) + { + var nextItem = currentItem.Children.Find(x => x.Name.Equals(pathElement, StringComparison.CurrentCultureIgnoreCase)); + if (nextItem == null) + { + return; + } + nextItem.Expanded = true; + if (nextItem.EventRef) + { + SetSelectedItem(nextItem); + + Rect searchRect, listRect, previewRect; + SplitWindow(out searchRect, out listRect, out previewRect); + if (selectedItem.Rect.y < treeScroll.y) + { + treeScroll.y = selectedItem.Rect.y; + } + else if (selectedItem.Rect.y + selectedItem.Rect.height > treeScroll.y + listRect.height) + { + treeScroll.y += (selectedItem.Rect.y + selectedItem.Rect.height) - listRect.height; + } + return; + } + currentItem = nextItem; + } + } + } + + void JumpToBank(string bankName) + { + if (!string.IsNullOrEmpty(bankName)) + { + RebuildDisplayFromCache(); + TreeItem currentItem = treeItems[(int)TreeType.Banks]; + + currentItem.Expanded = true; + var nextItem = currentItem.Children.Find(x => x.Name.Equals(bankName, StringComparison.CurrentCultureIgnoreCase)); + if (nextItem == null) + { + return; + } + if (nextItem.BankRef) + { + SetSelectedItem(nextItem); + return; + } + } + } + + public void JumpToParameter(string parameterName) + { + if (!string.IsNullOrEmpty(parameterName)) + { + RebuildDisplayFromCache(); + TreeItem currentItem = treeItems[(int)TreeType.Banks]; + + currentItem.Expanded = true; + var nextItem = currentItem.Children.Find(x => x.Name.Equals(parameterName, StringComparison.CurrentCultureIgnoreCase)); + if (nextItem == null) + { + return; + } + if (nextItem.ParamRef) + { + SetSelectedItem(nextItem); + return; + } + } + } + + public EventBrowser() + { + treeItems = new List(); + treeItems.Add(new TreeItem()); + treeItems.Add(new TreeItem()); + treeItems.Add(new TreeItem()); + treeItems.Add(new TreeItem()); + treeItems[(int)TreeType.Events].Name = "Events"; + treeItems[(int)TreeType.Snapshots].Name = "Snapshots"; + treeItems[(int)TreeType.Banks].Name = "Banks"; + treeItems[(int)TreeType.GlobalParameters].Name = "Global Parameters"; + } + + public static void RepaintEventBrowser() + { + if (instance) + { + instance.Repaint(); + } + } + + static EventBrowser instance; + + public void OnEnable() + { + #if UNITY_2019_1_OR_NEWER + SceneView.duringSceneGui += SceneUpdate; + #else + SceneView.onSceneGUIDelegate += SceneUpdate; + #endif + EditorApplication.hierarchyWindowItemOnGUI += HierachachyUpdate; + instance = this; + } + + // This is an event handler on the hierachy view to handle dragging our objects from the browser + void HierachachyUpdate(int instance, Rect rect) + { + Event e = Event.current; + if (e.type == EventType.DragPerform && rect.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + (DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef) || + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef))) + { + GameObject target = (GameObject)EditorUtility.InstanceIDToObject(instance); + if (DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef)) + { + var emitter = Undo.AddComponent(target); + emitter.Event = ((EditorEventRef)DragAndDrop.objectReferences[0]).Path; + var so = new SerializedObject(emitter); + so.ApplyModifiedProperties(); + } + else + { + var loader = Undo.AddComponent(target); + loader.Banks = new List(); + loader.Banks.Add(((EditorBankRef)DragAndDrop.objectReferences[0]).Name); + } + Selection.activeObject = target; + e.Use(); + } + } + } + + // This is an event handler on the scene view to handle dragging our objects from the browser + // and creating new gameobjects + void SceneUpdate(SceneView sceneView) + { + Event e = Event.current; + if (e.type == EventType.DragPerform) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + (DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef) || + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef))) + { + GameObject newObject = null; + if (DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef)) + { + string path = ((EditorEventRef)DragAndDrop.objectReferences[0]).Path; + string name = path.Substring(path.LastIndexOf("/") + 1); + newObject = new GameObject(name + " Emitter"); + var emitter = newObject.AddComponent(); + emitter.Event = path; + var so = new SerializedObject(emitter); + so.ApplyModifiedProperties(); + Undo.RegisterCreatedObjectUndo(newObject, "Create FMOD Studio Emitter"); + } + else + { + newObject = new GameObject("FMOD Studio Loader"); + var loader = newObject.AddComponent(); + loader.Banks = new List(); + loader.Banks.Add(((EditorBankRef)DragAndDrop.objectReferences[0]).Name); + Undo.RegisterCreatedObjectUndo(newObject, "Create FMOD Studio Loader"); + } + Ray ray = HandleUtility.GUIPointToWorldRay(e.mousePosition); + var hit = HandleUtility.RaySnap(ray); + if (hit != null) + { + newObject.transform.position = ((RaycastHit)hit).point; + } + else + { + newObject.transform.position = ray.origin + ray.direction * 10.0f; + } + Selection.activeObject = newObject; + e.Use(); + } + } + if (e.type == EventType.DragUpdated) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + (DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef) || + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef))) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs.meta new file mode 100644 index 0000000..2579cf5 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventBrowser.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5332ad2baabb58844975479e906001c8 +timeCreated: 1432613753 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventCache.cs b/Assets/Plugins/FMOD/src/Editor/EventCache.cs new file mode 100644 index 0000000..808d846 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventCache.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace FMODUnity +{ + class EventCache : ScriptableObject + { + public static int CurrentCacheVersion = 4; + + [SerializeField] + public List EditorBanks; + [SerializeField] + public List EditorEvents; + [SerializeField] + public List EditorParameters; + [SerializeField] + public List MasterBanks; + [SerializeField] + public List StringsBanks; + [SerializeField] + Int64 stringsBankWriteTime; + [SerializeField] + public int cacheVersion; + + public DateTime StringsBankWriteTime + { + get { return new DateTime(stringsBankWriteTime); } + set { stringsBankWriteTime = value.Ticks; } + } + + public EventCache() + { + EditorBanks = new List(); + EditorEvents = new List(); + EditorParameters = new List(); + MasterBanks = new List(); + StringsBanks = new List(); + stringsBankWriteTime = 0; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventCache.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventCache.cs.meta new file mode 100644 index 0000000..240bc22 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventCache.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: d32cf7c32a3ed8347bac48ef5ed56d82 +timeCreated: 1432775088 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventManager.cs b/Assets/Plugins/FMOD/src/Editor/EventManager.cs new file mode 100644 index 0000000..be0817c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventManager.cs @@ -0,0 +1,918 @@ +using UnityEngine; +using UnityEditor; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using UnityEditor.Build; +#if UNITY_2018_1_OR_NEWER +using UnityEditor.Build.Reporting; +#endif + +namespace FMODUnity +{ + [InitializeOnLoad] + public class EventManager : MonoBehaviour + { + const string CacheAssetName = "FMODStudioCache"; + const string CacheAssetFullName = "Assets/Plugins/FMOD/Cache/Editor/" + CacheAssetName + ".asset"; + static EventCache eventCache; + + const string StringBankExtension = "strings.bank"; + const string BankExtension = "bank"; + + const int FilePollTimeSeconds = 5; + + // How many seconds to wait since last file activity to start the import + const int CountdownTimerReset = 15 / FilePollTimeSeconds; + + static int countdownTimer; + + public static bool removeBanks = false; + +#if UNITY_EDITOR + [MenuItem("FMOD/Refresh Banks", priority = 1)] + public static void RefreshBanks() + { + countdownTimer = 0; + UpdateCache(); + OnCacheChange(); + CopyToStreamingAssets(); + } +#endif + + static void ClearCache() + { + countdownTimer = CountdownTimerReset; + eventCache.StringsBankWriteTime = DateTime.MinValue; + eventCache.EditorBanks.Clear(); + eventCache.EditorEvents.Clear(); + eventCache.EditorParameters.Clear(); + eventCache.StringsBanks.Clear(); + eventCache.MasterBanks.Clear(); + if (Settings.Instance && Settings.Instance.BanksToLoad != null) + Settings.Instance.BanksToLoad.Clear(); + } + + static public void UpdateCache() + { + // Deserialize the cache from the unity resources + if (eventCache == null) + { + eventCache = AssetDatabase.LoadAssetAtPath(CacheAssetFullName, typeof(EventCache)) as EventCache; + if (eventCache == null || eventCache.cacheVersion != EventCache.CurrentCacheVersion) + { + UnityEngine.Debug.Log("FMOD Studio: Cannot find serialized event cache or cache in old format, creating new instance"); + eventCache = ScriptableObject.CreateInstance(); + eventCache.cacheVersion = EventCache.CurrentCacheVersion; + + Directory.CreateDirectory(Path.GetDirectoryName(CacheAssetFullName)); + AssetDatabase.CreateAsset(eventCache, CacheAssetFullName); + } + } + + var settings = Settings.Instance; + + if (string.IsNullOrEmpty(settings.SourceBankPath)) + { + ClearCache(); + return; + } + + string defaultBankFolder = null; + + if (!Settings.Instance.HasPlatforms) + { + defaultBankFolder = settings.SourceBankPath; + } + else + { + FMODPlatform platform = RuntimeUtils.GetEditorFMODPlatform(); + if (platform == FMODPlatform.None) + { + platform = FMODPlatform.PlayInEditor; + } + + defaultBankFolder = RuntimeUtils.GetCommonPlatformPath(Path.Combine(settings.SourceBankPath, Settings.Instance.GetBankPlatform(platform))); + } + + string[] bankPlatforms = EditorUtils.GetBankPlatforms(); + string[] bankFolders = new string[bankPlatforms.Length]; + for (int i = 0; i < bankPlatforms.Length; i++) + { + bankFolders[i] = RuntimeUtils.GetCommonPlatformPath(Path.Combine(settings.SourceBankPath, bankPlatforms[i])); + } + + List stringBanks = new List(0); + try + { + var files = Directory.GetFiles(defaultBankFolder, "*." + StringBankExtension, SearchOption.AllDirectories); + stringBanks = new List(files); + } + catch + { + } + + // Strip out OSX resource-fork files that appear on FAT32 + stringBanks.RemoveAll((x) => Path.GetFileName(x).StartsWith("._")); + + if (stringBanks.Count == 0) + { + bool wasValid = eventCache.StringsBankWriteTime != DateTime.MinValue; + ClearCache(); + if (wasValid) + { + UnityEngine.Debug.LogError(string.Format("FMOD Studio: Directory {0} doesn't contain any banks. Build the banks in Studio or check the path in the settings.", defaultBankFolder)); + } + return; + } + + // If we have multiple .strings.bank files find the most recent + stringBanks.Sort((a, b) => File.GetLastWriteTime(b).CompareTo(File.GetLastWriteTime(a))); + + // Use the most recent string bank timestamp as a marker for the most recent build of any bank because it gets exported every time + DateTime lastWriteTime = File.GetLastWriteTime(stringBanks[0]); + + if (lastWriteTime == eventCache.StringsBankWriteTime) + { + countdownTimer = CountdownTimerReset; + return; + } + + if (EditorUtils.IsFileOpenByStudio(stringBanks[0])) + { + countdownTimer = CountdownTimerReset; + return; + } + + // Most recent strings bank is newer than last cache update time, recache. + + // Get a list of all banks + List bankFileNames = new List(); + List reducedStringBanksList = new List(); + HashSet stringBankGuids = new HashSet(); + + foreach (string stringBankPath in stringBanks) + { + FMOD.Studio.Bank stringBank; + EditorUtils.CheckResult(EditorUtils.System.loadBankFile(stringBankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out stringBank)); + + if (!stringBank.isValid()) + { + countdownTimer = CountdownTimerReset; + return; + } + else + { + // Unload the strings bank + stringBank.unload(); + } + Guid stringBankGuid; + EditorUtils.CheckResult(stringBank.getID(out stringBankGuid)); + + if (!stringBankGuids.Add(stringBankGuid)) + { + // If we encounter multiple string banks with the same GUID then only use the first. This handles the scenario where + // a Studio project is cloned and extended for DLC with a new master bank name. + continue; + } + + reducedStringBanksList.Add(stringBankPath); + } + + bankFileNames = new List(Directory.GetFiles(defaultBankFolder, "*.bank", SearchOption.AllDirectories)); + bankFileNames.RemoveAll(x => x.Contains(".strings")); + + stringBanks = reducedStringBanksList; + + if (!UnityEditorInternal.InternalEditorUtility.inBatchMode) + { + // Check if any of the files are still being written by studio + foreach (string bankFileName in bankFileNames) + { + EditorBankRef bankRef = eventCache.EditorBanks.Find((x) => RuntimeUtils.GetCommonPlatformPath(bankFileName) == x.Path); + if (bankRef == null) + { + if (EditorUtils.IsFileOpenByStudio(bankFileName)) + { + countdownTimer = CountdownTimerReset; + return; + } + continue; + } + + if (bankRef.LastModified != File.GetLastWriteTime(bankFileName)) + { + if (EditorUtils.IsFileOpenByStudio(bankFileName)) + { + countdownTimer = CountdownTimerReset; + return; + } + } + } + + // Count down the timer in case we catch studio in-between updating two files. + if (countdownTimer-- > 0) + { + return; + } + } + + eventCache.StringsBankWriteTime = lastWriteTime; + + // All files are finished being modified by studio so update the cache + + // Stop editor preview so no stale data being held + EditorUtils.PreviewStop(); + + // Reload the strings banks + List loadedStringsBanks = new List(); + + try + { + AssetDatabase.StartAssetEditing(); + + eventCache.EditorBanks.ForEach((x) => x.Exists = false); + HashSet masterBankFileNames = new HashSet(); + + foreach (string stringBankPath in stringBanks) + { + FMOD.Studio.Bank stringBank; + EditorUtils.CheckResult(EditorUtils.System.loadBankFile(stringBankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out stringBank)); + + if (!stringBank.isValid()) + { + ClearCache(); + return; + } + + loadedStringsBanks.Add(stringBank); + + FileInfo stringBankFileInfo = new FileInfo(stringBankPath); + + string masterBankFileName = Path.GetFileName(stringBankPath).Replace(StringBankExtension, BankExtension); + masterBankFileNames.Add(masterBankFileName); + + EditorBankRef stringsBankRef = eventCache.StringsBanks.Find(x => RuntimeUtils.GetCommonPlatformPath(stringBankPath) == x.Path); + + if (stringsBankRef == null) + { + stringsBankRef = ScriptableObject.CreateInstance(); + stringsBankRef.FileSizes = new List(); + AssetDatabase.AddObjectToAsset(stringsBankRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(stringsBankRef)); + eventCache.EditorBanks.Add(stringsBankRef); + eventCache.StringsBanks.Add(stringsBankRef); + } + + stringsBankRef.SetPath(stringBankPath, defaultBankFolder); + stringsBankRef.LastModified = stringBankFileInfo.LastWriteTime; + stringsBankRef.Exists = true; + stringsBankRef.FileSizes.Clear(); + + if (Settings.Instance.HasPlatforms) + { + for (int i = 0; i < bankPlatforms.Length; i++) + { + stringsBankRef.FileSizes.Add(new EditorBankRef.NameValuePair(bankPlatforms[i], stringBankFileInfo.Length)); + } + } + else + { + stringsBankRef.FileSizes.Add(new EditorBankRef.NameValuePair("", stringBankFileInfo.Length)); + } + } + + eventCache.EditorParameters.ForEach((x) => x.Exists = false); + foreach (string bankFileName in bankFileNames) + { + EditorBankRef bankRef = eventCache.EditorBanks.Find((x) => RuntimeUtils.GetCommonPlatformPath(bankFileName) == x.Path); + + // New bank we've never seen before + if (bankRef == null) + { + bankRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(bankRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(bankRef)); + + bankRef.SetPath(bankFileName, defaultBankFolder); + bankRef.LastModified = DateTime.MinValue; + bankRef.FileSizes = new List(); + + eventCache.EditorBanks.Add(bankRef); + } + + bankRef.Exists = true; + + FileInfo bankFileInfo = new FileInfo(bankFileName); + + // Timestamp check - if it doesn't match update events from that bank + if (bankRef.LastModified != bankFileInfo.LastWriteTime) + { + bankRef.LastModified = bankFileInfo.LastWriteTime; + UpdateCacheBank(bankRef); + } + + // Update file sizes + bankRef.FileSizes.Clear(); + if (Settings.Instance.HasPlatforms) + { + for (int i = 0; i < bankPlatforms.Length; i++) + { + string platformBankPath = RuntimeUtils.GetCommonPlatformPath(Path.Combine(bankFolders[i], bankFileName)); + var fileInfo = new FileInfo(platformBankPath); + if (fileInfo.Exists) + { + bankRef.FileSizes.Add(new EditorBankRef.NameValuePair(bankPlatforms[i], fileInfo.Length)); + } + } + } + else + { + string platformBankPath = RuntimeUtils.GetCommonPlatformPath(Path.Combine(Settings.Instance.SourceBankPath, bankFileName)); + var fileInfo = new FileInfo(platformBankPath); + if (fileInfo.Exists) + { + bankRef.FileSizes.Add(new EditorBankRef.NameValuePair("", fileInfo.Length)); + } + } + + if (masterBankFileNames.Contains(bankFileInfo.Name)) + { + if (!eventCache.MasterBanks.Exists(x => RuntimeUtils.GetCommonPlatformPath(bankFileName) == x.Path)) + { + eventCache.MasterBanks.Add(bankRef); + } + } + } + + // Remove any stale entries from bank, event and parameter lists + eventCache.EditorBanks.FindAll((x) => !x.Exists).ForEach(RemoveCacheBank); + eventCache.EditorBanks.RemoveAll((x) => !x.Exists); + eventCache.EditorEvents.RemoveAll((x) => x.Banks.Count == 0); + eventCache.EditorParameters.RemoveAll((x) => !x.Exists); + eventCache.MasterBanks.RemoveAll((x) => !x.Exists); + eventCache.StringsBanks.RemoveAll((x) => !x.Exists); + } + finally + { + // Unload the strings banks + loadedStringsBanks.ForEach(x => x.unload()); + AssetDatabase.StopAssetEditing(); + } + } + + static void UpdateCacheBank(EditorBankRef bankRef) + { + // Clear out any cached events from this bank + eventCache.EditorEvents.ForEach((x) => x.Banks.Remove(bankRef)); + + FMOD.Studio.Bank bank; + bankRef.LoadResult = EditorUtils.System.loadBankFile(bankRef.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out bank); + + if (bankRef.LoadResult == FMOD.RESULT.ERR_EVENT_ALREADY_LOADED) + { + EditorUtils.System.getBank(bankRef.Name, out bank); + bank.unload(); + bankRef.LoadResult = EditorUtils.System.loadBankFile(bankRef.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out bank); + } + + if (bankRef.LoadResult == FMOD.RESULT.OK) + { + // Iterate all events in the bank and cache them + FMOD.Studio.EventDescription[] eventList; + var result = bank.getEventList(out eventList); + if (result == FMOD.RESULT.OK) + { + foreach (var eventDesc in eventList) + { + string path; + result = eventDesc.getPath(out path); + EditorEventRef eventRef = eventCache.EditorEvents.Find((x) => x.Path == path); + if (eventRef == null) + { + eventRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(eventRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(eventRef)); + eventRef.Banks = new List(); + eventCache.EditorEvents.Add(eventRef); + eventRef.Parameters = new List(); + } + + eventRef.Banks.Add(bankRef); + Guid guid; + eventDesc.getID(out guid); + eventRef.Guid = guid; + eventRef.Path = eventRef.name = path; + eventDesc.is3D(out eventRef.Is3D); + eventDesc.isOneshot(out eventRef.IsOneShot); + eventDesc.isStream(out eventRef.IsStream); + eventDesc.getMaximumDistance(out eventRef.MaxDistance); + eventDesc.getMinimumDistance(out eventRef.MinDistance); + eventDesc.getLength(out eventRef.Length); + int paramCount = 0; + eventDesc.getParameterDescriptionCount(out paramCount); + eventRef.Parameters.ForEach((x) => x.Exists = false); + for (int paramIndex = 0; paramIndex < paramCount; paramIndex++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param; + eventDesc.getParameterDescriptionByIndex(paramIndex, out param); + if ((param.flags & FMOD.Studio.PARAMETER_FLAGS.READONLY) != 0) + { + continue; + } + EditorParamRef paramRef = eventRef.Parameters.Find((x) => x.name == param.name); + if (paramRef == null) + { + paramRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(paramRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(paramRef)); + eventRef.Parameters.Add(paramRef); + } + paramRef.Name = param.name; + paramRef.name = "parameter:/" + Path.GetFileName(path) + "/" + paramRef.Name; + paramRef.Min = param.minimum; + paramRef.Max = param.maximum; + paramRef.Default = param.defaultvalue; + paramRef.Exists = true; + } + eventRef.Parameters.RemoveAll((x) => !x.Exists); + } + } + + // Update global parameter list for each bank + FMOD.Studio.PARAMETER_DESCRIPTION[] parameterDescriptions; + result = EditorUtils.System.getParameterDescriptionList(out parameterDescriptions); + if (result == FMOD.RESULT.OK) + { + for (int i = 0; i < parameterDescriptions.Length; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param = parameterDescriptions[i]; + if (param.flags == FMOD.Studio.PARAMETER_FLAGS.GLOBAL) + { + EditorParamRef paramRef = eventCache.EditorParameters.Find((x) => + (parameterDescriptions[i].id.data1 == x.ID.data1 && param.id.data2 == x.ID.data2)); + if (paramRef == null) + { + paramRef = ScriptableObject.CreateInstance(); + AssetDatabase.AddObjectToAsset(paramRef, eventCache); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(paramRef)); + eventCache.EditorParameters.Add(paramRef); + paramRef.ID = param.id; + } + paramRef.Name = paramRef.name = param.name; + paramRef.Min = param.minimum; + paramRef.Max = param.maximum; + paramRef.Default = param.defaultvalue; + paramRef.Exists = true; + } + } + } + bank.unload(); + } + else + { + Debug.LogError(string.Format("FMOD Studio: Unable to load {0}: {1}", bankRef.Name, FMOD.Error.String(bankRef.LoadResult))); + eventCache.StringsBankWriteTime = DateTime.MinValue; + } + } + + static void RemoveCacheBank(EditorBankRef bankRef) + { + eventCache.EditorEvents.ForEach((x) => x.Banks.Remove(bankRef)); + } + + static EventManager() + { + countdownTimer = CountdownTimerReset; + EditorApplication.update += Update; + } + + private const string FMODLabel = "FMOD"; + + public static void CopyToStreamingAssets() + { + if (string.IsNullOrEmpty(Settings.Instance.SourceBankPath)) + return; + + FMODPlatform platform = RuntimeUtils.GetEditorFMODPlatform(); + if (platform == FMODPlatform.None) + { + UnityEngine.Debug.LogWarning(string.Format("FMOD Studio: copy banks for platform {0} : Unsupported platform", EditorUserBuildSettings.activeBuildTarget.ToString())); + return; + } + + string bankTargetFolder = + Settings.Instance.ImportType == ImportType.StreamingAssets + ? Application.dataPath + "/StreamingAssets" + : Application.dataPath + (string.IsNullOrEmpty(Settings.Instance.TargetAssetPath) ? "" : '/' + Settings.Instance.TargetAssetPath); + bankTargetFolder = RuntimeUtils.GetCommonPlatformPath(bankTargetFolder); + Directory.CreateDirectory(bankTargetFolder); + + string bankTargetExtension = + Settings.Instance.ImportType == ImportType.StreamingAssets + ? ".bank" + : ".bytes"; + + string bankSourceFolder = + Settings.Instance.HasPlatforms + ? Settings.Instance.SourceBankPath + '/' + Settings.Instance.GetBankPlatform(platform) + : Settings.Instance.SourceBankPath; + bankSourceFolder = RuntimeUtils.GetCommonPlatformPath(bankSourceFolder); + + if (Path.GetFullPath(bankTargetFolder).TrimEnd('/').ToUpperInvariant() == + Path.GetFullPath(bankSourceFolder).TrimEnd('/').ToUpperInvariant()) + { + return; + } + + bool madeChanges = false; + + if (removeBanks) + { + string oldBankTargetFolder = + Settings.Instance.ImportType == ImportType.AssetBundle + ? Application.dataPath + "/StreamingAssets" + : Application.dataPath + "/" + Settings.Instance.TargetAssetPath; + + RemoveBanks(oldBankTargetFolder); + madeChanges = true; + } + + try + { + // Clean out any stale .bank files + string[] existingBankFiles = + Directory.GetFiles(bankTargetFolder, "*" + bankTargetExtension, SearchOption.AllDirectories); + + foreach (string bankFilePath in existingBankFiles) + { + string bankName = EditorBankRef.CalculateName(bankFilePath, bankTargetFolder); + + if (!eventCache.EditorBanks.Exists(x => x.Name == bankName)) + { + string assetPath = bankFilePath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel)) + { + AssetDatabase.MoveAssetToTrash(assetPath); + madeChanges = true; + } + } + } + + // Copy over any files that don't match timestamp or size or don't exist + foreach (var bankRef in eventCache.EditorBanks) + { + string sourcePath = bankSourceFolder + "/" + bankRef.Name + ".bank"; + string targetPathRelative = bankRef.Name + bankTargetExtension; + string targetPathFull = bankTargetFolder + "/" + targetPathRelative; + + FileInfo sourceInfo = new FileInfo(sourcePath); + FileInfo targetInfo = new FileInfo(targetPathFull); + + if (!targetInfo.Exists || + sourceInfo.Length != targetInfo.Length || + sourceInfo.LastWriteTime != targetInfo.LastWriteTime) + { + if (targetInfo.Exists) + { + targetInfo.IsReadOnly = false; + } + else + { + EnsureFoldersExist(targetPathRelative, bankTargetFolder); + } + + File.Copy(sourcePath, targetPathFull, true); + targetInfo = new FileInfo(targetPathFull); + targetInfo.IsReadOnly = false; + targetInfo.LastWriteTime = sourceInfo.LastWriteTime; + + madeChanges = true; + + string assetString = targetPathFull.Replace(Application.dataPath, "Assets"); + AssetDatabase.ImportAsset(assetString); + UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath(assetString); + AssetDatabase.SetLabels(obj, new string[] { FMODLabel }); + } + } + + RemoveEmptyFMODFolders(bankTargetFolder); + } + catch(Exception exception) + { + UnityEngine.Debug.LogError(string.Format("FMOD Studio: copy banks for platform {0} : copying banks from {1} to {2}", platform.ToString(), bankSourceFolder, bankTargetFolder)); + UnityEngine.Debug.LogException(exception); + return; + } + + if (madeChanges) + { + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + UnityEngine.Debug.Log(string.Format("FMOD Studio: copy banks for platform {0} : copying banks from {1} to {2} succeeded", platform.ToString(), bankSourceFolder, bankTargetFolder)); + } + } + + private static void EnsureFoldersExist(string filePath, string basePath) + { + string dataPath = Application.dataPath + "/"; + + if (!basePath.StartsWith(dataPath)) + { + throw new ArgumentException( + string.Format("Base path {0} is not within the Assets folder", basePath), "basePath"); + } + + int lastSlash = filePath.LastIndexOf('/'); + + if (lastSlash == -1) + { + // No folders + return; + } + + string assetString = filePath.Substring(0, lastSlash); + + string[] folders = assetString.Split('/'); + string parentFolder = "Assets/" + basePath.Substring(dataPath.Length); + + for (int i = 0; i < folders.Length; ++i) + { + string folderPath = parentFolder + "/" + folders[i]; + + if (!AssetDatabase.IsValidFolder(folderPath)) + { + AssetDatabase.CreateFolder(parentFolder, folders[i]); + + var folder = AssetDatabase.LoadAssetAtPath(folderPath); + AssetDatabase.SetLabels(folder, new string[] { FMODLabel }); + } + + parentFolder = folderPath; + } + } + + private static void BuildTargetChanged() + { + RefreshBanks(); + #if UNITY_ANDROID + Settings.Instance.AndroidUseOBB = PlayerSettings.Android.useAPKExpansionFiles; + #endif + } + + static void OnCacheChange() + { + List masterBanks = new List(); + List banks = new List(); + + var settings = Settings.Instance; + bool hasChanged = false; + + foreach (EditorBankRef bankRef in eventCache.MasterBanks) + { + masterBanks.Add(bankRef.Name); + } + + if (!CompareLists(masterBanks, settings.MasterBanks)) + { + settings.MasterBanks.Clear(); + settings.MasterBanks.AddRange(masterBanks); + hasChanged = true; + } + + foreach (var bankRef in eventCache.EditorBanks) + { + if (!eventCache.MasterBanks.Contains(bankRef) && + !eventCache.StringsBanks.Contains(bankRef)) + { + banks.Add(bankRef.Name); + } + } + banks.Sort((a, b) => string.Compare(a, b, StringComparison.CurrentCultureIgnoreCase)); + + if (!CompareLists(banks, settings.Banks)) + { + settings.Banks.Clear(); + settings.Banks.AddRange(banks); + hasChanged = true; + } + + if (hasChanged) + { + EditorUtility.SetDirty(settings); + EventBrowser.RepaintEventBrowser(); + } + } + + static bool firstUpdate = true; + static float lastCheckTime; + static void Update() + { + if (firstUpdate) + { + RefreshBanks(); + bool isValid; + string validateMessage; + EditorUtils.ValidateSource(out isValid, out validateMessage); + if (!isValid) + { + Debug.LogError("FMOD Studio: " + validateMessage); + } + firstUpdate = false; + lastCheckTime = Time.realtimeSinceStartup; + } + + if (lastCheckTime + FilePollTimeSeconds < Time.realtimeSinceStartup) + { + RefreshBanks(); + lastCheckTime = Time.realtimeSinceStartup; + } + } + + public static List Events + { + get + { + UpdateCache(); + return eventCache.EditorEvents; + } + } + + public static List Banks + { + get + { + UpdateCache(); + return eventCache.EditorBanks; + } + } + + public static List Parameters + { + get + { + UpdateCache(); + return eventCache.EditorParameters; + } + } + + public static List MasterBanks + { + get + { + UpdateCache(); + return eventCache.MasterBanks; + } + } + + public static bool IsLoaded + { + get + { + return Settings.Instance.SourceBankPath != null; + } + } + + public static bool IsValid + { + get + { + UpdateCache(); + return eventCache.StringsBankWriteTime != DateTime.MinValue; + } + } + + public static EditorEventRef EventFromPath(string pathOrGuid) + { + EditorEventRef eventRef; + if (pathOrGuid.StartsWith("{")) + { + Guid guid = new Guid(pathOrGuid); + eventRef = EventFromGUID(guid); + } + else + { + eventRef = EventFromString(pathOrGuid); + } + return eventRef; + } + + public static EditorEventRef EventFromString(string path) + { + UpdateCache(); + return eventCache.EditorEvents.Find((x) => x.Path.Equals(path, StringComparison.CurrentCultureIgnoreCase)); + } + + public static EditorEventRef EventFromGUID(Guid guid) + { + UpdateCache(); + return eventCache.EditorEvents.Find((x) => x.Guid == guid); + } + + public static EditorParamRef ParamFromPath(string name) + { + UpdateCache(); + return eventCache.EditorParameters.Find((x) => x.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)); + } + + public class ActiveBuildTargetListener : IActiveBuildTargetChanged + { + public int callbackOrder{ get { return 0; } } + public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget) + { + BuildTargetChanged(); + } + } + #if UNITY_2018_1_OR_NEWER + public class PreprocessBuild : IPreprocessBuildWithReport + { + public int callbackOrder { get { return 0; } } + public void OnPreprocessBuild(BuildReport report) + { + BuildTargetChanged(); + } + } + #else + public class PreprocessBuild : IPreprocessBuild + { + public int callbackOrder { get { return 0; } } + public void OnPreprocessBuild(BuildTarget target, string path) + { + BuildTargetChanged(); + } + } + #endif + + private static bool CompareLists(List tempBanks, List banks) + { + if (tempBanks.Count != banks.Count) + return false; + + for (int i = 0; i < tempBanks.Count; i++) + { + if (tempBanks[i] != banks[i]) + return false; + } + return true; + } + + private static bool AssetHasLabel(string assetPath, string label) + { + AssetDatabase.ImportAsset(assetPath); + UnityEngine.Object asset = AssetDatabase.LoadAssetAtPath(assetPath); + string[] labels = AssetDatabase.GetLabels(asset); + + return labels.Contains(label); + } + + const string AssetsFolderName = "Assets"; + + public static void RemoveBanks(string basePath) + { + string[] filePaths = Directory.GetFiles(basePath, "*", SearchOption.AllDirectories); + + foreach (string filePath in filePaths) + { + if (!filePath.EndsWith(".meta")) + { + string assetPath = filePath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel)) + { + AssetDatabase.MoveAssetToTrash(assetPath); + } + } + } + + RemoveEmptyFMODFolders(basePath); + + if (Directory.GetFileSystemEntries(basePath).Length == 0) + { + string baseFolder = basePath.Replace(Application.dataPath, AssetsFolderName); + AssetDatabase.MoveAssetToTrash(baseFolder); + } + + removeBanks = false; + } + + public static void RemoveEmptyFMODFolders(string basePath) + { + string[] folderPaths = Directory.GetDirectories(basePath, "*", SearchOption.AllDirectories); + + // Process longest paths first so parent folders are cleared out when we get to them + Array.Sort(folderPaths, (a, b) => b.Length.CompareTo(a.Length)); + + foreach (string folderPath in folderPaths) + { + string assetPath = folderPath.Replace(Application.dataPath, AssetsFolderName); + + if (AssetHasLabel(assetPath, FMODLabel) && Directory.GetFileSystemEntries(folderPath).Length == 0) + { + AssetDatabase.MoveAssetToTrash(assetPath); + } + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventManager.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventManager.cs.meta new file mode 100644 index 0000000..6219271 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1fc38201a5edb994c874a4a61e96053b +timeCreated: 1432600216 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs new file mode 100644 index 0000000..44d6cdd --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs @@ -0,0 +1,156 @@ +using System; +using System.Linq; +using System.Text; +using UnityEngine; +using UnityEditor; +using System.IO; + +namespace FMODUnity +{ + [CustomPropertyDrawer(typeof(EventRefAttribute))] + class EventRefDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + Texture browseIcon = EditorGUIUtility.Load("FMOD/SearchIconBlack.png") as Texture; + Texture openIcon = EditorGUIUtility.Load("FMOD/BrowserIcon.png") as Texture; + Texture addIcon = EditorGUIUtility.Load("FMOD/AddIcon.png") as Texture; + + label = EditorGUI.BeginProperty(position, label, property); + SerializedProperty pathProperty = property; + + Event e = Event.current; + if (e.type == EventType.DragPerform && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef)) + { + pathProperty.stringValue = ((EditorEventRef)DragAndDrop.objectReferences[0]).Path; + GUI.changed = true; + e.Use(); + } + } + if (e.type == EventType.DragUpdated && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorEventRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + float baseHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + GUIStyle buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = 1; + buttonStyle.padding.bottom = 1; + + Rect addRect = new Rect(position.x + position.width - addIcon.width - 7, position.y, addIcon.width + 7, baseHeight); + Rect openRect = new Rect(addRect.x - openIcon.width - 7, position.y, openIcon.width + 6, baseHeight); + Rect searchRect = new Rect(openRect.x - browseIcon.width - 9, position.y, browseIcon.width + 8, baseHeight); + Rect pathRect = new Rect(position.x, position.y, searchRect.x - position.x - 3, baseHeight); + + EditorGUI.PropertyField(pathRect, pathProperty, GUIContent.none); + + if (GUI.Button(searchRect, new GUIContent(browseIcon, "Search"), buttonStyle)) + { + var eventBrowser = EventBrowser.CreateInstance(); + + eventBrowser.SelectEvent(property); + var windowRect = position; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = openRect.height + 1; + eventBrowser.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 400)); + + } + if (GUI.Button(addRect, new GUIContent(addIcon, "Create New Event in Studio"), buttonStyle)) + { + var addDropdown= EditorWindow.CreateInstance(); + + addDropdown.SelectEvent(property); + var windowRect = position; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = openRect.height + 1; + addDropdown.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 500)); + + } + if (GUI.Button(openRect, new GUIContent(openIcon, "Open In Browser"), buttonStyle) && + !string.IsNullOrEmpty(pathProperty.stringValue) && + EventManager.EventFromPath(pathProperty.stringValue) != null + ) + { + EventBrowser.ShowEventBrowser(); + var eventBrowser = EditorWindow.GetWindow(); + eventBrowser.JumpToEvent(pathProperty.stringValue); + } + + if (!string.IsNullOrEmpty(pathProperty.stringValue) && EventManager.EventFromPath(pathProperty.stringValue) != null) + { + Rect foldoutRect = new Rect(position.x + 10, position.y + baseHeight, position.width, baseHeight); + property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, "Event Properties"); + if (property.isExpanded) + { + var style = new GUIStyle(GUI.skin.label); + style.richText = true; + EditorEventRef eventRef = EventManager.EventFromPath(pathProperty.stringValue); + float width = style.CalcSize(new GUIContent("Oneshot")).x; + Rect labelRect = new Rect(position.x, position.y + baseHeight * 2, width, baseHeight); + Rect valueRect = new Rect(position.x + width + 10, position.y + baseHeight * 2, pathRect.width, baseHeight); + + if (pathProperty.stringValue.StartsWith("{")) + { + GUI.Label(labelRect, new GUIContent("Path"), style); + EditorGUI.SelectableLabel(valueRect, eventRef.Path); + } + else + { + GUI.Label(labelRect, new GUIContent("GUID"), style); + EditorGUI.SelectableLabel(valueRect, eventRef.Guid.ToString("b")); + } + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent("Banks"), style); + GUI.Label(valueRect, string.Join(", ", eventRef.Banks.Select(x => x.Name).ToArray())); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent("Panning"), style); + GUI.Label(valueRect, eventRef.Is3D ? "3D" : "2D"); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent("Stream"), style); + GUI.Label(valueRect, eventRef.IsStream.ToString()); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + + GUI.Label(labelRect, new GUIContent("Oneshot"), style); + GUI.Label(valueRect, eventRef.IsOneShot.ToString()); + labelRect.y += baseHeight; + valueRect.y += baseHeight; + } + } + else + { + Rect labelRect = new Rect(position.x, position.y + baseHeight, position.width, baseHeight); + GUI.Label(labelRect, new GUIContent("Event Not Found", EditorGUIUtility.Load("FMOD/NotFound.png") as Texture2D)); + } + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + bool expanded = property.isExpanded && !string.IsNullOrEmpty(property.stringValue) && EventManager.EventFromPath(property.stringValue) != null; + float baseHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + return baseHeight * (expanded ? 7 : 2); // 6 lines of info + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs.meta new file mode 100644 index 0000000..f745acf --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/EventRefDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 29a86a77bf7568e499243d9b47b7e88e +timeCreated: 1432696197 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef new file mode 100644 index 0000000..4c43a94 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef @@ -0,0 +1,23 @@ +{ + "name": "FMODUnityEditor", + "references": [ + "FMODUnity" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.timeline", + "expression": "1.0.0", + "define": "UNITY_TIMELINE_EXIST" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef.meta b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef.meta new file mode 100644 index 0000000..29f0dc8 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FMODUnityEditor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: aab3caaf43456d6449a3e035348ff798 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs new file mode 100644 index 0000000..1fbe4b1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs @@ -0,0 +1,199 @@ +using System; +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; + +namespace FMODUnity +{ + class FindAndReplace : EditorWindow + { + [MenuItem("FMOD/Find and Replace", priority = 2)] + static void ShowFindAndReplace() + { + var window = CreateInstance(); + window.titleContent = new GUIContent("FMOD Find and Replace"); + window.OnHierarchyChange(); + var position = window.position; + window.maxSize = window.minSize = position.size = new Vector2(400, 170); + window.position = position; + window.ShowUtility(); + } + + bool levelScope = true; + bool prefabScope; + string findText; + string replaceText; + string message = ""; + MessageType messageType = MessageType.None; + int lastMatch = -1; + List emitters; + + void OnHierarchyChange() + { + emitters = new List(Resources.FindObjectsOfTypeAll()); + + if (!levelScope) + { + #if UNITY_2018_3_OR_NEWER + emitters.RemoveAll(x => PrefabUtility.GetPrefabAssetType(x) == PrefabAssetType.NotAPrefab); + #else + emitters.RemoveAll(x => PrefabUtility.GetPrefabType(x) != PrefabType.Prefab); + #endif + } + + if (!prefabScope) + { + #if UNITY_2018_3_OR_NEWER + emitters.RemoveAll(x => PrefabUtility.GetPrefabAssetType(x) == PrefabAssetType.NotAPrefab); + #else + emitters.RemoveAll(x => PrefabUtility.GetPrefabType(x) != PrefabType.Prefab); + #endif + } + } + + bool first = true; + + void OnGUI() + { + bool doFind = false; + if ((Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Return)) + { + Event.current.Use(); + doFind = true; + } + + GUI.SetNextControlName("find"); + EditorGUILayout.PrefixLabel("Find:"); + EditorGUI.BeginChangeCheck(); + findText = EditorGUILayout.TextField(findText); + if (EditorGUI.EndChangeCheck()) + { + lastMatch = -1; + message = null; + } + EditorGUILayout.PrefixLabel("Replace:"); + replaceText = EditorGUILayout.TextField(replaceText); + + EditorGUILayout.BeginHorizontal(); + EditorGUI.BeginChangeCheck(); + levelScope = EditorGUILayout.ToggleLeft("Current Level", levelScope, GUILayout.ExpandWidth(false)); + prefabScope = EditorGUILayout.ToggleLeft("Prefabs", prefabScope, GUILayout.ExpandWidth(false)); + if (EditorGUI.EndChangeCheck()) + { + OnHierarchyChange(); + } + EditorGUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + if (GUILayout.Button("Find") || doFind) + { + message = ""; + { + FindNext(); + } + if (lastMatch == -1) + { + message = "Finished Search"; + messageType = MessageType.Warning; + } + } + if (GUILayout.Button("Replace")) + { + message = ""; + if (lastMatch == -1) + { + FindNext(); + } + else + { + Replace(); + } + if (lastMatch == -1) + { + message = "Finished Search"; + messageType = MessageType.Warning; + } + } + if (GUILayout.Button("Replace All")) + { + if (EditorUtility.DisplayDialog("Replace All", "Are you sure you wish to replace all in the current hierachy?", "yes", "no")) + { + ReplaceAll(); + } + } + GUILayout.EndHorizontal(); + if (!string.IsNullOrEmpty(message)) + { + EditorGUILayout.HelpBox(message, messageType); + } + else + { + EditorGUILayout.HelpBox("\n\n", MessageType.None); + } + + if (first) + { + first = false; + EditorGUI.FocusTextInControl("find"); + } + } + + void FindNext() + { + for (int i = lastMatch + 1; i < emitters.Count; i++) + { + if (emitters[i].Event.IndexOf(findText, 0, StringComparison.CurrentCultureIgnoreCase) >= 0) + { + lastMatch = i; + EditorGUIUtility.PingObject(emitters[i]); + Selection.activeGameObject = emitters[i].gameObject; + message = "Found object"; + messageType = MessageType.Info; + return; + } + } + lastMatch = -1; + } + + void ReplaceAll() + { + int replaced = 0; + for (int i = 0; i < emitters.Count; i++) + { + if (ReplaceText(emitters[i])) + { + replaced++; + } + } + + message = string.Format("{0} replaced", replaced); + messageType = MessageType.Info; + } + + bool ReplaceText(StudioEventEmitter emitter) + { + int findLength = findText.Length; + int replaceLength = replaceText.Length; + int position = 0; + var serializedObject = new SerializedObject(emitter); + var pathProperty = serializedObject.FindProperty("Event"); + string path = pathProperty.stringValue; + position = path.IndexOf(findText, position, StringComparison.CurrentCultureIgnoreCase); + while (position >= 0) + { + path = path.Remove(position, findLength).Insert(position, replaceText); + position += replaceLength; + position = path.IndexOf(findText, position, StringComparison.CurrentCultureIgnoreCase); + } + pathProperty.stringValue = path; + return serializedObject.ApplyModifiedProperties(); + } + + void Replace() + { + ReplaceText(emitters[lastMatch]); + FindNext(); + } + + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs.meta b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs.meta new file mode 100644 index 0000000..05eaec8 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/FindAndReplace.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a3d0ed60438564241a4e62b152836893 +timeCreated: 1453876443 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/LogViewer.cs b/Assets/Plugins/FMOD/src/Editor/LogViewer.cs new file mode 100644 index 0000000..21cf20c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/LogViewer.cs @@ -0,0 +1,6 @@ +/* This class is now legacy. Keep the definition here for the migration to work */ +using UnityEditor; + +public class LogViewer : EditorWindow +{ +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/LogViewer.cs.meta b/Assets/Plugins/FMOD/src/Editor/LogViewer.cs.meta new file mode 100644 index 0000000..59dc5aa --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/LogViewer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 255133e2dd4fbd9449ba729ddbb2f77f +timeCreated: 1433383105 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs new file mode 100644 index 0000000..81937f0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs @@ -0,0 +1,81 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomPropertyDrawer(typeof(ParamRefAttribute))] + class ParamRefDrawer : PropertyDrawer + { + public bool MouseDrag(Event e) + { + bool isDragging = false; + + if (e.type == EventType.DragPerform) + { + isDragging = true; + } + + return isDragging; + } + + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + Texture browseIcon = EditorGUIUtility.Load("FMOD/SearchIconBlack.png") as Texture; + Texture openIcon = EditorGUIUtility.Load("FMOD/BrowserIcon.png") as Texture; + Texture addIcon = EditorGUIUtility.Load("FMOD/AddIcon.png") as Texture; + + EditorGUI.BeginProperty(position, label, property); + SerializedProperty pathProperty = property; + + Event e = Event.current; + if (MouseDrag(e) && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorParamRef)) + { + pathProperty.stringValue = ((EditorParamRef)DragAndDrop.objectReferences[0]).Name; + GUI.changed = true; + e.Use(); + } + } + if (e.type == EventType.DragUpdated && position.Contains(e.mousePosition)) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorParamRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + float baseHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + GUIStyle buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = 1; + buttonStyle.padding.bottom = 1; + + Rect addRect = new Rect(position.x + position.width - addIcon.width - 7, position.y, addIcon.width + 7, baseHeight); + Rect openRect = new Rect(addRect.x - openIcon.width - 7, position.y, openIcon.width + 6, baseHeight); + Rect searchRect = new Rect(openRect.x - browseIcon.width - 9, position.y, browseIcon.width + 8, baseHeight); + Rect pathRect = new Rect(position.x, position.y, searchRect.x - position.x - 3, baseHeight); + + EditorGUI.PropertyField(pathRect, pathProperty, GUIContent.none); + + if (GUI.Button(searchRect, new GUIContent(browseIcon, "Search"), buttonStyle)) + { + var eventBrowser = EventBrowser.CreateInstance(); + + eventBrowser.SelectParameter(property); + var windowRect = position; + windowRect.position = GUIUtility.GUIToScreenPoint(windowRect.position); + windowRect.height = openRect.height + 1; + eventBrowser.ShowAsDropDown(windowRect, new Vector2(windowRect.width, 400)); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs.meta new file mode 100644 index 0000000..9f73784 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/ParamRefDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ea88808aa26cd614db1c5c1dcbb14d4e +timeCreated: 1444197074 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs new file mode 100644 index 0000000..d160092 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs @@ -0,0 +1,941 @@ +using UnityEngine; +using System.Collections.Generic; +using UnityEditor; +using System.IO; +using System; + +namespace FMODUnity +{ + [CustomEditor(typeof(Settings))] + public class SettingsEditor : Editor + { + string[] ToggleParent = new string[] { "Disabled", "Enabled", "Development Build Only", }; + + string[] ToggleEditor = new string[] { "Enabled", "Disabled", }; + + string[] FrequencyDisplay = new string[] { "Platform Default", "22050", "24000", "32000", "44100", "48000"}; + int[] FrequencyValues = new int[] { 0, 22050, 24000, 32000, 44100, 48000 }; + + string[] SpeakerModeDisplay = new string[] { + "Stereo", + "5.1", + "7.1" }; + + int[] SpeakerModeValues = new int[] { + (int)FMOD.SPEAKERMODE.STEREO, + (int)FMOD.SPEAKERMODE._5POINT1, + (int)FMOD.SPEAKERMODE._7POINT1}; + + bool[] foldoutState = new bool[(int)FMODPlatform.Count]; + + bool hasBankSourceChanged = false; + string targetAssetPath; + bool focused = false; + bool bankFoldOutState = true; + + enum SourceType : uint + { + Project = 0, + Single, + Multi + } + + string PlatformLabel(FMODPlatform platform) + { + switch(platform) + { + case FMODPlatform.Linux: + return "Linux"; + case FMODPlatform.Desktop: + return "Desktop"; + case FMODPlatform.Console: + return "Console"; + case FMODPlatform.iOS: + return "iOS"; + case FMODPlatform.Mac: + return "OSX"; + case FMODPlatform.Mobile: + return "Mobile"; + case FMODPlatform.PS4: + return "PS4"; + case FMODPlatform.Windows: + return "Windows"; + case FMODPlatform.UWP: + return "UWP"; + case FMODPlatform.XboxOne: + return "XBox One"; + case FMODPlatform.Android: + return "Android"; + case FMODPlatform.AppleTV: + return "Apple TV"; + case FMODPlatform.MobileHigh: + return "High-End Mobile"; + case FMODPlatform.MobileLow: + return "Low-End Mobile"; + case FMODPlatform.Stadia: + return "Stadia"; + case FMODPlatform.Switch: + return "Switch"; + } + return "Unknown"; + } + + void DisplayEditorBool(string label, List settings, FMODPlatform platform) + { + int current = Settings.GetSetting(settings, platform, TriStateBool.Disabled) != TriStateBool.Disabled ? 0 : 1; + int next = EditorGUILayout.Popup(label, (int)current, ToggleEditor); + Settings.SetSetting(settings, platform, next == 0 ? TriStateBool.Enabled : TriStateBool.Disabled); + } + + void DisplayParentBool(string label, List settings, FMODPlatform platform) + { + TriStateBool current = Settings.GetSetting(settings, platform, TriStateBool.Disabled); + int next = EditorGUILayout.Popup(label, (int)current, ToggleParent); + Settings.SetSetting(settings, platform, (TriStateBool)next); + } + + void DisplayChildBool(string label, List settings, FMODPlatform platform) + { + bool overriden = Settings.HasSetting(settings, platform); + TriStateBool parent = Settings.GetSetting(settings, Settings.GetParent(platform), TriStateBool.Disabled); + TriStateBool current = Settings.GetSetting(settings, platform, TriStateBool.Disabled); + + string[] toggleChild = new string[ToggleParent.Length + 1]; + Array.Copy(ToggleParent, 0, toggleChild, 1, ToggleParent.Length); + toggleChild[0] = string.Format("Inherit ({0})", ToggleParent[(int)parent]); + + int next = EditorGUILayout.Popup(label, overriden ? (int)current + 1: 0, toggleChild); + if (next == 0) + { + if (overriden) + { + Settings.RemoveSetting(settings, platform); + } + } + else + { + Settings.SetSetting(settings, platform, (TriStateBool)(next-1)); + } + } + + void DisplayParentInt(string label, List settings, FMODPlatform platform, int min, int max) + { + int current = Settings.GetSetting(settings, platform, 0); + int next = EditorGUILayout.IntSlider(label, current, min, max); + Settings.SetSetting(settings, platform, next); + } + + void DisplayChildInt(string label, List settings, FMODPlatform platform, int min, int max) + { + bool overriden = Settings.HasSetting(settings, platform); + int current = Settings.GetSetting(settings, platform, 0); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(label); + overriden = !GUILayout.Toggle(!overriden, "Inherit"); + EditorGUI.BeginDisabledGroup(!overriden); + int next = EditorGUILayout.IntSlider(current, min, max); + EditorGUI.EndDisabledGroup(); + EditorGUILayout.EndHorizontal(); + + if (overriden) + { + Settings.SetSetting(settings, platform, next); + } + else + { + Settings.RemoveSetting(settings, platform); + } + } + + void DisplayParentFreq(string label, List settings, FMODPlatform platform) + { + int current = Settings.GetSetting(settings, platform, 0); + int index = Array.IndexOf(FrequencyValues, current); + int next = EditorGUILayout.Popup(label, index, FrequencyDisplay); + Settings.SetSetting(settings, platform, FrequencyValues[next]); + } + + void DisplayChildFreq(string label, List settings, FMODPlatform platform) + { + bool overriden = Settings.HasSetting(settings, platform); + int current = Settings.GetSetting(settings, platform, 0); + int inherit = Settings.GetSetting(settings, Settings.GetParent(platform), 0); + int currentIndex = Array.IndexOf(FrequencyValues, current); + int inheritIndex = Array.IndexOf(FrequencyValues, inherit); + + string[] valuesChild = new string[FrequencyDisplay.Length + 1]; + Array.Copy(FrequencyDisplay, 0, valuesChild, 1, FrequencyDisplay.Length); + valuesChild[0] = string.Format("Inherit ({0})", FrequencyDisplay[inheritIndex]); + + int next = EditorGUILayout.Popup(label, overriden ? currentIndex + 1 : 0, valuesChild); + if (next == 0) + { + Settings.RemoveSetting(settings, platform); + } + else + { + Settings.SetSetting(settings, platform, FrequencyValues[next-1]); + } + } + + void DisplayParentSpeakerMode(string label, List settings, FMODPlatform platform) + { + int current = Settings.GetSetting(settings, platform, (int)FMOD.SPEAKERMODE.STEREO); + int index = Array.IndexOf(SpeakerModeValues, current); + int next = EditorGUILayout.Popup(label, index, SpeakerModeDisplay); + Settings.SetSetting(settings, platform, SpeakerModeValues[next]); + } + + void DisplayPIESpeakerMode(string label, List settings, FMODPlatform platform) + { + int buildTargetSetting = Settings.GetSetting(settings, RuntimeUtils.GetEditorFMODPlatform(), (int)FMOD.SPEAKERMODE.STEREO); + int buildTargetIndex = Array.IndexOf(SpeakerModeValues, buildTargetSetting); + string[] speakerModes = new string[SpeakerModeDisplay.Length + 1]; + Array.Copy(SpeakerModeDisplay, 0, speakerModes, 1, SpeakerModeDisplay.Length); + speakerModes[0] = string.Format("Current Unity Platform ({0})", SpeakerModeDisplay[buildTargetIndex]); + + bool useCurrentUnity = !Settings.HasSetting(settings, platform); + + int current = Settings.GetSetting(settings, platform, (int)FMOD.SPEAKERMODE.STEREO); + int index = Array.IndexOf(SpeakerModeValues, current) + 1; + if (useCurrentUnity || index < 0) index = 0; + int next = EditorGUILayout.Popup(label, index, speakerModes); + if (next != 0) + { + Settings.SetSetting(settings, platform, SpeakerModeValues[next - 1]); + } + else + { + Settings.RemoveSetting(settings, platform); + } + } + + void DisplayChildSpeakerMode(string label, List settings, FMODPlatform platform) + { + bool overriden = Settings.HasSetting(settings, platform); + int current = Settings.GetSetting(settings, platform, 0); + int inherit = Settings.GetSetting(settings, Settings.GetParent(platform), 0); + int currentIndex = Array.IndexOf(SpeakerModeValues, current); + int inheritIndex = Array.IndexOf(SpeakerModeValues, inherit); + + string[] valuesChild = new string[SpeakerModeDisplay.Length + 1]; + Array.Copy(SpeakerModeDisplay, 0, valuesChild, 1, SpeakerModeDisplay.Length); + valuesChild[0] = string.Format("Inherit ({0})", SpeakerModeDisplay[inheritIndex]); + + int next = EditorGUILayout.Popup(label, overriden ? currentIndex + 1 : 0, valuesChild); + if (next == 0) + { + Settings.RemoveSetting(settings, platform); + } + else + { + Settings.SetSetting(settings, platform, SpeakerModeValues[next - 1]); + } + } + + void DisplayParentBuildDirectory(string label, List settings, FMODPlatform platform) + { + string[] buildDirectories = EditorUtils.GetBankPlatforms(); + + string current = Settings.GetSetting(settings, platform, "Desktop"); + int index = Array.IndexOf(buildDirectories, current); + if (index < 0) index = 0; + + int next = EditorGUILayout.Popup(label, index, buildDirectories); + Settings.SetSetting(settings, platform, buildDirectories[next]); + } + + + void DisplayPIEBuildDirectory(string label, List settings, FMODPlatform platform) + { + string buildTargetSetting = Settings.GetSetting(settings, RuntimeUtils.GetEditorFMODPlatform(), "Desktop"); + string[] buildDirectories = new string[EditorUtils.GetBankPlatforms().Length + 1]; + Array.Copy(EditorUtils.GetBankPlatforms(), 0, buildDirectories, 1, EditorUtils.GetBankPlatforms().Length); + buildDirectories[0] = String.Format("Current Unity Platform ({0})", buildTargetSetting); + + bool useCurrentUnity = !Settings.HasSetting(settings, platform); + string current = Settings.GetSetting(settings, platform, "Desktop"); + int index = Array.IndexOf(buildDirectories, current); + if (useCurrentUnity || index < 0) index = 0; + + int next = EditorGUILayout.Popup(label, index, buildDirectories); + if (next != 0) + { + Settings.SetSetting(settings, platform, buildDirectories[next]); + } + else + { + Settings.RemoveSetting(settings, platform); + } + } + + void DisplayChildBuildDirectories(string label, List settings, FMODPlatform platform) + { + string[] buildDirectories = EditorUtils.GetBankPlatforms(); + + bool overriden = Settings.HasSetting(settings, platform); + string current = Settings.GetSetting(settings, platform, "Desktop"); + string inherit = Settings.GetSetting(settings, Settings.GetParent(platform), "Desktop"); + int index = Array.IndexOf(buildDirectories, current); + if (index < 0) index = 0; + + string[] valuesChild = new string[buildDirectories.Length + 1]; + Array.Copy(buildDirectories, 0, valuesChild, 1, buildDirectories.Length); + valuesChild[0] = string.Format("Inherit ({0})", inherit); + + int next = EditorGUILayout.Popup(label, overriden ? index + 1 : 0, valuesChild); + if (next == 0) + { + Settings.RemoveSetting(settings, platform); + Settings.RemoveSetting(((Settings)target).SpeakerModeSettings, platform); + } + else + { + Settings.SetSetting(settings, platform, buildDirectories[next - 1]); + } + } + + void DisplayPlatform(FMODPlatform platform, FMODPlatform[] children = null) + { + Settings settings = target as Settings; + + var label = new System.Text.StringBuilder(); + label.AppendFormat("{0}", (PlatformLabel(platform))); + if (children != null) + { + label.Append(" ("); + foreach (var child in children) + { + label.Append(PlatformLabel(child)); + label.Append(", "); + } + label.Remove(label.Length - 2, 2); + label.Append(")"); + } + + GUIStyle style = new GUIStyle(GUI.skin.FindStyle("Foldout")); + style.richText = true; + + foldoutState[(int)platform] = EditorGUILayout.Foldout(foldoutState[(int)platform], new GUIContent(label.ToString()), style); + if (foldoutState[(int)platform]) + { + EditorGUI.indentLevel++; + DisplayChildBool("Live Update", settings.LiveUpdateSettings, platform); + if (settings.IsLiveUpdateEnabled(platform)) + { + GUIStyle style2 = new GUIStyle(GUI.skin.label); + style2.richText = true; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(" "); + GUILayout.Label("Live update will listen on port 9264", style2); + EditorGUILayout.EndHorizontal(); + } + DisplayChildBool("Debug Overlay", settings.OverlaySettings, platform); + DisplayChildFreq("Sample Rate", settings.SampleRateSettings, platform); + if (settings.HasPlatforms && AllowBankChange(platform)) + { + bool prevChanged = GUI.changed; + DisplayChildBuildDirectories("Bank Platform", settings.BankDirectorySettings, platform); + hasBankSourceChanged |= !prevChanged && GUI.changed; + + if (Settings.HasSetting(settings.BankDirectorySettings, platform)) + { + DisplayChildSpeakerMode("Speaker Mode", settings.SpeakerModeSettings, platform); + EditorGUILayout.HelpBox(string.Format("Match the speaker mode to the setting of the platform {0} inside FMOD Studio", settings.GetBankPlatform(platform)), MessageType.Info, false); + } + else + { + EditorGUI.BeginDisabledGroup(true); + DisplayChildSpeakerMode("Speaker Mode", settings.SpeakerModeSettings, platform); + EditorGUI.EndDisabledGroup(); + } + } + + DisplayChildInt("Virtual Channel Count", settings.VirtualChannelSettings, platform, 1, 2048); + DisplayChildInt("Real Channel Count", settings.RealChannelSettings, platform, 1, 256); + + if (children != null) + { + foreach (var child in children) + { + DisplayPlatform(child); + } + } + + EditorGUI.indentLevel--; + } + } + + private bool AllowBankChange(FMODPlatform platform) + { + // Can't do these settings on pseudo-platforms + if (platform == FMODPlatform.MobileLow || platform == FMODPlatform.MobileHigh) + { + return false; + } + + return true; + } + + private bool DrawLinks() + { + string color = EditorGUIUtility.isProSkin ? "#fa4d14" : "#0000FF"; + // Docs link + UnityEditor.EditorGUILayout.BeginHorizontal(); + { + var linkStyle = GUI.skin.button; + linkStyle.richText = true; + string caption = "Open FMOD Getting Started Guide"; + caption = String.Format("{1}", color, caption); + bool bClicked = GUILayout.Button(caption, linkStyle, GUILayout.ExpandWidth(false), GUILayout.Height(30), GUILayout.MaxWidth(300)); + + var rect = GUILayoutUtility.GetLastRect(); + rect.width = linkStyle.CalcSize(new GUIContent(caption)).x; + EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link); + + if (bClicked) + { + Application.OpenURL("https://fmod.com/resources/documentation-unity?version=2.0&page=user-guide.html"); + } + } + GUILayout.FlexibleSpace(); + // Support Link + { + var linkStyle = GUI.skin.button; + linkStyle.richText = true; + string caption = "Open FMOD Q&A"; + caption = String.Format("{1}", color, caption); + bool bClicked = GUILayout.Button(caption, linkStyle, GUILayout.ExpandWidth(false), GUILayout.Height(30), GUILayout.MaxWidth(200)); + + var rect = GUILayoutUtility.GetLastRect(); + rect.width = linkStyle.CalcSize(new GUIContent(caption)).x; + EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link); + + if (bClicked) + { + Application.OpenURL("https://qa.fmod.com/"); + } + } + UnityEditor.EditorGUILayout.EndHorizontal(); + + return true; + } + + public override void OnInspectorGUI() + { + Settings settings = target as Settings; + + DrawLinks(); + + EditorGUI.BeginChangeCheck(); + + hasBankSourceChanged = false; + bool hasBankTargetChanged = false; + + GUIStyle style = new GUIStyle(GUI.skin.label); + style.richText = true; + + GUI.skin.FindStyle("HelpBox").richText = true; + + SourceType sourceType = settings.HasSourceProject ? SourceType.Project : (settings.HasPlatforms ? SourceType.Multi : SourceType.Single); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.BeginVertical(); + sourceType = GUILayout.Toggle(sourceType == SourceType.Project, "Project", "Button") ? 0 : sourceType; + sourceType = GUILayout.Toggle(sourceType == SourceType.Single, "Single Platform Build", "Button") ? SourceType.Single : sourceType; + sourceType = GUILayout.Toggle(sourceType == SourceType.Multi, "Multiple Platform Build", "Button") ? SourceType.Multi : sourceType; + EditorGUILayout.EndVertical(); + EditorGUILayout.BeginVertical(); + + EditorGUILayout.HelpBox( + "Select the way you wish to connect Unity to the FMOD Studio content:\n" + + "• Project\t\tIf you have the complete FMOD Studio project avaliable\n" + + "• Single Platform\tIf you have only the contents of the Build folder for a single platform\n" + + "• Multiple Platforms\tIf you have only the contents of the Build folder for multiple platforms, each platform in it's own sub directory\n" + + "" + , MessageType.Info, true); + EditorGUILayout.EndVertical(); + EditorGUILayout.EndHorizontal(); + EditorGUILayout.Space(); + + if (sourceType == SourceType.Project) + { + EditorGUILayout.BeginHorizontal(); + string oldPath = settings.SourceProjectPath; + EditorGUILayout.PrefixLabel("Studio Project Path", GUI.skin.textField, style); + + EditorGUI.BeginChangeCheck(); + string newPath = EditorGUILayout.TextField(GUIContent.none, settings.SourceProjectPath); + if (EditorGUI.EndChangeCheck()) + { + if (newPath.EndsWith(".fspro")) + { + settings.SourceProjectPath = newPath; + } + } + + if (GUILayout.Button("Browse", GUILayout.ExpandWidth(false))) + { + GUI.FocusControl(null); + EditorApplication.update += BrowseForSourceProjectPath; + } + EditorGUILayout.EndHorizontal(); + + // Cache in settings for runtime access in play-in-editor mode + string bankPath = EditorUtils.GetBankDirectory(); + settings.SourceBankPath = bankPath; + settings.HasPlatforms = true; + settings.HasSourceProject = true; + + // First time project path is set or changes, copy to streaming assets + if (settings.SourceProjectPath != oldPath) + { + hasBankSourceChanged = true; + } + } + else if (sourceType == SourceType.Single || sourceType == SourceType.Multi) + { + EditorGUILayout.BeginHorizontal(); + string oldPath = settings.SourceBankPath; + EditorGUILayout.PrefixLabel("Build Path", GUI.skin.textField, style); + + EditorGUI.BeginChangeCheck(); + string tempPath = EditorGUILayout.TextField(GUIContent.none, settings.SourceBankPath); + if (EditorGUI.EndChangeCheck()) + { + settings.SourceBankPath = tempPath; + } + + if (GUILayout.Button("Browse", GUILayout.ExpandWidth(false))) + { + GUI.FocusControl(null); + EditorApplication.update += BrowseForSourceBankPath; + } + EditorGUILayout.EndHorizontal(); + + settings.HasPlatforms = (sourceType == SourceType.Multi); + settings.HasSourceProject = false; + + // First time project path is set or changes, copy to streaming assets + if (settings.SourceBankPath != oldPath) + { + hasBankSourceChanged = true; + } + } + + bool validBanks; + string failReason; + EditorUtils.ValidateSource(out validBanks, out failReason); + if (!validBanks) + { + failReason += "\n\nFor detailed setup instructions, please see the getting started guide linked above."; + EditorGUILayout.HelpBox(failReason, MessageType.Error, true); + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(settings); + } + return; + } + + if (!RuntimeUtils.VerifyPlatformLibsExist()) + { + string errMsg = "Unable to find the FMOD '" + RuntimeUtils.GetEditorFMODPlatform() + "' libs. See console for details."; + EditorGUILayout.HelpBox(errMsg, MessageType.Error, true); + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(settings); + } + return; + } + + ImportType importType = (ImportType)EditorGUILayout.EnumPopup("Import Type", settings.ImportType); + if (importType != settings.ImportType) + { + hasBankTargetChanged = true; + settings.ImportType = importType; + + bool deleteBanks = EditorUtility.DisplayDialog( + "FMOD Bank Import Type Changed", "Do you want to delete the " + (importType == ImportType.AssetBundle ? "StreamingAssets" : "AssetBundle") + " banks in " + (importType == ImportType.AssetBundle ? Application.streamingAssetsPath : Application.dataPath + '/' + settings.TargetAssetPath) + , "Yes", "No"); + if (deleteBanks) + { + // Delete the old banks + EventManager.removeBanks = true; + EventManager.RefreshBanks(); + } + } + + // ----- Text Assets ------------- + if (settings.ImportType == ImportType.AssetBundle) + { + GUI.SetNextControlName("targetAssetPath"); + targetAssetPath = EditorGUILayout.TextField("FMOD Asset Folder", string.IsNullOrEmpty(targetAssetPath) ? settings.TargetAssetPath : targetAssetPath); + if (GUI.GetNameOfFocusedControl() == "targetAssetPath") + { + focused = true; + if (Event.current.isKey) + { + switch (Event.current.keyCode) + { + case KeyCode.Return: + case KeyCode.KeypadEnter: + if (settings.TargetAssetPath != targetAssetPath) + { + EventManager.RemoveBanks(Application.dataPath + '/' + settings.TargetAssetPath); + settings.TargetAssetPath = targetAssetPath; + hasBankTargetChanged = true; + } + break; + } + } + } + else if (focused) + { + if (settings.TargetAssetPath != targetAssetPath) + { + EventManager.RemoveBanks(Application.dataPath + '/' + settings.TargetAssetPath); + settings.TargetAssetPath = targetAssetPath; + hasBankTargetChanged = true; + } + } + } + + // ----- Logging ----------------- + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Logging", style); + EditorGUI.indentLevel++; + settings.LoggingLevel = (FMOD.DEBUG_FLAGS)EditorGUILayout.EnumPopup("Logging Level", settings.LoggingLevel); + EditorGUI.indentLevel--; + + // ----- Loading ----------------- + EditorGUI.BeginDisabledGroup(settings.ImportType == ImportType.AssetBundle); + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Initialization", style); + EditorGUI.indentLevel++; + + settings.BankLoadType = (BankLoadType)EditorGUILayout.EnumPopup("Load Banks", settings.BankLoadType); + switch (settings.BankLoadType) + { + case BankLoadType.All: + break; + case BankLoadType.Specified: + settings.AutomaticEventLoading = false; + Texture upArrowTexture = EditorGUIUtility.Load("FMOD/ArrowUp.png") as Texture; + Texture downArrowTexture = EditorGUIUtility.Load("FMOD/ArrowDown.png") as Texture; + bankFoldOutState = EditorGUILayout.Foldout(bankFoldOutState, "Specified Banks", true); + if (bankFoldOutState) + { + for (int i = 0; i < settings.BanksToLoad.Count; i++) + { + EditorGUILayout.BeginHorizontal(); + EditorGUI.indentLevel++; + + var bankName = settings.BanksToLoad[i]; + EditorGUILayout.TextField(bankName.Replace(".bank", "")); + + if (GUILayout.Button(upArrowTexture, GUILayout.ExpandWidth(false))) + { + if (i > 0) + { + var temp = settings.BanksToLoad[i]; + settings.BanksToLoad[i] = settings.BanksToLoad[i - 1]; + settings.BanksToLoad[i - 1] = temp; + } + continue; + } + if (GUILayout.Button(downArrowTexture, GUILayout.ExpandWidth(false))) + { + if (i < settings.BanksToLoad.Count - 1) + { + var temp = settings.BanksToLoad[i]; + settings.BanksToLoad[i] = settings.BanksToLoad[i + 1]; + settings.BanksToLoad[i + 1] = temp; + } + continue; + } + + if (GUILayout.Button("Browse", GUILayout.ExpandWidth(false))) + { + GUI.FocusControl(null); + string path = EditorUtility.OpenFilePanel("Locate Bank", Application.streamingAssetsPath, "bank"); + if (!string.IsNullOrEmpty(path)) + { + settings.BanksToLoad[i] = path.Replace(Application.streamingAssetsPath + Path.AltDirectorySeparatorChar, ""); + Repaint(); + } + } + if (GUILayout.Button("Remove", GUILayout.ExpandWidth(false))) + { + Settings.Instance.BanksToLoad.RemoveAt(i); + continue; + } + EditorGUILayout.EndHorizontal(); + EditorGUI.indentLevel--; + } + + GUILayout.BeginHorizontal(); + GUILayout.Space(30); + if (GUILayout.Button("Add Bank", GUILayout.ExpandWidth(false))) + { + settings.BanksToLoad.Add(""); + } + if (GUILayout.Button("Add All Banks", GUILayout.ExpandWidth(false))) + { + FMODPlatform platform = RuntimeUtils.GetEditorFMODPlatform(); + if (platform == FMODPlatform.None) + { + platform = FMODPlatform.PlayInEditor; + } + string sourceDir = RuntimeUtils.GetCommonPlatformPath(settings.SourceBankPath + '/' + (settings.HasPlatforms ? settings.GetBankPlatform(platform) + '/' : "")); + sourceDir = RuntimeUtils.GetCommonPlatformPath(Path.GetFullPath(sourceDir)); + var banksFound = new List(Directory.GetFiles(sourceDir, "*.bank", SearchOption.AllDirectories)); + for (int i = 0; i < banksFound.Count; i++) + { + string bankLongName = RuntimeUtils.GetCommonPlatformPath(Path.GetFullPath(banksFound[i])); + string bankShortName = bankLongName.Replace(sourceDir, ""); + if (!settings.BanksToLoad.Contains(bankShortName)) + { + settings.BanksToLoad.Add(bankShortName); + } + } + Repaint(); + } + if (GUILayout.Button("Clear", GUILayout.ExpandWidth(false))) + { + settings.BanksToLoad.Clear(); + } + GUILayout.EndHorizontal(); + } + break; + case BankLoadType.None: + settings.AutomaticEventLoading = false; + break; + default: + break; + } + + EditorGUI.BeginDisabledGroup(settings.BankLoadType == BankLoadType.None); + settings.AutomaticSampleLoading = EditorGUILayout.Toggle("Load Bank Sample Data", settings.AutomaticSampleLoading); + EditorGUI.EndDisabledGroup(); + + settings.EncryptionKey = EditorGUILayout.TextField("Bank Encryption Key", settings.EncryptionKey); + + EditorGUI.indentLevel--; + EditorGUI.EndDisabledGroup(); + + // ----- PIE ---------------------------------------------- + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Play In Editor Settings", style); + EditorGUI.indentLevel++; + DisplayEditorBool("Live Update", settings.LiveUpdateSettings, FMODPlatform.PlayInEditor); + if (settings.IsLiveUpdateEnabled(FMODPlatform.PlayInEditor)) + { + EditorGUILayout.BeginHorizontal(); + settings.LiveUpdatePort = ushort.Parse(EditorGUILayout.TextField("Live Update Port:", settings.LiveUpdatePort.ToString())); + if (GUILayout.Button("Reset", GUILayout.ExpandWidth(false))) + { + settings.LiveUpdatePort = 9264; + } + EditorGUILayout.EndHorizontal(); + + } + DisplayEditorBool("Debug Overlay", settings.OverlaySettings, FMODPlatform.PlayInEditor); + DisplayChildFreq("Sample Rate", settings.SampleRateSettings, FMODPlatform.PlayInEditor); + if (settings.HasPlatforms) + { + DisplayPIEBuildDirectory("Bank Platform", settings.BankDirectorySettings, FMODPlatform.PlayInEditor); + } + + DisplayPIESpeakerMode("Speaker Mode", settings.SpeakerModeSettings, FMODPlatform.PlayInEditor); + if (settings.HasPlatforms) + { + EditorGUILayout.HelpBox(string.Format("Match the speaker mode to the setting of the platform {0} inside FMOD Studio", settings.GetBankPlatform(FMODPlatform.PlayInEditor)), MessageType.Info, false); + } + else + { + EditorGUILayout.HelpBox("Match the speaker mode to the setting inside FMOD Studio", MessageType.Info, false); + } + + EditorGUI.indentLevel--; + + // ----- Default ---------------------------------------------- + EditorGUILayout.Separator(); + EditorGUILayout.LabelField("Default Settings", style); + EditorGUI.indentLevel++; + DisplayParentBool("Live Update", settings.LiveUpdateSettings, FMODPlatform.Default); + if (settings.IsLiveUpdateEnabled(FMODPlatform.Default)) + { + EditorGUILayout.BeginHorizontal(); + settings.LiveUpdatePort = ushort.Parse(EditorGUILayout.TextField("Live Update Port:", settings.LiveUpdatePort.ToString())); + if (GUILayout.Button("Reset", GUILayout.ExpandWidth(false))) + { + settings.LiveUpdatePort = 9264; + } + EditorGUILayout.EndHorizontal(); + } + DisplayParentBool("Debug Overlay", settings.OverlaySettings, FMODPlatform.Default); + DisplayParentFreq("Sample Rate", settings.SampleRateSettings, FMODPlatform.Default); + if (settings.HasPlatforms) + { + bool prevChanged = GUI.changed; + DisplayParentBuildDirectory("Bank Platform", settings.BankDirectorySettings, FMODPlatform.Default); + hasBankSourceChanged |= !prevChanged && GUI.changed; + } + + DisplayParentSpeakerMode("Speaker Mode", settings.SpeakerModeSettings, FMODPlatform.Default); + if (settings.HasPlatforms) + { + EditorGUILayout.HelpBox(string.Format("Match the speaker mode to the setting of the platform {0} inside FMOD Studio", settings.GetBankPlatform(FMODPlatform.Default)), MessageType.Info, false); + } + else + { + EditorGUILayout.HelpBox("Match the speaker mode to the setting inside FMOD Studio", MessageType.Info, false); + } + DisplayParentInt("Virtual Channel Count", settings.VirtualChannelSettings, FMODPlatform.Default, 1, 2048); + DisplayParentInt("Real Channel Count", settings.RealChannelSettings, FMODPlatform.Default, 1, 256); + EditorGUI.indentLevel--; + + // ----- Plugins ---------------------------------------------- + EditorGUILayout.Separator(); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Plugins", GUI.skin.button, style); + if (GUILayout.Button("Add Plugin", GUILayout.ExpandWidth(false))) + { + settings.Plugins.Add(""); + } + EditorGUILayout.EndHorizontal(); + + EditorGUI.indentLevel++; + for (int count = 0; count < settings.Plugins.Count; count++) + { + EditorGUILayout.BeginHorizontal(); + settings.Plugins[count] = EditorGUILayout.TextField("Plugin " + (count + 1).ToString() + ":", settings.Plugins[count]); + + if (GUILayout.Button("Delete Plugin", GUILayout.ExpandWidth(false))) + { + settings.Plugins.RemoveAt(count); + } + EditorGUILayout.EndHorizontal(); + } + EditorGUI.indentLevel--; + + // ----- Windows ---------------------------------------------- + DisplayPlatform(FMODPlatform.Desktop, null); + DisplayPlatform(FMODPlatform.Mobile, new FMODPlatform[] { FMODPlatform.MobileHigh, FMODPlatform.MobileLow, FMODPlatform.AppleTV }); + DisplayPlatform(FMODPlatform.Console, new FMODPlatform[] { FMODPlatform.XboxOne, FMODPlatform.PS4, FMODPlatform.Switch, FMODPlatform.Stadia }); + + if (EditorGUI.EndChangeCheck()) + { + EditorUtility.SetDirty(settings); + } + + if (hasBankSourceChanged) + { + EventManager.RefreshBanks(); + } + if (hasBankTargetChanged) + { + EventManager.RefreshBanks(); + } + } + + void BrowseForSourceProjectPath() + { + Settings settings = target as Settings; + + string newPath = EditorUtility.OpenFilePanel("Locate Studio Project", settings.SourceProjectPath, "fspro"); + + if (!string.IsNullOrEmpty(newPath)) + { + newPath = MakePathRelative(newPath); + + if (newPath != settings.SourceProjectPath) + { + settings.SourceProjectPath = newPath; + EventManager.RefreshBanks(); + Repaint(); + } + } + + EditorApplication.update -= BrowseForSourceProjectPath; + } + + void BrowseForSourceBankPath() + { + Settings settings = target as Settings; + + string newPath = EditorUtility.OpenFolderPanel("Locate Build Folder", settings.SourceBankPath, null); + + if (!string.IsNullOrEmpty(newPath)) + { + newPath = MakePathRelative(newPath); + + if (newPath != settings.SourceBankPath) + { + settings.SourceBankPath = newPath; + EventManager.RefreshBanks(); + Repaint(); + } + } + + EditorApplication.update -= BrowseForSourceBankPath; + } + + private string MakePathRelative(string path) + { + if (string.IsNullOrEmpty(path)) + return ""; + string fullPath = Path.GetFullPath(path); + string fullProjectPath = Path.GetFullPath(Environment.CurrentDirectory + Path.DirectorySeparatorChar); + + // If the path contains the Unity project path remove it and return the result + if (fullPath.Contains(fullProjectPath)) + { + fullPath = fullPath.Replace(fullProjectPath, ""); + } + // If not, attempt to find a relative path on the same drive + else if (Path.GetPathRoot(fullPath) == Path.GetPathRoot(fullProjectPath)) + { + // Remove trailing slash from project path for split count simplicity + if (fullProjectPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.CurrentCulture)) fullProjectPath = fullProjectPath.Substring(0, fullProjectPath.Length - 1); + + string[] fullPathSplit = fullPath.Split(Path.DirectorySeparatorChar); + string[] projectPathSplit = fullProjectPath.Split(Path.DirectorySeparatorChar); + int minNumSplits = Mathf.Min(fullPathSplit.Length, projectPathSplit.Length); + int numCommonElements = 0; + for (int i = 0; i < minNumSplits; i++) + { + if (fullPathSplit[i] == projectPathSplit[i]) + { + numCommonElements++; + } + else + { + break; + } + } + string result = ""; + int fullPathSplitLength = fullPathSplit.Length; + for (int i = numCommonElements; i < fullPathSplitLength; i++) + { + result += fullPathSplit[i]; + if (i < fullPathSplitLength - 1) + { + result += '/'; + } + } + + int numAdditionalElementsInProjectPath = projectPathSplit.Length - numCommonElements; + for (int i = 0; i < numAdditionalElementsInProjectPath; i++) + { + result = "../" + result; + } + + fullPath = result; + } + + return fullPath.Replace(Path.DirectorySeparatorChar, '/'); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs.meta new file mode 100644 index 0000000..2031dd0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/SettingsEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 353a9c870c318f74fa5fdcd475129bae +timeCreated: 1432530253 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs new file mode 100644 index 0000000..60f94f5 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs @@ -0,0 +1,101 @@ +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioBankLoader))] + [CanEditMultipleObjects] + public class StudioBankLoaderEditor : Editor + { + public override void OnInspectorGUI() + { + var load = serializedObject.FindProperty("LoadEvent"); + var unload = serializedObject.FindProperty("UnloadEvent"); + var tag = serializedObject.FindProperty("CollisionTag"); + var banks = serializedObject.FindProperty("Banks"); + var preload = serializedObject.FindProperty("PreloadSamples"); + + EditorGUILayout.PropertyField(load, new GUIContent("Load")); + EditorGUILayout.PropertyField(unload, new GUIContent("Unload")); + + if ((load.enumValueIndex >= 3 && load.enumValueIndex <= 6) || + (unload.enumValueIndex >= 3 && unload.enumValueIndex <= 6)) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + EditorGUILayout.PropertyField(preload, new GUIContent("Preload Sample Data")); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Banks"); + EditorGUILayout.BeginVertical(); + if (GUILayout.Button("Add Bank", GUILayout.ExpandWidth(false))) + { + banks.InsertArrayElementAtIndex(banks.arraySize); + SerializedProperty newBank = banks.GetArrayElementAtIndex(banks.arraySize - 1); + newBank.stringValue = ""; + + var browser = EventBrowser.CreateInstance(); + + browser.titleContent = new GUIContent("Select FMOD Bank"); + + browser.SelectBank(newBank); + browser.ShowUtility(); + } + + Texture deleteTexture = EditorGUIUtility.Load("FMOD/Delete.png") as Texture; + GUIContent deleteContent = new GUIContent(deleteTexture, "Delete Bank"); + + var buttonStyle = new GUIStyle(GUI.skin.button); + buttonStyle.padding.top = buttonStyle.padding.bottom = 1; + buttonStyle.margin.top = 2; + buttonStyle.padding.left = buttonStyle.padding.right = 4; + buttonStyle.fixedHeight = GUI.skin.textField.CalcSize(new GUIContent()).y; + + for (int i = 0; i < banks.arraySize; i++) + { + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PropertyField(banks.GetArrayElementAtIndex(i), GUIContent.none); + + if (GUILayout.Button(deleteContent, buttonStyle, GUILayout.ExpandWidth(false))) + { + banks.DeleteArrayElementAtIndex(i); + } + EditorGUILayout.EndHorizontal(); + } + EditorGUILayout.EndVertical(); + + EditorGUILayout.EndHorizontal(); + + Event e = Event.current; + if (e.type == EventType.DragPerform) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + int pos = banks.arraySize; + banks.InsertArrayElementAtIndex(pos); + var pathProperty = banks.GetArrayElementAtIndex(pos); + + pathProperty.stringValue = ((EditorBankRef)DragAndDrop.objectReferences[0]).Name; + + e.Use(); + } + } + if (e.type == EventType.DragUpdated) + { + if (DragAndDrop.objectReferences.Length > 0 && + DragAndDrop.objectReferences[0] != null && + DragAndDrop.objectReferences[0].GetType() == typeof(EditorBankRef)) + { + DragAndDrop.visualMode = DragAndDropVisualMode.Move; + DragAndDrop.AcceptDrag(); + e.Use(); + } + } + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs.meta new file mode 100644 index 0000000..8065b49 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioBankLoaderEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f7f61e03a350e1e428dba6c562f3d64a +timeCreated: 1434691856 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs new file mode 100644 index 0000000..ca8b884 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs @@ -0,0 +1,483 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioEventEmitter))] + [CanEditMultipleObjects] + public class StudioEventEmitterEditor : Editor + { + ParameterValueView parameterValueView; + + public void OnEnable() + { + parameterValueView = new ParameterValueView(serializedObject); + } + + public void OnSceneGUI() + { + var emitter = target as StudioEventEmitter; + + EditorEventRef editorEvent = EventManager.EventFromPath(emitter.Event); + if (editorEvent != null && editorEvent.Is3D) + { + EditorGUI.BeginChangeCheck(); + float minDistance = emitter.OverrideAttenuation ? emitter.OverrideMinDistance : editorEvent.MinDistance; + float maxDistance = emitter.OverrideAttenuation ? emitter.OverrideMaxDistance : editorEvent.MaxDistance; + minDistance = Handles.RadiusHandle(Quaternion.identity, emitter.transform.position, minDistance); + maxDistance = Handles.RadiusHandle(Quaternion.identity, emitter.transform.position, maxDistance); + if (EditorGUI.EndChangeCheck() && emitter.OverrideAttenuation) + { + Undo.RecordObject(emitter, "Change Emitter Bounds"); + emitter.OverrideMinDistance = Mathf.Clamp(minDistance, 0, emitter.OverrideMaxDistance); + emitter.OverrideMaxDistance = Mathf.Max(emitter.OverrideMinDistance, maxDistance); + } + } + } + + public override void OnInspectorGUI() + { + var begin = serializedObject.FindProperty("PlayEvent"); + var end = serializedObject.FindProperty("StopEvent"); + var tag = serializedObject.FindProperty("CollisionTag"); + var ev = serializedObject.FindProperty("Event"); + var fadeout = serializedObject.FindProperty("AllowFadeout"); + var once = serializedObject.FindProperty("TriggerOnce"); + var preload = serializedObject.FindProperty("Preload"); + var overrideAtt = serializedObject.FindProperty("OverrideAttenuation"); + var minDistance = serializedObject.FindProperty("OverrideMinDistance"); + var maxDistance = serializedObject.FindProperty("OverrideMaxDistance"); + + EditorGUILayout.PropertyField(begin, new GUIContent("Play Event")); + EditorGUILayout.PropertyField(end, new GUIContent("Stop Event")); + + if ((begin.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && begin.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D) || + (end.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && end.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D)) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + EditorGUI.BeginChangeCheck(); + + EditorGUILayout.PropertyField(ev, new GUIContent("Event")); + + EditorEventRef editorEvent = EventManager.EventFromPath(ev.stringValue); + + if (EditorGUI.EndChangeCheck()) + { + EditorUtils.UpdateParamsOnEmitter(serializedObject, ev.stringValue); + if (editorEvent != null) + { + overrideAtt.boolValue = false; + minDistance.floatValue = editorEvent.MinDistance; + maxDistance.floatValue = editorEvent.MaxDistance; + } + } + + // Attenuation + if (editorEvent != null) + { + { + EditorGUI.BeginDisabledGroup(editorEvent == null || !editorEvent.Is3D); + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Override Attenuation"); + EditorGUI.BeginChangeCheck(); + overrideAtt.boolValue = EditorGUILayout.Toggle(overrideAtt.boolValue, GUILayout.Width(20)); + if (EditorGUI.EndChangeCheck() || + (minDistance.floatValue == -1 && maxDistance.floatValue == -1) // never been initialiased + ) + { + minDistance.floatValue = editorEvent.MinDistance; + maxDistance.floatValue = editorEvent.MaxDistance; + } + EditorGUI.BeginDisabledGroup(!overrideAtt.boolValue); + EditorGUIUtility.labelWidth = 30; + minDistance.floatValue = EditorGUILayout.FloatField("Min", minDistance.floatValue); + minDistance.floatValue = Mathf.Clamp(minDistance.floatValue, 0, maxDistance.floatValue); + maxDistance.floatValue = EditorGUILayout.FloatField("Max", maxDistance.floatValue); + maxDistance.floatValue = Mathf.Max(minDistance.floatValue, maxDistance.floatValue); + EditorGUIUtility.labelWidth = 0; + EditorGUI.EndDisabledGroup(); + EditorGUILayout.EndHorizontal(); + EditorGUI.EndDisabledGroup(); + } + + parameterValueView.OnGUI(editorEvent, !ev.hasMultipleDifferentValues); + + fadeout.isExpanded = EditorGUILayout.Foldout(fadeout.isExpanded, "Advanced Controls"); + if (fadeout.isExpanded) + { + EditorGUILayout.PropertyField(preload, new GUIContent("Preload Sample Data")); + EditorGUILayout.PropertyField(fadeout, new GUIContent("Allow Fadeout When Stopping")); + EditorGUILayout.PropertyField(once, new GUIContent("Trigger Once")); + } + } + + serializedObject.ApplyModifiedProperties(); + } + + private class ParameterValueView + { + // The "Params" property from the SerializedObject we're editing in the inspector, + // so we can expand/collapse it or revert to prefab. + private SerializedProperty paramsProperty; + + // This holds one SerializedObject for each object in the current selection. + private List serializedTargets = new List(); + + // A mapping from EditorParamRef to the initial parameter value properties in the + // current selection that have the same name. + // We need this because some objects may be missing some properties, and properties with + // the same name may be at different array indices in different objects. + private class PropertyRecord + { + public string name { get { return paramRef.Name; } } + public EditorParamRef paramRef; + public List valueProperties; + } + + // Mappings from EditorParamRef to initial parameter value property for all properties + // found in the current selection. + private List propertyRecords = new List(); + + // Any parameters that are in the current event but are missing from some objects in + // the current selection, so we can put them in the "Add" menu. + private List missingParameters = new List(); + + public ParameterValueView(SerializedObject serializedObject) + { + paramsProperty = serializedObject.FindProperty("Params"); + + foreach (UnityEngine.Object target in serializedObject.targetObjects) + { + serializedTargets.Add(new SerializedObject(target)); + } + } + + // Rebuilds the propertyRecords and missingParameters collections. + private void RefreshPropertyRecords(EditorEventRef eventRef) + { + propertyRecords.Clear(); + + foreach (SerializedObject serializedTarget in serializedTargets) + { + SerializedProperty paramsProperty = serializedTarget.FindProperty("Params"); + + foreach (SerializedProperty parameterProperty in paramsProperty) + { + string name = parameterProperty.FindPropertyRelative("Name").stringValue; + SerializedProperty valueProperty = parameterProperty.FindPropertyRelative("Value"); + + PropertyRecord record = propertyRecords.Find(r => r.name == name); + + if (record != null) + { + record.valueProperties.Add(valueProperty); + } + else + { + EditorParamRef paramRef = eventRef.Parameters.Find(p => p.Name == name); + + if (paramRef != null) + { + propertyRecords.Add( + new PropertyRecord() { + paramRef = paramRef, + valueProperties = new List() { valueProperty }, + }); + } + } + } + } + + // Only sort if there is a multi-selection. If there is only one object selected, + // the user can revert to prefab, and the behaviour depends on the array order, + // so it's helpful to show the true order. + if (serializedTargets.Count > 1) + { + propertyRecords.Sort((a, b) => EditorUtility.NaturalCompare(a.name, b.name)); + } + + missingParameters.Clear(); + missingParameters.AddRange(eventRef.Parameters.Where( + p => { + PropertyRecord record = propertyRecords.Find(r => r.name == p.Name); + return record == null || record.valueProperties.Count < serializedTargets.Count; + })); + } + + public void OnGUI(EditorEventRef eventRef, bool matchingEvents) + { + foreach (SerializedObject serializedTarget in serializedTargets) + { + serializedTarget.Update(); + } + + if (Event.current.type == EventType.Layout) + { + RefreshPropertyRecords(eventRef); + } + + DrawHeader(matchingEvents); + + if (paramsProperty.isExpanded) + { + if (matchingEvents) + { + DrawValues(); + } + else + { + GUILayout.Box("Cannot change parameters when different events are selected", GUILayout.ExpandWidth(true)); + } + } + + foreach (SerializedObject serializedTarget in serializedTargets) + { + serializedTarget.ApplyModifiedProperties(); + } + } + + private void DrawHeader(bool enableAddButton) + { + Rect controlRect = EditorGUILayout.GetControlRect(); + + Rect titleRect = controlRect; + titleRect.width = EditorGUIUtility.labelWidth; + + // Let the user revert the whole Params array to prefab by context-clicking the title. + EditorGUI.BeginProperty(titleRect, GUIContent.none, paramsProperty); + + paramsProperty.isExpanded = EditorGUI.Foldout(titleRect, paramsProperty.isExpanded, + "Initial Parameter Values"); + + EditorGUI.EndProperty(); + + Rect buttonRect = controlRect; + buttonRect.xMin = titleRect.xMax; + + EditorGUI.BeginDisabledGroup(!enableAddButton); + + DrawAddButton(buttonRect); + + EditorGUI.EndDisabledGroup(); + } + + private void DrawAddButton(Rect position) + { + EditorGUI.BeginDisabledGroup(missingParameters.Count == 0); + + if (EditorGUI.DropdownButton(position, new GUIContent("Add"), FocusType.Passive)) + { + GenericMenu menu = new GenericMenu(); + menu.AddItem(new GUIContent("All"), false, () => + { + foreach (EditorParamRef parameter in missingParameters) + { + AddParameter(parameter); + } + }); + + menu.AddSeparator(string.Empty); + + foreach (EditorParamRef parameter in missingParameters) + { + menu.AddItem(new GUIContent(parameter.Name), false, + (userData) => + { + AddParameter(userData as EditorParamRef); + }, + parameter); + } + + menu.DropDown(position); + } + + EditorGUI.EndDisabledGroup(); + } + + private void DrawValues() + { + // We use this to defer deletion so we don't mess with arrays while using + // SerializedProperties that refer to array elements, as this can throw exceptions. + string parameterToDelete = null; + + foreach (PropertyRecord record in propertyRecords) + { + if (record.valueProperties.Count == serializedTargets.Count) + { + bool delete; + DrawValue(record, out delete); + + if (delete) + { + parameterToDelete = record.name; + } + } + } + + if (parameterToDelete != null) + { + DeleteParameter(parameterToDelete); + } + } + + private void DrawValue(PropertyRecord record, out bool delete) + { + delete = false; + + GUIContent removeLabel = new GUIContent("Remove"); + + Rect position = EditorGUILayout.GetControlRect(); + + Rect nameLabelRect = position; + nameLabelRect.width = EditorGUIUtility.labelWidth; + + Rect removeButtonRect = position; + removeButtonRect.width = EditorStyles.miniButton.CalcSize(removeLabel).x; + removeButtonRect.x = position.xMax - removeButtonRect.width; + + Rect sliderRect = position; + sliderRect.xMin = nameLabelRect.xMax; + sliderRect.xMax = removeButtonRect.xMin - EditorStyles.miniButton.margin.left; + + GUIContent nameLabel = new GUIContent(record.name); + + float value = 0; + bool mixedValues = false; + + // We use EditorGUI.BeginProperty when there is a single object selected, so + // the user can revert the value to prefab by context-clicking the name. + // We handle multi-selections ourselves, so that we can deal with + // mismatched arrays nicely. + if (record.valueProperties.Count == 1) + { + value = record.valueProperties[0].floatValue; + EditorGUI.BeginProperty(position, nameLabel, record.valueProperties[0]); + } + else + { + bool first = true; + + foreach (SerializedProperty property in record.valueProperties) + { + if (first) + { + value = property.floatValue; + first = false; + } + else if (property.floatValue != value) + { + mixedValues = true; + break; + } + } + } + + EditorGUI.LabelField(nameLabelRect, nameLabel); + + EditorGUI.BeginChangeCheck(); + + EditorGUI.showMixedValue = mixedValues; + + float newValue = EditorGUI.Slider(sliderRect, value, record.paramRef.Min, record.paramRef.Max); + + EditorGUI.showMixedValue = false; + + if (EditorGUI.EndChangeCheck()) + { + foreach (SerializedProperty property in record.valueProperties) + { + property.floatValue = newValue; + } + } + + delete = GUI.Button(removeButtonRect, removeLabel, EditorStyles.miniButton); + + if (record.valueProperties.Count == 1) + { + EditorGUI.EndProperty(); + } + else + { + // Context menu to set all values from one object in the multi-selection. + if (mixedValues && Event.current.type == EventType.ContextClick + && nameLabelRect.Contains(Event.current.mousePosition)) + { + GenericMenu menu = new GenericMenu(); + + foreach (SerializedProperty sourceProperty in record.valueProperties) + { + UnityEngine.Object targetObject = sourceProperty.serializedObject.targetObject; + + menu.AddItem(new GUIContent(string.Format("Set to Value of '{0}'", targetObject.name)), false, + (userData) => CopyValueToAll(userData as SerializedProperty, record.valueProperties), + sourceProperty); + } + + menu.DropDown(position); + + } + } + } + + // Copy the value from the source property to all target properties. + private void CopyValueToAll(SerializedProperty sourceProperty, List targetProperties) + { + foreach (SerializedProperty targetProperty in targetProperties) + { + if (targetProperty != sourceProperty) + { + targetProperty.floatValue = sourceProperty.floatValue; + targetProperty.serializedObject.ApplyModifiedProperties(); + } + } + } + + // Add an initial value for the given parameter to all selected objects that don't have one. + private void AddParameter(EditorParamRef parameter) + { + foreach (SerializedObject serializedTarget in serializedTargets) + { + StudioEventEmitter emitter = serializedTarget.targetObject as StudioEventEmitter; + + if (Array.FindIndex(emitter.Params, p => p.Name == parameter.Name) < 0) + { + SerializedProperty paramsProperty = serializedTarget.FindProperty("Params"); + + int index = paramsProperty.arraySize; + paramsProperty.InsertArrayElementAtIndex(index); + + SerializedProperty arrayElement = paramsProperty.GetArrayElementAtIndex(index); + + arrayElement.FindPropertyRelative("Name").stringValue = parameter.Name; + arrayElement.FindPropertyRelative("Value").floatValue = parameter.Default; + + serializedTarget.ApplyModifiedProperties(); + } + } + } + + // Delete initial parameter values for the given name from all selected objects. + private void DeleteParameter(string name) + { + foreach (SerializedObject serializedTarget in serializedTargets) + { + SerializedProperty paramsProperty = serializedTarget.FindProperty("Params"); + + foreach (SerializedProperty child in paramsProperty) + { + if (child.FindPropertyRelative("Name").stringValue == name) + { + child.DeleteCommand(); + break; + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs.meta new file mode 100644 index 0000000..3f2cfcd --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2b044fd4ebf2c42468e1f41d5e2b879c +timeCreated: 1434696182 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs new file mode 100644 index 0000000..d43beb4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs @@ -0,0 +1,14 @@ +using UnityEngine; +using UnityEditor; + +namespace FMODUnity +{ + public class StudioEventEmitterGizoDrawer + { + [DrawGizmo(GizmoType.Selected | GizmoType.Active | GizmoType.NotInSelectionHierarchy | GizmoType.Pickable)] + static void DrawGizmo(StudioEventEmitter studioEmitter, GizmoType gizmoType) + { + Gizmos.DrawIcon(studioEmitter.transform.position, "FMOD/FMODEmitter.tiff", true); + } + } +} diff --git a/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs.meta new file mode 100644 index 0000000..6f5c18f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioEventEmitterGizmoDrawer.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f09ba26caab55e048a2e596ff75b3eab +timeCreated: 1433142677 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs new file mode 100644 index 0000000..6c818c8 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioGlobalParameterTrigger))] + public class StudioGlobalParameterTriggerEditor : Editor + { + SerializedProperty param; + SerializedProperty trigger; + SerializedProperty tag; + SerializedProperty value; + + SerializedProperty data1, data2; + + [SerializeField] + EditorParamRef editorParamRef; + + void OnEnable() + { + param = serializedObject.FindProperty("parameter"); + trigger = serializedObject.FindProperty("TriggerEvent"); + tag = serializedObject.FindProperty("CollisionTag"); + value = serializedObject.FindProperty("value"); + } + + public override void OnInspectorGUI() + { + EditorGUILayout.PropertyField(trigger, new GUIContent("Trigger")); + if (trigger.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && trigger.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + EditorGUI.BeginChangeCheck(); + + var oldParam = param.stringValue; + EditorGUILayout.PropertyField(param, new GUIContent("Parameter")); + + if (!String.IsNullOrEmpty(param.stringValue)) + { + if (!editorParamRef || param.stringValue != oldParam) + { + editorParamRef = EventManager.ParamFromPath(param.stringValue); + } + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel("Override Value"); + value.floatValue = EditorGUILayout.Slider(value.floatValue, editorParamRef.Min, editorParamRef.Max); + EditorGUILayout.EndHorizontal(); + } + + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs.meta new file mode 100644 index 0000000..4b9857d --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioGlobalParameterTriggerEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a901681b5558f247b4c227fb425c010 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs new file mode 100644 index 0000000..27c9a73 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs @@ -0,0 +1,18 @@ +using UnityEditor; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioListener))] + [CanEditMultipleObjects] + public class StudioListenerEditor : Editor + { + public override void OnInspectorGUI() + { + EditorGUI.BeginDisabledGroup(true); + var index = serializedObject.FindProperty("ListenerNumber"); + EditorGUILayout.IntSlider(index, 0, FMOD.CONSTANTS.MAX_LISTENERS - 1, "Listener Index"); + EditorGUI.EndDisabledGroup(); + + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs.meta new file mode 100644 index 0000000..b618254 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioListenerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 847f8505c25f5cf42adba68a26f2cda6 +timeCreated: 1445576758 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs new file mode 100644 index 0000000..495cddb --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs @@ -0,0 +1,154 @@ +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; + +namespace FMODUnity +{ + [CustomEditor(typeof(StudioParameterTrigger))] + public class StudioParameterTriggerEditor : Editor + { + StudioEventEmitter targetEmitter; + SerializedProperty emitters; + SerializedProperty trigger; + SerializedProperty tag; + + bool[] expanded; + + void OnEnable() + { + emitters = serializedObject.FindProperty("Emitters"); + trigger = serializedObject.FindProperty("TriggerEvent"); + tag = serializedObject.FindProperty("CollisionTag"); + targetEmitter = null; + for (int i = 0; i < emitters.arraySize; i++) + { + targetEmitter = emitters.GetArrayElementAtIndex(i).FindPropertyRelative("Target").objectReferenceValue as StudioEventEmitter; + if (targetEmitter != null) + { + expanded = new bool[targetEmitter.GetComponents().Length]; + break; + } + } + } + + public override void OnInspectorGUI() + { + var newTargetEmitter = EditorGUILayout.ObjectField("Target", targetEmitter, typeof(StudioEventEmitter), true) as StudioEventEmitter; + if (newTargetEmitter != targetEmitter) + { + emitters.ClearArray(); + targetEmitter = newTargetEmitter; + + if (targetEmitter == null) + { + serializedObject.ApplyModifiedProperties(); + return; + } + + List newEmitters = new List(); + targetEmitter.GetComponents(newEmitters); + expanded = new bool[newEmitters.Count]; + foreach (var emitter in newEmitters) + { + emitters.InsertArrayElementAtIndex(0); + emitters.GetArrayElementAtIndex(0).FindPropertyRelative("Target").objectReferenceValue = emitter; + } + } + + if (targetEmitter == null) + { + return; + } + + EditorGUILayout.PropertyField(trigger, new GUIContent("Trigger")); + + if (trigger.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && trigger.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D) + { + tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue); + } + + var localEmitters = new List(); + targetEmitter.GetComponents(localEmitters); + + int emitterIndex = 0; + foreach (var emitter in localEmitters) + { + SerializedProperty emitterProperty = null; + for(int i = 0; i < emitters.arraySize; i++) + { + if (emitters.GetArrayElementAtIndex(i).FindPropertyRelative("Target").objectReferenceValue == emitter) + { + emitterProperty = emitters.GetArrayElementAtIndex(i); + break; + } + } + + // New emitter component added to game object since we last looked + if (emitterProperty == null) + { + emitters.InsertArrayElementAtIndex(0); + emitterProperty = emitters.GetArrayElementAtIndex(0); + emitterProperty.FindPropertyRelative("Target").objectReferenceValue = emitter; + } + + if (!string.IsNullOrEmpty(emitter.Event)) + { + expanded[emitterIndex] = EditorGUILayout.Foldout(expanded[emitterIndex], emitter.Event); + if (expanded[emitterIndex]) + { + var eventRef = EventManager.EventFromPath(emitter.Event); + if (emitter.Event.StartsWith("{")) + { + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.TextField("Path:", eventRef.Path); + EditorGUI.EndDisabledGroup(); + } + foreach (var paramRef in eventRef.Parameters) + { + bool set = false; + int index = -1; + for (int i = 0; i < emitterProperty.FindPropertyRelative("Params").arraySize; i++) + { + if (emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(i).FindPropertyRelative("Name").stringValue == paramRef.Name) + { + index = i; + set = true; + break; + } + } + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(paramRef.Name); + bool newSet = GUILayout.Toggle(set, ""); + if (!set && newSet) + { + index = 0; + emitterProperty.FindPropertyRelative("Params").InsertArrayElementAtIndex(0); + emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(0).FindPropertyRelative("Name").stringValue = paramRef.Name; + emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(0).FindPropertyRelative("Value").floatValue = 0; + } + if (set && !newSet) + { + emitterProperty.FindPropertyRelative("Params").DeleteArrayElementAtIndex(index); + } + set = newSet; + EditorGUI.BeginDisabledGroup(!set); + if (set) + { + var valueProperty = emitterProperty.FindPropertyRelative("Params").GetArrayElementAtIndex(index).FindPropertyRelative("Value"); + valueProperty.floatValue = EditorGUILayout.Slider(valueProperty.floatValue, paramRef.Min, paramRef.Max); + } + else + { + EditorGUILayout.Slider(0, paramRef.Min, paramRef.Max); + } + EditorGUI.EndDisabledGroup(); + EditorGUILayout.EndHorizontal(); + } + } + } + emitterIndex++; + } + serializedObject.ApplyModifiedProperties(); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs.meta new file mode 100644 index 0000000..7c8f4dd --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/StudioParameterTriggerEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: dc94d213814ef1a42b0ca8ee00dd4728 +timeCreated: 1451968823 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/Timeline.meta b/Assets/Plugins/FMOD/src/Editor/Timeline.meta new file mode 100644 index 0000000..7609260 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/Timeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e03eecb9c762874b9bdb393ee5d8db4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Editor/Timeline/FMODEventPlayableEditor.cs b/Assets/Plugins/FMOD/src/Editor/Timeline/FMODEventPlayableEditor.cs new file mode 100644 index 0000000..55b90d0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/Timeline/FMODEventPlayableEditor.cs @@ -0,0 +1,147 @@ +#if (UNITY_TIMELINE_EXIST || !UNITY_2019_1_OR_NEWER) + +using UnityEditor; +using UnityEngine; +using FMODUnity; +using System; +using System.Linq; + +[CustomEditor(typeof(FMODEventPlayable))] +public class FMODEventPlayableEditor : Editor +{ + private FMODEventPlayable eventPlayable; + private EditorEventRef editorEventRef; + + public void OnEnable() + { + eventPlayable = target as FMODEventPlayable; + if (eventPlayable && !string.IsNullOrEmpty(eventPlayable.eventName)) + { + editorEventRef = EventManager.EventFromPath(eventPlayable.eventName); + eventPlayable.UpdateEventDuration(editorEventRef.IsOneShot ? editorEventRef.Length : float.PositiveInfinity); + } + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + var ev = serializedObject.FindProperty("eventName"); + var stopType = serializedObject.FindProperty("stopType"); + + EditorGUILayout.PropertyField(ev, new GUIContent("Event")); + + var eventRef = EventManager.EventFromPath(ev.stringValue); + + if (eventRef != null && eventRef.Parameters.Count > 0) + { + foreach (var paramRef in eventRef.Parameters) + { + bool set; + float value; + CheckParameter(paramRef.Name, out set, out value); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.PrefixLabel(paramRef.Name); + EditorGUI.BeginChangeCheck(); + bool newSet = EditorGUILayout.Toggle(set, GUILayout.Width(20)); + + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObjects(new UnityEngine.Object[] { serializedObject.targetObject }, "Inspector"); + if (newSet) + { + AddParameterValue(serializedObject.targetObject, paramRef.Name, paramRef.Default); + } + else + { + DeleteParameterValue(serializedObject.targetObject, paramRef.Name); + } + set = newSet; + } + + if (set) + { + EditorGUI.BeginChangeCheck(); + value = EditorGUILayout.Slider(value, paramRef.Min, paramRef.Max); + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObjects(new UnityEngine.Object[] { serializedObject.targetObject }, "Inspector"); + SetParameterValue(serializedObject.targetObject, paramRef.Name, value); + } + } + else + { + EditorGUILayout.Slider(paramRef.Default, paramRef.Min, paramRef.Max); + } + EditorGUILayout.EndHorizontal(); + } + } + + EditorGUILayout.PropertyField(stopType, new GUIContent("Stop Mode")); + + if (eventPlayable) + { + eventPlayable.OnValidate(); + } + serializedObject.ApplyModifiedProperties(); + } + + void CheckParameter(string name, out bool set, out float value) + { + value = 0; + set = false; + + var playable = serializedObject.targetObject as FMODEventPlayable; + var param = playable.parameters != null ? playable.parameters.FirstOrDefault((x) => x.Name == name) : null; + if (param != null) + { + set = true; + value = param.Value; + } + } + + void SetParameterValue(UnityEngine.Object obj, string name, float value) + { + var playable = obj as FMODEventPlayable; + var param = playable.parameters != null ? playable.parameters.FirstOrDefault((x) => x.Name == name) : null; + if (param != null) + { + param.Value = value; + } + } + + void AddParameterValue(UnityEngine.Object obj, string name, float value) + { + var playable = obj as FMODEventPlayable; + var param = playable.parameters != null ? playable.parameters.FirstOrDefault((x) => x.Name == name) : null; + if (param == null) + { + int end = playable.parameters.Length; + Array.Resize(ref playable.parameters, end + 1); + playable.parameters[end] = new ParamRef(); + playable.parameters[end].Name = name; + playable.parameters[end].Value = value; + } + } + + void DeleteParameterValue(UnityEngine.Object obj, string name) + { + var emitter = obj as FMODEventPlayable; + int found = -1; + for (int i = 0; i < emitter.parameters.Length; i++) + { + if (emitter.parameters[i].Name == name) + { + found = i; + } + } + if (found >= 0) + { + int end = emitter.parameters.Length - 1; + emitter.parameters[found] = emitter.parameters[end]; + Array.Resize(ref emitter.parameters, end); + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Editor/Timeline/FMODEventPlayableEditor.cs.meta b/Assets/Plugins/FMOD/src/Editor/Timeline/FMODEventPlayableEditor.cs.meta new file mode 100644 index 0000000..3fb25ff --- /dev/null +++ b/Assets/Plugins/FMOD/src/Editor/Timeline/FMODEventPlayableEditor.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: fa325be8441506c4bb1462c8333ccce9 +timeCreated: 1523230773 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime.meta b/Assets/Plugins/FMOD/src/Runtime.meta new file mode 100644 index 0000000..0e323a9 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3013d4d5463cc6544b9eacc6f81db5ad +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/BankRefAttribute.cs b/Assets/Plugins/FMOD/src/Runtime/BankRefAttribute.cs new file mode 100644 index 0000000..de44917 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/BankRefAttribute.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace FMODUnity +{ + public class BankRefAttribute : PropertyAttribute + { + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/BankRefAttribute.cs.meta b/Assets/Plugins/FMOD/src/Runtime/BankRefAttribute.cs.meta new file mode 100644 index 0000000..ac53cf2 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/BankRefAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: a8ab5f38e7776644297d8b3687c39b49 +timeCreated: 1445488716 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/EventHandler.cs b/Assets/Plugins/FMOD/src/Runtime/EventHandler.cs new file mode 100644 index 0000000..5527b35 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/EventHandler.cs @@ -0,0 +1,93 @@ +using UnityEngine; + +namespace FMODUnity +{ + public abstract class EventHandler : MonoBehaviour + { + public string CollisionTag = ""; + + void OnEnable() + { + HandleGameEvent(EmitterGameEvent.ObjectEnable); + } + + void OnDisable() + { + HandleGameEvent(EmitterGameEvent.ObjectDisable); + } + + void OnTriggerEnter(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(EmitterGameEvent.TriggerEnter); + } + } + + void OnTriggerExit(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(EmitterGameEvent.TriggerExit); + } + } + + void OnTriggerEnter2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(EmitterGameEvent.TriggerEnter2D); + } + } + + void OnTriggerExit2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(EmitterGameEvent.TriggerExit2D); + } + } + + void OnCollisionEnter() + { + HandleGameEvent(EmitterGameEvent.CollisionEnter); + } + + void OnCollisionExit() + { + HandleGameEvent(EmitterGameEvent.CollisionExit); + } + + void OnCollisionEnter2D() + { + HandleGameEvent(EmitterGameEvent.CollisionEnter2D); + } + + void OnCollisionExit2D() + { + HandleGameEvent(EmitterGameEvent.CollisionExit2D); + } + + void OnMouseEnter() + { + HandleGameEvent(EmitterGameEvent.MouseEnter); + } + + void OnMouseExit() + { + HandleGameEvent(EmitterGameEvent.MouseExit); + } + + void OnMouseDown() + { + HandleGameEvent(EmitterGameEvent.MouseDown); + } + + void OnMouseUp() + { + HandleGameEvent(EmitterGameEvent.MouseUp); + } + + protected abstract void HandleGameEvent(EmitterGameEvent gameEvent); + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/EventHandler.cs.meta b/Assets/Plugins/FMOD/src/Runtime/EventHandler.cs.meta new file mode 100644 index 0000000..0989fa6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/EventHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a28d1e1a42561ed4f8d44293dab99079 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/EventRefAttribute.cs b/Assets/Plugins/FMOD/src/Runtime/EventRefAttribute.cs new file mode 100644 index 0000000..237c09d --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/EventRefAttribute.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace FMODUnity +{ + public class EventRefAttribute : PropertyAttribute + { + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/EventRefAttribute.cs.meta b/Assets/Plugins/FMOD/src/Runtime/EventRefAttribute.cs.meta new file mode 100644 index 0000000..7b29bdd --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/EventRefAttribute.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1b29a1189268c3b47aa2ec4b96a9e7ef +timeCreated: 1445311748 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/FMODRuntimeManagerOnGUIHelper.cs b/Assets/Plugins/FMOD/src/Runtime/FMODRuntimeManagerOnGUIHelper.cs new file mode 100644 index 0000000..fa58f18 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/FMODRuntimeManagerOnGUIHelper.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace FMODUnity +{ + public class FMODRuntimeManagerOnGUIHelper : MonoBehaviour + { + public RuntimeManager TargetRuntimeManager = null; + + private void OnGUI() + { + if (TargetRuntimeManager) + { + TargetRuntimeManager.ExecuteOnGUI(); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/FMODRuntimeManagerOnGUIHelper.cs.meta b/Assets/Plugins/FMOD/src/Runtime/FMODRuntimeManagerOnGUIHelper.cs.meta new file mode 100644 index 0000000..db88800 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/FMODRuntimeManagerOnGUIHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4417faacebce0de4fbde25ec23055cf4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/ParamRef.cs b/Assets/Plugins/FMOD/src/Runtime/ParamRef.cs new file mode 100644 index 0000000..0d0927f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/ParamRef.cs @@ -0,0 +1,12 @@ +using System; + +namespace FMODUnity +{ + [Serializable] + public class ParamRef + { + public string Name; + public float Value; + public FMOD.Studio.PARAMETER_ID ID; + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/ParamRef.cs.meta b/Assets/Plugins/FMOD/src/Runtime/ParamRef.cs.meta new file mode 100644 index 0000000..38a23c6 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/ParamRef.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 00e1a9817a5d9844796d7c313b1ab197 +timeCreated: 1444192631 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/ParamRefAttribute.cs b/Assets/Plugins/FMOD/src/Runtime/ParamRefAttribute.cs new file mode 100644 index 0000000..0ffb2a0 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/ParamRefAttribute.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace FMODUnity +{ + public class ParamRefAttribute : PropertyAttribute + { + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/ParamRefAttribute.cs.meta b/Assets/Plugins/FMOD/src/Runtime/ParamRefAttribute.cs.meta new file mode 100644 index 0000000..2d6b93a --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/ParamRefAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ae6224668d1647429723f89e10d593f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs b/Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs new file mode 100644 index 0000000..181c536 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs @@ -0,0 +1,1190 @@ +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using UnityEngine; +using System.Runtime.InteropServices; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ + [AddComponentMenu("")] + public class RuntimeManager : MonoBehaviour + { + static SystemNotInitializedException initException = null; + static RuntimeManager instance; + + [SerializeField] + FMODPlatform fmodPlatform; + + [AOT.MonoPInvokeCallback(typeof(FMOD.DEBUG_CALLBACK))] + static FMOD.RESULT DEBUG_CALLBACK(FMOD.DEBUG_FLAGS flags, FMOD.StringWrapper file, int line, FMOD.StringWrapper func, FMOD.StringWrapper message) + { + if (flags == FMOD.DEBUG_FLAGS.ERROR) + { + Debug.LogError(string.Format(("[FMOD] {0} : {1}"), (string)func, (string)message)); + } + else if (flags == FMOD.DEBUG_FLAGS.WARNING) + { + Debug.LogWarning(string.Format(("[FMOD] {0} : {1}"), (string)func, (string)message)); + } + else if (flags == FMOD.DEBUG_FLAGS.LOG) + { + Debug.Log(string.Format(("[FMOD] {0} : {1}"), (string)func, (string)message)); + } + return FMOD.RESULT.OK; + } + + static RuntimeManager Instance + { + get + { + if (initException != null) + { + throw initException; + } + + if (instance == null) + { + FMOD.RESULT initResult = FMOD.RESULT.OK; // Initialize can return an error code if it falls back to NO_SOUND, throw it as a non-cached exception + + // When reloading scripts the static instance pointer will be cleared, find the old manager and clean it up + foreach (RuntimeManager manager in Resources.FindObjectsOfTypeAll()) + { + DestroyImmediate(manager.gameObject); + } + + var gameObject = new GameObject("FMOD.UnityIntegration.RuntimeManager"); + instance = gameObject.AddComponent(); + + if (Application.isPlaying) // This class is used in edit mode by the Timeline auditioning system + { + DontDestroyOnLoad(gameObject); + } + gameObject.hideFlags = HideFlags.HideAndDontSave; + + try + { + #if UNITY_ANDROID && !UNITY_EDITOR + // First, obtain the current activity context + AndroidJavaObject activity = null; + using (var activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) + { + activity = activityClass.GetStatic("currentActivity"); + } + + using (var fmodJava = new AndroidJavaClass("org.fmod.FMOD")) + { + if (fmodJava != null) + { + fmodJava.CallStatic("init", activity); + } + else + { + UnityEngine.Debug.LogWarning("[FMOD] Cannot initialize Java wrapper"); + } + } + #endif + + RuntimeUtils.VerifyPlatformLibsExist(); + RuntimeUtils.EnforceLibraryOrder(); + initResult = instance.Initialize(); + } + catch (Exception e) + { + initException = e as SystemNotInitializedException; + if (initException == null) + { + initException = new SystemNotInitializedException(e); + } + throw initException; + } + + if (initResult != FMOD.RESULT.OK) + { + throw new SystemNotInitializedException(initResult, "Output forced to NO SOUND mode"); + } + } + return instance; + } + } + + public static FMOD.Studio.System StudioSystem + { + get { return Instance.studioSystem; } + } + + public static FMOD.System CoreSystem + { + get { return Instance.coreSystem; } + } + + FMOD.Studio.System studioSystem; + FMOD.System coreSystem; + FMOD.DSP mixerHead; + + long cachedStudioSystemHandle; // Persists across script reload for cleanup purposes + + struct LoadedBank + { + public FMOD.Studio.Bank Bank; + public int RefCount; + } + + Dictionary loadedBanks = new Dictionary(); + Dictionary loadedPlugins = new Dictionary(); + + // Explicit comparer to avoid issues on platforms that don't support JIT compilation + class GuidComparer : IEqualityComparer + { + bool IEqualityComparer.Equals(Guid x, Guid y) + { + return x.Equals(y); + } + + int IEqualityComparer.GetHashCode(Guid obj) + { + return obj.GetHashCode(); + } + } + Dictionary cachedDescriptions = new Dictionary(new GuidComparer()); + + void CheckInitResult(FMOD.RESULT result, string cause) + { + if (result != FMOD.RESULT.OK) + { + if (studioSystem.isValid()) + { + studioSystem.release(); + studioSystem.clearHandle(); + } + throw new SystemNotInitializedException(result, cause); + } + } + + FMOD.RESULT Initialize() + { + #if UNITY_EDITOR + EditorApplication.playModeStateChanged += HandlePlayModeStateChange; + #endif // UNITY_EDITOR + + FMOD.RESULT result = FMOD.RESULT.OK; + FMOD.RESULT initResult = FMOD.RESULT.OK; + Settings fmodSettings = Settings.Instance; + fmodPlatform = RuntimeUtils.GetCurrentPlatform(); + + int sampleRate = fmodSettings.GetSampleRate(fmodPlatform); + int realChannels = Math.Min(fmodSettings.GetRealChannels(fmodPlatform), 256); + int virtualChannels = fmodSettings.GetVirtualChannels(fmodPlatform); + FMOD.SPEAKERMODE speakerMode = (FMOD.SPEAKERMODE)fmodSettings.GetSpeakerMode(fmodPlatform); + FMOD.OUTPUTTYPE outputType = FMOD.OUTPUTTYPE.AUTODETECT; + + FMOD.ADVANCEDSETTINGS advancedSettings = new FMOD.ADVANCEDSETTINGS(); + advancedSettings.randomSeed = (uint)DateTime.UtcNow.Ticks; + #if UNITY_EDITOR || UNITY_STANDALONE + advancedSettings.maxVorbisCodecs = realChannels; + #elif UNITY_XBOXONE + advancedSettings.maxXMACodecs = realChannels; + #elif UNITY_PS4 + advancedSettings.maxAT9Codecs = realChannels; + #else + advancedSettings.maxFADPCMCodecs = realChannels; + #endif + + SetThreadAffinity(); + + #if UNITY_EDITOR || DEVELOPMENT_BUILD + result = FMOD.Debug.Initialize(fmodSettings.LoggingLevel, FMOD.DEBUG_MODE.CALLBACK, DEBUG_CALLBACK, null); + if(result == FMOD.RESULT.ERR_UNSUPPORTED) + { + Debug.LogWarning("[FMOD] Unable to initialize debug logging: Logging will be disabled.\nCheck the Import Settings of the FMOD libs to enable the logging library."); + } + else + { + CheckInitResult(result, "FMOD.Debug.Initialize"); + } + #endif + + FMOD.Studio.INITFLAGS studioInitFlags = FMOD.Studio.INITFLAGS.NORMAL | FMOD.Studio.INITFLAGS.DEFERRED_CALLBACKS; + if (fmodSettings.IsLiveUpdateEnabled(fmodPlatform)) + { + studioInitFlags |= FMOD.Studio.INITFLAGS.LIVEUPDATE; + advancedSettings.profilePort = fmodSettings.LiveUpdatePort; + } + +retry: + result = FMOD.Studio.System.create(out studioSystem); + CheckInitResult(result, "FMOD.Studio.System.create"); + cachedStudioSystemHandle = (long)studioSystem.handle; + + result = studioSystem.getCoreSystem(out coreSystem); + CheckInitResult(result, "FMOD.Studio.System.getCoreSystem"); + + result = coreSystem.setOutput(outputType); + CheckInitResult(result, "FMOD.System.setOutput"); + + result = coreSystem.setSoftwareChannels(realChannels); + CheckInitResult(result, "FMOD.System.setSoftwareChannels"); + + result = coreSystem.setSoftwareFormat(sampleRate, speakerMode, 0); + CheckInitResult(result, "FMOD.System.setSoftwareFormat"); + + result = coreSystem.setAdvancedSettings(ref advancedSettings); + CheckInitResult(result, "FMOD.System.setAdvancedSettings"); + + if (!string.IsNullOrEmpty(Settings.Instance.EncryptionKey)) + { + FMOD.Studio.ADVANCEDSETTINGS studioAdvancedSettings = new FMOD.Studio.ADVANCEDSETTINGS(); + result = studioSystem.setAdvancedSettings(studioAdvancedSettings, Settings.Instance.EncryptionKey); + CheckInitResult(result, "FMOD.Studio.System.setAdvancedSettings"); + } + + result = studioSystem.initialize(virtualChannels, studioInitFlags, FMOD.INITFLAGS.NORMAL, IntPtr.Zero); + if (result != FMOD.RESULT.OK && initResult == FMOD.RESULT.OK) + { + initResult = result; // Save this to throw at the end (we'll attempt NO SOUND to shield ourselves from unexpected device failures) + outputType = FMOD.OUTPUTTYPE.NOSOUND; + UnityEngine.Debug.LogErrorFormat("[FMOD] Studio::System::initialize returned {0}, defaulting to no-sound mode.", result.ToString()); + + goto retry; + } + CheckInitResult(result, "Studio::System::initialize"); + + // Test network functionality triggered during System::update + if ((studioInitFlags & FMOD.Studio.INITFLAGS.LIVEUPDATE) != 0) + { + studioSystem.flushCommands(); // Any error will be returned through Studio.System.update + + result = studioSystem.update(); + if (result == FMOD.RESULT.ERR_NET_SOCKET_ERROR) + { + studioInitFlags &= ~FMOD.Studio.INITFLAGS.LIVEUPDATE; + UnityEngine.Debug.LogWarning("[FMOD] Cannot open network port for Live Update (in-use), restarting with Live Update disabled."); + + result = studioSystem.release(); + CheckInitResult(result, "FMOD.Studio.System.Release"); + + goto retry; + } + } + + LoadPlugins(fmodSettings); + LoadBanks(fmodSettings); + + #if (UNITY_IOS || UNITY_TVOS) && !UNITY_EDITOR + RegisterSuspendCallback(HandleInterrupt); + #endif + + return initResult; + } + + class AttachedInstance + { + public FMOD.Studio.EventInstance instance; + public Transform transform; + public Rigidbody rigidBody; + public Rigidbody2D rigidBody2D; + } + + List attachedInstances = new List(128); + + #if UNITY_EDITOR + List eventPositionWarnings = new List(); + #endif + + public static int AddListener(StudioListener listener) + { + // Is the listener already in the list? + for (int i = 0; i < Listeners.Count; i++) + { + if (Listeners[i] != null && listener.gameObject == Listeners[i].gameObject) + { + Debug.LogWarning(string.Format(("[FMOD] Listener has already been added at index {0}."), i)); + return i; + } + } + // If already at the max numListeners + if (numListeners >= FMOD.CONSTANTS.MAX_LISTENERS) + { + Debug.LogWarning(string.Format(("[FMOD] Max number of listeners reached : {0}."), FMOD.CONSTANTS.MAX_LISTENERS)); + //return -1; + } + + // If not already in the list + // The next available spot in the list should be at `numListeners` + if (Listeners.Count <= numListeners) + { + Listeners.Add(listener); + } + else + { + Listeners[numListeners] = listener; + } + // Increment `numListeners` + numListeners++; + // setNumListeners (8 is the most that FMOD supports) + int numListenersClamped = Mathf.Min(numListeners, FMOD.CONSTANTS.MAX_LISTENERS); + StudioSystem.setNumListeners(numListenersClamped); + return numListeners - 1; + } + + public static bool RemoveListener(StudioListener listener) + { + int index = listener.ListenerNumber; + // Remove listener + if (index != -1) + { + Listeners[index] = null; + + // Are there more listeners above the index of the one we are removing? + if (numListeners - 1 > index) + { + // Move any higher index listeners down + for (int i = index; i < Listeners.Count; i++) + { + if (i == Listeners.Count - 1) + { + Listeners[i] = null; + } + else + { + Listeners[i] = Listeners[i + 1]; + if (Listeners[i]) + { + Listeners[i].ListenerNumber = i; + } + } + } + } + // Decriment numListeners + numListeners--; + // Always need at least 1 listener, otherwise "[FMOD] assert : assertion: 'numListeners >= 1 && numListeners <= 8' failed" + int numListenersClamped = Mathf.Min(Mathf.Max(numListeners, 1), FMOD.CONSTANTS.MAX_LISTENERS); + StudioSystem.setNumListeners(numListenersClamped); + // Listener attributes will be updated before the next update, due to the Script Execution Order. + return true; + } + else + { + return false; + } + } + + bool listenerWarningIssued = false; + void Update() + { + if (studioSystem.isValid()) + { + if (numListeners <= 0 && !listenerWarningIssued) + { + listenerWarningIssued = true; + UnityEngine.Debug.LogWarning("[FMOD] Please add an 'FMOD Studio Listener' component to your a camera in the scene for correct 3D positioning of sounds."); + } + + for (int i = 0; i < attachedInstances.Count; i++) + { + FMOD.Studio.PLAYBACK_STATE playbackState = FMOD.Studio.PLAYBACK_STATE.STOPPED; + attachedInstances[i].instance.getPlaybackState(out playbackState); + if (!attachedInstances[i].instance.isValid() || + playbackState == FMOD.Studio.PLAYBACK_STATE.STOPPED || + attachedInstances[i].transform == null // destroyed game object + ) + { + attachedInstances.RemoveAt(i); + i--; + continue; + } + + if (attachedInstances[i].rigidBody) + { + attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, attachedInstances[i].rigidBody)); + } + else + { + attachedInstances[i].instance.set3DAttributes(RuntimeUtils.To3DAttributes(attachedInstances[i].transform, attachedInstances[i].rigidBody2D)); + } + } + + #if UNITY_EDITOR + MuteAllEvents(UnityEditor.EditorUtility.audioMasterMute); + + for (int i = eventPositionWarnings.Count - 1; i >= 0; i--) + { + if (eventPositionWarnings[i].isValid()) + { + FMOD.ATTRIBUTES_3D attribs; + eventPositionWarnings[i].get3DAttributes(out attribs); + if (attribs.position.x == 1e+18F && + attribs.position.y == 1e+18F && + attribs.position.z == 1e+18F) + { + string path; + FMOD.Studio.EventDescription desc; + eventPositionWarnings[i].getDescription(out desc); + desc.getPath(out path); + Debug.LogWarningFormat("[FMOD] Instance of Event {0} has not had EventInstance.set3DAttributes() called on it yet!", path); + } + } + eventPositionWarnings.RemoveAt(i); + } + + isOverlayEnabled = Settings.Instance.IsOverlayEnabled(fmodPlatform); + #endif + + if (isOverlayEnabled) + { + if (!overlayDrawer) + { + overlayDrawer = Instance.gameObject.AddComponent(); + overlayDrawer.TargetRuntimeManager = this; + } + else + { + overlayDrawer.gameObject.SetActive(true); + } + } + else + { + if (overlayDrawer != null && overlayDrawer.gameObject.activeSelf) + { + overlayDrawer.gameObject.SetActive(false); + } + } + + studioSystem.update(); + } + } + + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, Transform transform, Rigidbody rigidBody) + { + AttachedInstance attachedInstance = Instance.attachedInstances.Find(x => x.instance.handle == instance.handle); + if (attachedInstance == null) + { + attachedInstance = new AttachedInstance(); + Instance.attachedInstances.Add(attachedInstance); + } + + instance.set3DAttributes(RuntimeUtils.To3DAttributes(transform, rigidBody)); + attachedInstance.transform = transform; + attachedInstance.instance = instance; + attachedInstance.rigidBody = rigidBody; + } + + public static void AttachInstanceToGameObject(FMOD.Studio.EventInstance instance, Transform transform, Rigidbody2D rigidBody2D) + { + AttachedInstance attachedInstance = Instance.attachedInstances.Find(x => x.instance.handle == instance.handle); + if (attachedInstance == null) + { + attachedInstance = new AttachedInstance(); + Instance.attachedInstances.Add(attachedInstance); + } + + instance.set3DAttributes(RuntimeUtils.To3DAttributes(transform, rigidBody2D)); + attachedInstance.transform = transform; + attachedInstance.instance = instance; + attachedInstance.rigidBody2D = rigidBody2D; + attachedInstance.rigidBody = null; + } + + public static void DetachInstanceFromGameObject(FMOD.Studio.EventInstance instance) + { + var manager = Instance; + for (int i = 0; i < manager.attachedInstances.Count; i++) + { + if (manager.attachedInstances[i].instance.handle == instance.handle) + { + manager.attachedInstances.RemoveAt(i); + return; + } + } + } + + protected bool isOverlayEnabled = false; + FMODRuntimeManagerOnGUIHelper overlayDrawer = null; + Rect windowRect = new Rect(10, 10, 300, 100); + + public void ExecuteOnGUI() + { + if (studioSystem.isValid() && isOverlayEnabled) + { + windowRect = GUI.Window(GetInstanceID(), windowRect, DrawDebugOverlay, "FMOD Studio Debug"); + } + } + + #if !UNITY_EDITOR + private void Start() + { + isOverlayEnabled = Settings.Instance.IsOverlayEnabled(fmodPlatform); + } + #endif + + string lastDebugText; + float lastDebugUpdate = 0; + void DrawDebugOverlay(int windowID) + { + if (lastDebugUpdate + 0.25f < Time.unscaledTime) + { + if (initException != null) + { + lastDebugText = initException.Message; + } + else + { + if (!mixerHead.hasHandle()) + { + FMOD.ChannelGroup master; + coreSystem.getMasterChannelGroup(out master); + master.getDSP(0, out mixerHead); + mixerHead.setMeteringEnabled(false, true); + } + + StringBuilder debug = new StringBuilder(); + + FMOD.Studio.CPU_USAGE cpuUsage; + studioSystem.getCPUUsage(out cpuUsage); + debug.AppendFormat("CPU: dsp = {0:F1}%, studio = {1:F1}%\n", cpuUsage.dspusage, cpuUsage.studiousage); + + int currentAlloc, maxAlloc; + FMOD.Memory.GetStats(out currentAlloc, out maxAlloc); + debug.AppendFormat("MEMORY: cur = {0}MB, max = {1}MB\n", currentAlloc >> 20, maxAlloc >> 20); + + int realchannels, channels; + coreSystem.getChannelsPlaying(out channels, out realchannels); + debug.AppendFormat("CHANNELS: real = {0}, total = {1}\n", realchannels, channels); + + FMOD.DSP_METERING_INFO outputMetering; + mixerHead.getMeteringInfo(IntPtr.Zero, out outputMetering); + float rms = 0; + for (int i = 0; i < outputMetering.numchannels; i++) + { + rms += outputMetering.rmslevel[i] * outputMetering.rmslevel[i]; + } + rms = Mathf.Sqrt(rms / (float)outputMetering.numchannels); + + float db = rms > 0 ? 20.0f * Mathf.Log10(rms * Mathf.Sqrt(2.0f)) : -80.0f; + if (db > 10.0f) db = 10.0f; + + debug.AppendFormat("VOLUME: RMS = {0:f2}db\n", db); + lastDebugText = debug.ToString(); + lastDebugUpdate = Time.unscaledTime; + } + } + + GUI.Label(new Rect(10, 20, 290, 100), lastDebugText); + GUI.DragWindow(); + } + + void OnDestroy() + { + if (!studioSystem.isValid()) + { + studioSystem.handle = (IntPtr)cachedStudioSystemHandle; + } + + if (studioSystem.isValid()) + { + studioSystem.release(); + } + + initException = null; + instance = null; + } + + #if UNITY_EDITOR + public static void Destroy() + { + if (instance) + { + DestroyImmediate(instance.gameObject); + } + } + + void HandlePlayModeStateChange(PlayModeStateChange state) + { + if (state == PlayModeStateChange.ExitingEditMode || state == PlayModeStateChange.EnteredEditMode) + { + Destroy(); + } + } + #endif + + #if (UNITY_IOS || UNITY_TVOS) && !UNITY_EDITOR + [AOT.MonoPInvokeCallback(typeof(Action))] + static void HandleInterrupt(bool began) + { + if (Instance.studioSystem.isValid()) + { + // Strings bank is always loaded + if (Instance.loadedBanks.Count > 1) + PauseAllEvents(began); + + if (began) + { + Instance.coreSystem.mixerSuspend(); + } + else + { + Instance.coreSystem.mixerResume(); + } + } + } + #else + void OnApplicationPause(bool pauseStatus) + { + if (studioSystem.isValid()) + { + PauseAllEvents(pauseStatus); + + if (pauseStatus) + { + coreSystem.mixerSuspend(); + } + else + { + coreSystem.mixerResume(); + } + } + } + #endif + + private void loadedBankRegister(LoadedBank loadedBank, string bankPath, string bankName, bool loadSamples, FMOD.RESULT loadResult) + { + if (loadResult == FMOD.RESULT.OK) + { + loadedBank.RefCount = 1; + + if (loadSamples) + { + loadedBank.Bank.loadSampleData(); + } + + Instance.loadedBanks.Add(bankName, loadedBank); + } + else if (loadResult == FMOD.RESULT.ERR_EVENT_ALREADY_LOADED) + { + // someone loaded this bank directly using the studio API + // TODO: will the null bank handle be an issue + loadedBank.RefCount = 2; + Instance.loadedBanks.Add(bankName, loadedBank); + } + else + { + throw new BankLoadException(bankPath, loadResult); + } + } + +#if UNITY_ANDROID || UNITY_WEBGL + IEnumerator loadFromWeb(string bankPath, string bankName, bool loadSamples) + { + byte[] loadWebResult; + FMOD.RESULT loadResult; + + UnityEngine.Networking.UnityWebRequest www = UnityEngine.Networking.UnityWebRequest.Get(bankPath); + yield return www.SendWebRequest(); + loadWebResult = www.downloadHandler.data; + + LoadedBank loadedBank = new LoadedBank(); + loadResult = Instance.studioSystem.loadBankMemory(loadWebResult, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + if (loadResult != FMOD.RESULT.OK) + { + UnityEngine.Debug.LogWarningFormat("[FMOD] loadFromWeb. Path = {0}, result = {1}.", bankPath, loadResult); + } + loadedBankRegister(loadedBank, bankPath, bankName, loadSamples, loadResult); + + Debug.LogFormat("[FMOD] Finished loading {0}", bankPath); + } +#endif // UNITY_ANDROID || UNITY_WEBGL + + public static void LoadBank(string bankName, bool loadSamples = false) + { + if (Instance.loadedBanks.ContainsKey(bankName)) + { + LoadedBank loadedBank = Instance.loadedBanks[bankName]; + loadedBank.RefCount++; + + if (loadSamples) + { + loadedBank.Bank.loadSampleData(); + } + Instance.loadedBanks[bankName] = loadedBank; + } + else + { + string bankPath = RuntimeUtils.GetBankPath(bankName); + FMOD.RESULT loadResult; + + #if UNITY_ANDROID && !UNITY_EDITOR + if (Settings.Instance.AndroidUseOBB) + { + #if UNITY_2018_1_OR_NEWER + Instance.StartCoroutine(Instance.loadFromWeb(bankPath, bankName, loadSamples)); + #else + using (var www = new WWW(bankPath)) + { + while (!www.isDone) { } + if (!String.IsNullOrEmpty(www.error)) + { + throw new BankLoadException(bankPath, www.error); + } + else + { + LoadedBank loadedBank = new LoadedBank(); + loadResult = Instance.studioSystem.loadBankMemory(www.bytes, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + Instance.loadedBankRegister(loadedBank, bankPath, bankName, loadSamples, loadResult); + } + } + #endif + } + else + #elif UNITY_WEBGL && !UNITY_EDITOR + if (true) + { + Instance.StartCoroutine(Instance.loadFromWeb(bankPath, bankName, loadSamples)); + } + else + #endif // (UNITY_ANDROID || UNITY_WEBGL) && !UNITY_EDITOR + { + LoadedBank loadedBank = new LoadedBank(); + loadResult = Instance.studioSystem.loadBankFile(bankPath, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + Instance.loadedBankRegister(loadedBank, bankPath, bankName, loadSamples, loadResult); + } + } + } + + public static void LoadBank(TextAsset asset, bool loadSamples = false) + { + string bankName = asset.name; + if (Instance.loadedBanks.ContainsKey(bankName)) + { + LoadedBank loadedBank = Instance.loadedBanks[bankName]; + loadedBank.RefCount++; + + if (loadSamples) + { + loadedBank.Bank.loadSampleData(); + } + } + else + { + LoadedBank loadedBank = new LoadedBank(); + FMOD.RESULT loadResult = Instance.studioSystem.loadBankMemory(asset.bytes, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank); + + if (loadResult == FMOD.RESULT.OK) + { + loadedBank.RefCount = 1; + Instance.loadedBanks.Add(bankName, loadedBank); + + if (loadSamples) + { + loadedBank.Bank.loadSampleData(); + } + } + else if (loadResult == FMOD.RESULT.ERR_EVENT_ALREADY_LOADED) + { + // someone loaded this bank directly using the studio API + // TODO: will the null bank handle be an issue + loadedBank.RefCount = 2; + Instance.loadedBanks.Add(bankName, loadedBank); + } + else + { + throw new BankLoadException(bankName, loadResult); + } + } + } + + private void LoadBanks(Settings fmodSettings) + { + if (fmodSettings.ImportType == ImportType.StreamingAssets) + { + // Always load strings bank + try + { + switch (fmodSettings.BankLoadType) + { + case BankLoadType.All: + foreach (string masterBankFileName in fmodSettings.MasterBanks) + { + LoadBank(masterBankFileName + ".strings", fmodSettings.AutomaticSampleLoading); + LoadBank(masterBankFileName, fmodSettings.AutomaticSampleLoading); + } + + foreach (var bank in fmodSettings.Banks) + { + LoadBank(bank, fmodSettings.AutomaticSampleLoading); + } + + WaitForAllLoads(); + break; + case BankLoadType.Specified: + foreach (var bank in fmodSettings.BanksToLoad) + { + if (!string.IsNullOrEmpty(bank)) + { + LoadBank(bank, fmodSettings.AutomaticSampleLoading); + } + } + + WaitForAllLoads(); + break; + case BankLoadType.None: + break; + default: + break; + } + } + catch (BankLoadException e) + { + UnityEngine.Debug.LogException(e); + } + } + } + + public static void UnloadBank(string bankName) + { + LoadedBank loadedBank; + if (Instance.loadedBanks.TryGetValue(bankName, out loadedBank)) + { + loadedBank.RefCount--; + if (loadedBank.RefCount == 0) + { + loadedBank.Bank.unload(); + Instance.loadedBanks.Remove(bankName); + return; + } + Instance.loadedBanks[bankName] = loadedBank; + } + } + + public static bool AnyBankLoading() + { + bool loading = false; + foreach (LoadedBank bank in Instance.loadedBanks.Values) + { + FMOD.Studio.LOADING_STATE loadingState; + bank.Bank.getSampleLoadingState(out loadingState); + loading |= (loadingState == FMOD.Studio.LOADING_STATE.LOADING); + } + return loading; + } + + public static void WaitForAllLoads() + { + Instance.studioSystem.flushSampleLoading(); + } + + public static Guid PathToGUID(string path) + { + Guid guid = Guid.Empty; + if (path.StartsWith("{")) + { + FMOD.Studio.Util.parseID(path, out guid); + } + else + { + var result = Instance.studioSystem.lookupID(path, out guid); + if (result == FMOD.RESULT.ERR_EVENT_NOTFOUND) + { + throw new EventNotFoundException(path); + } + } + return guid; + } + + public static FMOD.Studio.EventInstance CreateInstance(string path) + { + try + { + return CreateInstance(PathToGUID(path)); + } + catch(EventNotFoundException) + { + // Switch from exception with GUID to exception with path + throw new EventNotFoundException(path); + } + } + + public static FMOD.Studio.EventInstance CreateInstance(Guid guid) + { + FMOD.Studio.EventDescription eventDesc = GetEventDescription(guid); + FMOD.Studio.EventInstance newInstance; + eventDesc.createInstance(out newInstance); + + #if UNITY_EDITOR + bool is3D = false; + eventDesc.is3D(out is3D); + if (is3D) + { + // Set position to 1e+18F, set3DAttributes should be called by the dev after this. + newInstance.set3DAttributes(RuntimeUtils.To3DAttributes(new Vector3(1e+18F, 1e+18F, 1e+18F))); + instance.eventPositionWarnings.Add(newInstance); + } + #endif + + return newInstance; + } + + public static void PlayOneShot(string path, Vector3 position = new Vector3()) + { + try + { + PlayOneShot(PathToGUID(path), position); + } + catch (EventNotFoundException) + { + Debug.LogWarning("[FMOD] Event not found: " + path); + } + } + + public static void PlayOneShot(Guid guid, Vector3 position = new Vector3()) + { + var instance = CreateInstance(guid); + instance.set3DAttributes(RuntimeUtils.To3DAttributes(position)); + instance.start(); + instance.release(); + } + + public static void PlayOneShotAttached(string path, GameObject gameObject) + { + try + { + PlayOneShotAttached(PathToGUID(path), gameObject); + } + catch (EventNotFoundException) + { + Debug.LogWarning("[FMOD] Event not found: " + path); + } + } + + public static void PlayOneShotAttached(Guid guid, GameObject gameObject) + { + var instance = CreateInstance(guid); + AttachInstanceToGameObject(instance, gameObject.transform, gameObject.GetComponent()); + instance.start(); + instance.release(); + } + + public static FMOD.Studio.EventDescription GetEventDescription(string path) + { + try + { + return GetEventDescription(PathToGUID(path)); + } + catch (EventNotFoundException) + { + throw new EventNotFoundException(path); + } + } + + public static FMOD.Studio.EventDescription GetEventDescription(Guid guid) + { + FMOD.Studio.EventDescription eventDesc; + if (Instance.cachedDescriptions.ContainsKey(guid) && Instance.cachedDescriptions[guid].isValid()) + { + eventDesc = Instance.cachedDescriptions[guid]; + } + else + { + var result = Instance.studioSystem.getEventByID(guid, out eventDesc); + + if (result != FMOD.RESULT.OK) + { + throw new EventNotFoundException(guid); + } + + if (eventDesc.isValid()) + { + Instance.cachedDescriptions[guid] = eventDesc; + } + } + return eventDesc; + } + + public static List Listeners = new List(); + private static int numListeners = 0; + + public static void SetListenerLocation(GameObject gameObject, Rigidbody rigidBody = null) + { + Instance.studioSystem.setListenerAttributes(0, RuntimeUtils.To3DAttributes(gameObject, rigidBody)); + } + + public static void SetListenerLocation(GameObject gameObject, Rigidbody2D rigidBody2D) + { + Instance.studioSystem.setListenerAttributes(0, RuntimeUtils.To3DAttributes(gameObject, rigidBody2D)); + } + + public static void SetListenerLocation(Transform transform) + { + Instance.studioSystem.setListenerAttributes(0, transform.To3DAttributes()); + } + + public static void SetListenerLocation(int listenerIndex, GameObject gameObject, Rigidbody rigidBody = null) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject, rigidBody)); + } + + public static void SetListenerLocation(int listenerIndex, GameObject gameObject, Rigidbody2D rigidBody2D) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, RuntimeUtils.To3DAttributes(gameObject, rigidBody2D)); + } + + public static void SetListenerLocation(int listenerIndex, Transform transform) + { + Instance.studioSystem.setListenerAttributes(listenerIndex, transform.To3DAttributes()); + } + + public static FMOD.Studio.Bus GetBus(string path) + { + FMOD.Studio.Bus bus; + if (StudioSystem.getBus(path, out bus) != FMOD.RESULT.OK) + { + throw new BusNotFoundException(path); + } + return bus; + } + + public static FMOD.Studio.VCA GetVCA(string path) + { + FMOD.Studio.VCA vca; + if (StudioSystem.getVCA(path, out vca) != FMOD.RESULT.OK) + { + throw new VCANotFoundException(path); + } + return vca; + } + + public static void PauseAllEvents(bool paused) + { + if (HasBanksLoaded) + { + FMOD.Studio.Bus masterBus; + if (StudioSystem.getBus("bus:/", out masterBus) == FMOD.RESULT.OK) + { + masterBus.setPaused(paused); + } + } + } + + public static void MuteAllEvents(bool muted) + { + if (HasBanksLoaded) + { + FMOD.Studio.Bus masterBus; + if (StudioSystem.getBus("bus:/", out masterBus) == FMOD.RESULT.OK) + { + masterBus.setMute(muted); + } + } + } + + public static bool IsInitialized + { + get + { + return instance != null && instance.studioSystem.isValid(); + } + } + + public static bool HasBanksLoaded + { + get + { + return Instance.loadedBanks.Count > 1; + } + } + + public static bool HasBankLoaded(string loadedBank) + { + return (Instance.loadedBanks.ContainsKey(loadedBank)); + } + + private void LoadPlugins(Settings fmodSettings) + { + #if (UNITY_IOS || UNITY_TVOS || UNITY_SWITCH) && !UNITY_EDITOR + FmodUnityNativePluginInit(coreSystem.handle); + #else + + FMOD.RESULT result; + foreach (var pluginName in fmodSettings.Plugins) + { + if (string.IsNullOrEmpty(pluginName)) + continue; + string pluginPath = RuntimeUtils.GetPluginPath(pluginName); + uint handle; + result = coreSystem.loadPlugin(pluginPath, out handle); + #if UNITY_64 || UNITY_EDITOR_64 + // Add a "64" suffix and try again + if (result == FMOD.RESULT.ERR_FILE_BAD || result == FMOD.RESULT.ERR_FILE_NOTFOUND) + { + string pluginPath64 = RuntimeUtils.GetPluginPath(pluginName + "64"); + result = coreSystem.loadPlugin(pluginPath64, out handle); + } + #endif + CheckInitResult(result, String.Format("Loading plugin '{0}' from '{1}'", pluginName, pluginPath)); + loadedPlugins.Add(pluginName, handle); + } + #endif + } + + private void SetThreadAffinity() + { + #if UNITY_PS4 && !UNITY_EDITOR + FMOD.PS4.THREADAFFINITY affinity = new FMOD.PS4.THREADAFFINITY + { + mixer = FMOD.PS4.THREAD.CORE2, + studioUpdate = FMOD.PS4.THREAD.CORE4, + studioLoadBank = FMOD.PS4.THREAD.CORE4, + studioLoadSample = FMOD.PS4.THREAD.CORE4 + }; + FMOD.RESULT result = FMOD.PS4.setThreadAffinity(ref affinity); + CheckInitResult(result, "FMOD.PS4.setThreadAffinity"); + + #elif UNITY_XBOXONE && !UNITY_EDITOR + FMOD.XboxOne.THREADAFFINITY affinity = new FMOD.XboxOne.THREADAFFINITY + { + mixer = FMOD.XboxOne.THREAD.CORE2, + studioUpdate = FMOD.XboxOne.THREAD.CORE4, + studioLoadBank = FMOD.XboxOne.THREAD.CORE4, + studioLoadSample = FMOD.XboxOne.THREAD.CORE4 + }; + FMOD.RESULT result = FMOD.XboxOne.setThreadAffinity(ref affinity); + CheckInitResult(result, "FMOD.XboxOne.setThreadAffinity"); + + #elif UNITY_SWITCH && !UNITY_EDITOR + FMOD.Switch.THREADAFFINITY affinity = new FMOD.Switch.THREADAFFINITY + { + mixer = FMOD.Switch.THREAD.DEFAULT, + studioUpdate = FMOD.Switch.THREAD.DEFAULT, + studioLoadBank = FMOD.Switch.THREAD.DEFAULT, + studioLoadSample = FMOD.Switch.THREAD.DEFAULT + }; + FMOD.RESULT result = FMOD.Switch.setThreadAffinity(ref affinity); + CheckInitResult(result, "FMOD.Switch.setThreadAffinity"); + #elif UNITY_ANDROID && !UNITY_EDITOR + FMOD.Android.THREADAFFINITY affinity = new FMOD.Android.THREADAFFINITY + { + mixer = FMOD.Android.THREAD.DEFAULT, + studioUpdate = FMOD.Android.THREAD.DEFAULT, + studioLoadBank = FMOD.Android.THREAD.DEFAULT, + studioLoadSample = FMOD.Android.THREAD.DEFAULT + }; + FMOD.RESULT result = FMOD.Android.setThreadAffinity(ref affinity); + CheckInitResult(result, "FMOD.Android.setThreadAffinity"); + #endif + } + + #if (UNITY_IOS || UNITY_TVOS || UNITY_SWITCH) && !UNITY_EDITOR + [DllImport("__Internal")] + private static extern FMOD.RESULT FmodUnityNativePluginInit(IntPtr system); + + #if !UNITY_SWITCH + [DllImport("__Internal")] + private static extern void RegisterSuspendCallback(Action func); + #endif + + #endif + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs.meta b/Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs.meta new file mode 100644 index 0000000..4e923d8 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5e5fb8ce07f0ce84b9d1852869527ea5 +timeCreated: 1444628977 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 100 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/RuntimeUtils.cs b/Assets/Plugins/FMOD/src/Runtime/RuntimeUtils.cs new file mode 100644 index 0000000..d3ee950 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/RuntimeUtils.cs @@ -0,0 +1,500 @@ +using System; +using UnityEngine; +using System.IO; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ + public class EventNotFoundException : Exception + { + public Guid Guid; + public string Path; + public EventNotFoundException(string path) + : base("[FMOD] Event not found '" + path + "'") + { + Path = path; + } + + public EventNotFoundException(Guid guid) + : base("[FMOD] Event not found " + guid.ToString("b") + "") + { + Guid = guid; + } + } + + public class BusNotFoundException : Exception + { + public string Path; + public BusNotFoundException(string path) + : base("[FMOD] Bus not found '" + path + "'") + { + Path = path; + } + } + + public class VCANotFoundException : Exception + { + public string Path; + public VCANotFoundException(string path) + : base("[FMOD] VCA not found '" + path + "'") + { + Path = path; + } + } + + public class BankLoadException : Exception + { + public string Path; + public FMOD.RESULT Result; + + public BankLoadException(string path, FMOD.RESULT result) + : base(string.Format("[FMOD] Could not load bank '{0}' : {1} : {2}", path, result.ToString(), FMOD.Error.String(result))) + { + Path = path; + Result = result; + } + public BankLoadException(string path, string error) + : base(string.Format("[FMOD] Could not load bank '{0}' : {1}", path, error)) + { + Path = path; + Result = FMOD.RESULT.ERR_INTERNAL; + } + } + + public class SystemNotInitializedException : Exception + { + public FMOD.RESULT Result; + public string Location; + + public SystemNotInitializedException(FMOD.RESULT result, string location) + : base(string.Format("[FMOD] Initialization failed : {2} : {0} : {1}", result.ToString(), FMOD.Error.String(result), location)) + { + Result = result; + Location = location; + } + + public SystemNotInitializedException(Exception inner) + : base("[FMOD] Initialization failed", inner) + { + } + } + + public enum EmitterGameEvent : int + { + None, + ObjectStart, + ObjectDestroy, + TriggerEnter, + TriggerExit, + TriggerEnter2D, + TriggerExit2D, + CollisionEnter, + CollisionExit, + CollisionEnter2D, + CollisionExit2D, + ObjectEnable, + ObjectDisable, + MouseEnter, + MouseExit, + MouseDown, + MouseUp, + } + + public enum LoaderGameEvent : int + { + None, + ObjectStart, + ObjectDestroy, + TriggerEnter, + TriggerExit, + TriggerEnter2D, + TriggerExit2D, + } + + public static class RuntimeUtils + { + public static string GetCommonPlatformPath(string path) + { + if (string.IsNullOrEmpty(path)) + { + return path; + } + + return path.Replace('\\', '/'); + } + + public static FMOD.VECTOR ToFMODVector(this Vector3 vec) + { + FMOD.VECTOR temp; + temp.x = vec.x; + temp.y = vec.y; + temp.z = vec.z; + + return temp; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(this Vector3 pos) + { + FMOD.ATTRIBUTES_3D attributes = new FMOD.ATTRIBUTES_3D(); + attributes.forward = ToFMODVector(Vector3.forward); + attributes.up = ToFMODVector(Vector3.up); + attributes.position = ToFMODVector(pos); + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(this Transform transform) + { + FMOD.ATTRIBUTES_3D attributes = new FMOD.ATTRIBUTES_3D(); + attributes.forward = transform.forward.ToFMODVector(); + attributes.up = transform.up.ToFMODVector(); + attributes.position = transform.position.ToFMODVector(); + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(Transform transform, Rigidbody rigidbody = null) + { + FMOD.ATTRIBUTES_3D attributes = transform.To3DAttributes(); + + if (rigidbody) + { + attributes.velocity = rigidbody.velocity.ToFMODVector(); + } + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(GameObject go, Rigidbody rigidbody = null) + { + FMOD.ATTRIBUTES_3D attributes = go.transform.To3DAttributes(); + + if (rigidbody) + { + attributes.velocity = rigidbody.velocity.ToFMODVector(); + } + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(Transform transform, Rigidbody2D rigidbody) + { + FMOD.ATTRIBUTES_3D attributes = transform.To3DAttributes(); + + if (rigidbody) + { + FMOD.VECTOR vel; + vel.x = rigidbody.velocity.x; + vel.y = rigidbody.velocity.y; + vel.z = 0; + attributes.velocity = vel; + } + + return attributes; + } + + public static FMOD.ATTRIBUTES_3D To3DAttributes(GameObject go, Rigidbody2D rigidbody) + { + FMOD.ATTRIBUTES_3D attributes = go.transform.To3DAttributes(); + + if (rigidbody) + { + FMOD.VECTOR vel; + vel.x = rigidbody.velocity.x; + vel.y = rigidbody.velocity.y; + vel.z = 0; + attributes.velocity = vel; + } + + return attributes; + } + + // Internal Helper Functions + internal static FMODPlatform GetCurrentPlatform() + { + #if UNITY_EDITOR + return FMODPlatform.PlayInEditor; + #elif UNITY_STANDALONE_WIN + return FMODPlatform.Windows; + #elif UNITY_STANDALONE_OSX + return FMODPlatform.Mac; + #elif UNITY_STANDALONE_LINUX + return FMODPlatform.Linux; + #elif UNITY_TVOS + return FMODPlatform.AppleTV; + #elif UNITY_IOS + FMODPlatform result; + switch (UnityEngine.iOS.Device.generation) + { + case UnityEngine.iOS.DeviceGeneration.iPad1Gen: + case UnityEngine.iOS.DeviceGeneration.iPad2Gen: + case UnityEngine.iOS.DeviceGeneration.iPad3Gen: + case UnityEngine.iOS.DeviceGeneration.iPadMini1Gen: + case UnityEngine.iOS.DeviceGeneration.iPhone: + case UnityEngine.iOS.DeviceGeneration.iPhone3G: + case UnityEngine.iOS.DeviceGeneration.iPhone3GS: + case UnityEngine.iOS.DeviceGeneration.iPhone4: + case UnityEngine.iOS.DeviceGeneration.iPhone4S: + result = FMODPlatform.MobileLow; + break; + default: + result = FMODPlatform.MobileHigh; + break; + } + + UnityEngine.Debug.Log(String.Format("FMOD Studio: Device {0} classed as {1}", SystemInfo.deviceModel, result.ToString())); + return result; + #elif UNITY_ANDROID + FMODPlatform result; + if (SystemInfo.processorCount <= 2) + { + result = FMODPlatform.MobileLow; + } + else if (SystemInfo.processorCount >= 8) + { + result = FMODPlatform.MobileHigh; + } + else + { + // check the clock rate on quad core systems + string freqinfo = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"; + try + { + using (global::System.IO.TextReader reader = new global::System.IO.StreamReader(freqinfo)) + { + string line = reader.ReadLine(); + int khz = Int32.Parse(line) / 1000; + if (khz >= 1600) + { + result = FMODPlatform.MobileHigh; + } + else + { + result = FMODPlatform.MobileLow; + } + } + } + catch + { + result = FMODPlatform.MobileLow; + } + } + + UnityEngine.Debug.Log(String.Format("[FMOD] Device {0} classed as {1}", SystemInfo.deviceModel, result.ToString())); + return result; + #elif UNITY_WINRT_8_1 + FMODPlatform result; + if (SystemInfo.processorCount <= 2) + { + result = FMODPlatform.MobileLow; + } + else + { + result = FMODPlatform.MobileHigh; + } + + UnityEngine.Debug.Log(String.Format("[FMOD] Device {0} classed as {1}", SystemInfo.deviceModel, result.ToString())); + return result; + + #elif UNITY_PS4 + return FMODPlatform.PS4; + #elif UNITY_XBOXONE + return FMODPlatform.XboxOne; + #elif UNITY_WSA_10_0 + return FMODPlatform.UWP; + #elif UNITY_SWITCH + return FMODPlatform.Switch; + #elif UNITY_WEBGL + return FMODPlatform.WebGL; + #elif UNITY_STADIA + return FMODPlatform.Stadia; + #endif + } + + const string BankExtension = ".bank"; + internal static string GetBankPath(string bankName) + { + #if UNITY_EDITOR + // For play in editor use original asset location because streaming asset folder will contain platform specific banks + string bankFolder = Settings.Instance.SourceBankPath; + if (Settings.Instance.HasPlatforms) + { + bankFolder = global::System.IO.Path.Combine(bankFolder, Settings.Instance.GetBankPlatform(FMODPlatform.PlayInEditor)); + } + #elif UNITY_ANDROID + string bankFolder = Settings.Instance.AndroidUseOBB ? Application.streamingAssetsPath : "file:///android_asset"; + #elif UNITY_WINRT_8_1 || UNITY_WSA_10_0 + string bankFolder = "ms-appx:///Data/StreamingAssets"; + #else + string bankFolder = Application.streamingAssetsPath; + #endif + + // Special case for Switch, remove / at start if needed. + #if UNITY_SWITCH + if (bankFolder[0] == '/') + bankFolder = bankFolder.Substring(1); + #endif + + if (System.IO.Path.GetExtension(bankName) != BankExtension) + { + return string.Format("{0}/{1}.bank", bankFolder, bankName); + } + else + { + return string.Format("{0}/{1}", bankFolder, bankName); + } + } + + internal static string GetPluginPath(string pluginName) + { + #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_XBOXONE || UNITY_WINRT_8_1 || UNITY_WSA_10_0 + string pluginFileName = pluginName + ".dll"; + #elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX + string pluginFileName = pluginName + ".bundle"; + #elif UNITY_PS4 + string pluginFileName = pluginName + ".prx"; + #elif UNITY_ANDROID || UNITY_STANDALONE_LINUX + string pluginFileName = "lib" + pluginName + ".so"; + #elif UNITY_WEBGL + string pluginFileName = pluginName + ".bc"; + #endif + + string fmodLibPath = "/Plugins/FMOD/lib"; + #if UNITY_EDITOR_WIN && UNITY_EDITOR_64 + string pluginFolder = Application.dataPath + fmodLibPath + "/win/X86_64/"; + #elif UNITY_EDITOR_WIN + string pluginFolder = Application.dataPath + fmodLibPath + "/win/X86/"; + #elif UNITY_EDITOR_OSX + string pluginFolder = Application.dataPath + fmodLibPath + "/mac/"; + #elif UNITY_EDITOR_LINUX && UNITY_EDITOR_64 + string pluginFolder = Application.dataPath + fmodLibPath + "/linux/x86_64/"; + #elif UNITY_EDITOR_LINUX + string pluginFolder = Application.dataPath + fmodLibPath + "/linux/x86/"; + #elif UNITY_STANDALONE_WIN + #if UNITY_2019_1_OR_NEWER + #if UNITY_64 + string pluginFolder = Application.dataPath + "/Plugins/X86_64/"; + #else + string pluginFolder = Application.dataPath + "/Plugins/X86/"; + #endif + #else + string pluginFolder = Application.dataPath + "/Plugins/"; + #endif + #elif UNITY_PS4 || UNITY_XBOXONE || UNITY_STANDALONE_OSX || UNITY_WEBGL + string pluginFolder = Application.dataPath + "/Plugins/"; + #elif UNITY_STANDALONE_LINUX + #if UNITY_2019_1_OR_NEWER + string pluginFolder = Application.dataPath + "/Plugins/"; + #else + string pluginFolder = Application.dataPath + "/Plugins/" + ((IntPtr.Size == 8) ? "x86_64/" : "x86/"); + #endif + #elif UNITY_WSA || UNITY_ANDROID + string pluginFolder = ""; + #else + string pluginFileName = ""; + string pluginFolder = ""; + #endif + + return pluginFolder + pluginFileName; + } + + public static void EnforceLibraryOrder() + { + #if UNITY_ANDROID && !UNITY_EDITOR + + AndroidJavaClass jSystem = new AndroidJavaClass("java.lang.System"); + jSystem.CallStatic("loadLibrary", FMOD.VERSION.dll); + jSystem.CallStatic("loadLibrary", FMOD.Studio.STUDIO_VERSION.dll); + + #endif + + // Call a function in fmod.dll to make sure it's loaded before fmodstudio.dll + int temp1, temp2; + FMOD.Memory.GetStats(out temp1, out temp2); + + Guid temp3; + FMOD.Studio.Util.parseID("", out temp3); + } + + #if UNITY_EDITOR + public static FMODPlatform GetEditorFMODPlatform() + { + switch (EditorUserBuildSettings.activeBuildTarget) + { + case BuildTarget.Android: + return FMODPlatform.Android; + case BuildTarget.iOS: + return FMODPlatform.iOS; + case BuildTarget.PS4: + return FMODPlatform.PS4; + #if !UNITY_2019_2_OR_NEWER + case BuildTarget.StandaloneLinux: + case BuildTarget.StandaloneLinuxUniversal: + #endif + case BuildTarget.StandaloneLinux64: + return FMODPlatform.Linux; + case BuildTarget.StandaloneOSX: + return FMODPlatform.Mac; + case BuildTarget.StandaloneWindows: + case BuildTarget.StandaloneWindows64: + return FMODPlatform.Windows; + case BuildTarget.XboxOne: + return FMODPlatform.XboxOne; + case BuildTarget.WSAPlayer: + return FMODPlatform.UWP; + case BuildTarget.tvOS: + return FMODPlatform.AppleTV; + #if UNITY_SWITCH + case BuildTarget.Switch: + return FMODPlatform.Switch; + #endif + #if UNITY_WEBGL + case BuildTarget.WebGL: + return FMODPlatform.WebGL; + #endif + #if UNITY_STADIA + case BuildTarget.Stadia: + return FMODPlatform.Stadia; + #endif + default: + return FMODPlatform.None; + } + } + #endif + + public static bool VerifyPlatformLibsExist() + { + string pluginDir = Application.dataPath + "/Plugins/"; + #if UNITY_EDITOR + pluginDir += "FMOD/lib/"; + #if UNITY_XBOXONE + pluginDir += "xboxone/fmodstudio.dll"; + #elif UNITY_PS4 + pluginDir += "ps4/libfmodstudio.prx"; + #elif UNITY_STADIA + pluginDir += "stadia/libfmodstudio.so"; + #elif UNITY_SWITCH // Not called at runtime because the static lib is not included in the built game. + pluginDir += "switch/libfmodstudiounityplugin.a"; + #endif + #else // !UNITY_EDITOR + #if UNITY_XBOXONE + pluginDir += "fmodstudio.dll"; + #elif UNITY_PS4 + pluginDir += "libfmodstudio.prx"; + #elif UNITY_STADIA + pluginDir += "libfmodstudio.so"; + #endif + #endif // UNITY_EDITOR + + if (Path.HasExtension(pluginDir) && !File.Exists(pluginDir)) + { + Debug.LogWarning("[FMOD] Unable to locate '" + pluginDir + "'."); + Debug.LogWarning("[FMOD] This platform requires verification 'https://fmod.com/profile#permissions' and an additional package from 'https://fmod.com/download'."); + return false; + } + return true; + } + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/RuntimeUtils.cs.meta b/Assets/Plugins/FMOD/src/Runtime/RuntimeUtils.cs.meta new file mode 100644 index 0000000..e182bcc --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/RuntimeUtils.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 6e349601408e423499e7b9f75216091d +timeCreated: 1433225261 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/Settings.cs b/Assets/Plugins/FMOD/src/Runtime/Settings.cs new file mode 100644 index 0000000..81ed1f4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Settings.cs @@ -0,0 +1,465 @@ +using UnityEngine; +using System.Collections.Generic; +using System; +using System.IO; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace FMODUnity +{ + [Serializable] + public enum FMODPlatform + { + None, + PlayInEditor, + Default, + Desktop, + Mobile, + MobileHigh, + MobileLow, + Console, + Windows, + Mac, + Linux, + iOS, + Android, + Deprecated_1, + XboxOne, + PS4, + Deprecated_2, + Deprecated_3, + AppleTV, + UWP, + Switch, + WebGL, + Stadia, + Reserved_1, + Reserved_2, + Reserved_3, + Count, + } + + [Serializable] + public enum ImportType + { + StreamingAssets, + AssetBundle, + } + + [Serializable] + public enum BankLoadType + { + All, + Specified, + None + } + + public class PlatformSettingBase + { + public FMODPlatform Platform; + } + + public class PlatformSetting : PlatformSettingBase + { + public T Value; + } + + [Serializable] + public class PlatformIntSetting : PlatformSetting + { + } + + [Serializable] + public class PlatformStringSetting : PlatformSetting + { + } + + public enum TriStateBool + { + Disabled, + Enabled, + Development, + } + + [Serializable] + public class PlatformBoolSetting : PlatformSetting + { + } + + #if UNITY_EDITOR + [InitializeOnLoad] + #endif + public class Settings : ScriptableObject + { + #if UNITY_EDITOR + [SerializeField] + bool SwitchSettingsMigration = false; + #endif + + const string SettingsAssetName = "FMODStudioSettings"; + + private static Settings instance = null; + + public static Settings Instance + { + get + { + if (instance == null) + { + instance = Resources.Load(SettingsAssetName) as Settings; + if (instance == null) + { + UnityEngine.Debug.Log("[FMOD] Cannot find integration settings, creating default settings"); + instance = CreateInstance(); + instance.name = "FMOD Studio Integration Settings"; + + #if UNITY_EDITOR + if (!Directory.Exists("Assets/Plugins/FMOD/Resources")) + { + AssetDatabase.CreateFolder("Assets/Plugins/FMOD", "Resources"); + } + AssetDatabase.CreateAsset(instance, "Assets/Plugins/FMOD/Resources/" + SettingsAssetName + ".asset"); + #endif + } + } + return instance; + } + } + + #if UNITY_EDITOR + [MenuItem("FMOD/Edit Settings", priority = 0)] + public static void EditSettings() + { + Selection.activeObject = Instance; + #if UNITY_2018_2_OR_NEWER + EditorApplication.ExecuteMenuItem("Window/General/Inspector"); + #else + EditorApplication.ExecuteMenuItem("Window/Inspector"); + #endif + } + #endif + + [SerializeField] + public bool HasSourceProject = true; + + [SerializeField] + public bool HasPlatforms = true; + + [SerializeField] + private string sourceProjectPath; + + public string SourceProjectPath + { + get + { + return sourceProjectPath; + } + set + { + sourceProjectPath = value; + } + } + + [SerializeField] + private string sourceBankPath; + public string SourceBankPath + { + get + { + return sourceBankPath; + } + set + { + sourceBankPath = value; + } + } + + [SerializeField] + public string SourceBankPathUnformatted; // Kept as to not break existing projects + + [SerializeField] + public bool AutomaticEventLoading; + + [SerializeField] + public BankLoadType BankLoadType; + + [SerializeField] + public bool AutomaticSampleLoading; + + [SerializeField] + public string EncryptionKey; + + [SerializeField] + public ImportType ImportType; + + [SerializeField] + public string TargetAssetPath = "FMODBanks"; + + [SerializeField] + public FMOD.DEBUG_FLAGS LoggingLevel = FMOD.DEBUG_FLAGS.WARNING; + + [SerializeField] + public List SpeakerModeSettings; + + [SerializeField] + public List SampleRateSettings; + + [SerializeField] + public List LiveUpdateSettings; + + [SerializeField] + public List OverlaySettings; + + [SerializeField] + public List LoggingSettings; + + [SerializeField] + public List BankDirectorySettings; + + [SerializeField] + public List VirtualChannelSettings; + + [SerializeField] + public List RealChannelSettings; + + [SerializeField] + public List Plugins = new List(); + + [SerializeField] + public List MasterBanks; + + [SerializeField] + public List Banks; + + [SerializeField] + public List BanksToLoad; + + [SerializeField] + public ushort LiveUpdatePort = 9264; + + [SerializeField] + public bool AndroidUseOBB = false; + + public static FMODPlatform GetParent(FMODPlatform platform) + { + switch (platform) + { + case FMODPlatform.Windows: + case FMODPlatform.Linux: + case FMODPlatform.Mac: + case FMODPlatform.UWP: + return FMODPlatform.Desktop; + case FMODPlatform.MobileHigh: + case FMODPlatform.MobileLow: + case FMODPlatform.iOS: + case FMODPlatform.Android: + case FMODPlatform.AppleTV: + return FMODPlatform.Mobile; + case FMODPlatform.Switch: + case FMODPlatform.XboxOne: + case FMODPlatform.PS4: + case FMODPlatform.Stadia: + return FMODPlatform.Console; + case FMODPlatform.Desktop: + case FMODPlatform.Console: + case FMODPlatform.Mobile: + return FMODPlatform.Default; + case FMODPlatform.PlayInEditor: + case FMODPlatform.Default: + default: + return FMODPlatform.None; + } + } + + public static bool HasSetting(List list, FMODPlatform platform) where T : PlatformSettingBase + { + return FindSetting(list, platform) != null; + } + + public static U GetSetting(List list, FMODPlatform platform, U def) where T : PlatformSetting + { + T t = FindSetting(list, platform); + if (t == null) + { + FMODPlatform parent = GetParent(platform); + if (parent != FMODPlatform.None) + { + return GetSetting(list, parent, def); + } + else + { + return def; + } + } + return t.Value; + } + + public static void SetSetting(List list, FMODPlatform platform, U value) where T : PlatformSetting, new() + { + T setting = FindSetting(list, platform); + if (setting == null) + { + setting = new T(); + setting.Platform = platform; + list.Add(setting); + } + setting.Value = value; + } + + private static T FindSetting(List settings, FMODPlatform platform) where T : PlatformSettingBase + { + for (int i = 0; i < settings.Count; ++i) + { + if (settings[i].Platform == platform) + { + return settings[i]; + } + } + return null; + } + + public static void RemoveSetting(List list, FMODPlatform platform) where T : PlatformSettingBase + { + list.RemoveAll((x) => x.Platform == platform); + } + + // -------- Live Update ---------------------- + public bool IsLiveUpdateEnabled(FMODPlatform platform) + { + #if DEVELOPMENT_BUILD || UNITY_EDITOR + return GetSetting(LiveUpdateSettings, platform, TriStateBool.Disabled) != TriStateBool.Disabled; + #else + return GetSetting(LiveUpdateSettings, platform, TriStateBool.Disabled) == TriStateBool.Enabled; + #endif + } + + // -------- Overlay Update ---------------------- + public bool IsOverlayEnabled(FMODPlatform platform) + { + #if DEVELOPMENT_BUILD || UNITY_EDITOR + return GetSetting(OverlaySettings, platform, TriStateBool.Disabled) != TriStateBool.Disabled; + #else + return GetSetting(OverlaySettings, platform, TriStateBool.Disabled) == TriStateBool.Enabled; + #endif + } + + // -------- Real channels ---------------------- + public int GetRealChannels(FMODPlatform platform) + { + return GetSetting(RealChannelSettings, platform, 64); + } + + // -------- Virtual channels ---------------------- + public int GetVirtualChannels(FMODPlatform platform) + { + return GetSetting(VirtualChannelSettings, platform, 128); + } + + // -------- Speaker Mode ---------------------- + public int GetSpeakerMode(FMODPlatform platform) + { + #if UNITY_EDITOR + if (platform == FMODPlatform.PlayInEditor) + { + return GetSetting(SpeakerModeSettings, platform, GetSetting(SpeakerModeSettings, RuntimeUtils.GetEditorFMODPlatform(), (int)FMOD.SPEAKERMODE.STEREO)); + } + else + #endif + { + return GetSetting(SpeakerModeSettings, platform, (int)FMOD.SPEAKERMODE.STEREO); + } + } + // -------- Sample Rate ---------------------- + public int GetSampleRate(FMODPlatform platform) + { + return GetSetting(SampleRateSettings, platform, 48000); + } + + // -------- Bank Platform ---------------------- + public string GetBankPlatform(FMODPlatform platform) + { + if (!HasPlatforms) + { + return ""; + } + #if UNITY_EDITOR + if (platform == FMODPlatform.PlayInEditor) + { + return GetSetting(BankDirectorySettings, platform, GetSetting(BankDirectorySettings, RuntimeUtils.GetEditorFMODPlatform(), "Desktop")); + } + else + #endif + { + return GetSetting(BankDirectorySettings, platform, "Desktop"); + } + } + + private Settings() + { + MasterBanks = new List(); + Banks = new List(); + BanksToLoad = new List(); + RealChannelSettings = new List(); + VirtualChannelSettings = new List(); + LoggingSettings = new List(); + LiveUpdateSettings = new List(); + OverlaySettings = new List(); + SampleRateSettings = new List(); + SpeakerModeSettings = new List(); + BankDirectorySettings = new List(); + + // Default play in editor settings + SetSetting(LoggingSettings, FMODPlatform.PlayInEditor, TriStateBool.Enabled); + SetSetting(LiveUpdateSettings, FMODPlatform.PlayInEditor, TriStateBool.Enabled); + SetSetting(OverlaySettings, FMODPlatform.PlayInEditor, TriStateBool.Enabled); + SetSetting(SampleRateSettings, FMODPlatform.PlayInEditor, 48000); + // These are not editable, set them high + SetSetting(RealChannelSettings, FMODPlatform.PlayInEditor, 256); + SetSetting(VirtualChannelSettings, FMODPlatform.PlayInEditor, 1024); + + // Default runtime settings + SetSetting(LoggingSettings, FMODPlatform.Default, TriStateBool.Disabled); + SetSetting(LiveUpdateSettings, FMODPlatform.Default, TriStateBool.Disabled); + SetSetting(OverlaySettings, FMODPlatform.Default, TriStateBool.Disabled); + + SetSetting(RealChannelSettings, FMODPlatform.Default, 32); // Match the default in the low level + SetSetting(VirtualChannelSettings, FMODPlatform.Default, 128); + SetSetting(SampleRateSettings, FMODPlatform.Default, 0); + SetSetting(SpeakerModeSettings, FMODPlatform.Default, (int) FMOD.SPEAKERMODE.STEREO); + + ImportType = ImportType.StreamingAssets; + AutomaticEventLoading = true; + AutomaticSampleLoading = false; + } + + #if UNITY_EDITOR + private void OnEnable() + { + if (SwitchSettingsMigration == false) + { + SetSetting(LoggingSettings, FMODPlatform.Switch, GetSetting(LoggingSettings, FMODPlatform.Mobile, TriStateBool.Disabled)); + SetSetting(LiveUpdateSettings, FMODPlatform.Switch, GetSetting(LiveUpdateSettings, FMODPlatform.Mobile, TriStateBool.Disabled)); + SetSetting(OverlaySettings, FMODPlatform.Switch, GetSetting(OverlaySettings, FMODPlatform.Mobile, TriStateBool.Disabled)); + + SetSetting(RealChannelSettings, FMODPlatform.Switch, GetSetting(RealChannelSettings, FMODPlatform.Mobile, 32)); // Match the default in the low level + SetSetting(VirtualChannelSettings, FMODPlatform.Switch, GetSetting(VirtualChannelSettings, FMODPlatform.Mobile, 128)); + SetSetting(SampleRateSettings, FMODPlatform.Switch, GetSetting(SampleRateSettings, FMODPlatform.Mobile, 0)); + SetSetting(SpeakerModeSettings, FMODPlatform.Switch, GetSetting(SpeakerModeSettings, FMODPlatform.Mobile, (int)FMOD.SPEAKERMODE.STEREO)); + SwitchSettingsMigration = true; + } + + // Fix up slashes for old settings meta data. + sourceProjectPath = RuntimeUtils.GetCommonPlatformPath(sourceProjectPath); + SourceBankPathUnformatted = RuntimeUtils.GetCommonPlatformPath(SourceBankPathUnformatted); + + // Remove the FMODStudioCache if in the old location + string oldCache = "Assets/Plugins/FMOD/Resources/FMODStudioCache.asset"; + if (File.Exists(oldCache)) + { + AssetDatabase.DeleteAsset(oldCache); + } + } + #endif + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/Settings.cs.meta b/Assets/Plugins/FMOD/src/Runtime/Settings.cs.meta new file mode 100644 index 0000000..7fa33f1 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Settings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: eef8d824ea7b63742966aaa0e94ac383 +timeCreated: 1435215721 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -400 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioBankLoader.cs b/Assets/Plugins/FMOD/src/Runtime/StudioBankLoader.cs new file mode 100644 index 0000000..6d1b0aa --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioBankLoader.cs @@ -0,0 +1,104 @@ +using UnityEngine; +using System.Collections.Generic; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Bank Loader")] + public class StudioBankLoader : MonoBehaviour + { + public LoaderGameEvent LoadEvent; + public LoaderGameEvent UnloadEvent; + [BankRef] + public List Banks; + public string CollisionTag; + public bool PreloadSamples; + private bool isQuitting; + + void HandleGameEvent(LoaderGameEvent gameEvent) + { + if (LoadEvent == gameEvent) + { + Load(); + } + if (UnloadEvent == gameEvent) + { + Unload(); + } + } + + void Start() + { + RuntimeUtils.EnforceLibraryOrder(); + HandleGameEvent(LoaderGameEvent.ObjectStart); + } + + void OnApplicationQuit() + { + isQuitting = true; + } + + void OnDestroy() + { + if (!isQuitting) + { + HandleGameEvent(LoaderGameEvent.ObjectDestroy); + } + } + + void OnTriggerEnter(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerEnter); + } + } + + void OnTriggerExit(Collider other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerExit); + } + } + + void OnTriggerEnter2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerEnter2D); + } + } + + void OnTriggerExit2D(Collider2D other) + { + if (string.IsNullOrEmpty(CollisionTag) || other.CompareTag(CollisionTag)) + { + HandleGameEvent(LoaderGameEvent.TriggerExit2D); + } + } + + public void Load() + { + foreach (var bankRef in Banks) + { + try + { + RuntimeManager.LoadBank(bankRef, PreloadSamples); + } + catch (BankLoadException e) + { + UnityEngine.Debug.LogException(e); + } + } + RuntimeManager.WaitForAllLoads(); + } + + public void Unload() + { + foreach (var bankRef in Banks) + { + RuntimeManager.UnloadBank(bankRef); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioBankLoader.cs.meta b/Assets/Plugins/FMOD/src/Runtime/StudioBankLoader.cs.meta new file mode 100644 index 0000000..9bacb4a --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioBankLoader.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b9468c5f457ace64f8d4df6d642b107f +timeCreated: 1440562167 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -250 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioEventEmitter.cs b/Assets/Plugins/FMOD/src/Runtime/StudioEventEmitter.cs new file mode 100644 index 0000000..0495f61 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioEventEmitter.cs @@ -0,0 +1,222 @@ +using UnityEngine; +using System; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Event Emitter")] + public class StudioEventEmitter : EventHandler + { + [EventRef] + public string Event = ""; + public EmitterGameEvent PlayEvent = EmitterGameEvent.None; + public EmitterGameEvent StopEvent = EmitterGameEvent.None; + public bool AllowFadeout = true; + public bool TriggerOnce = false; + public bool Preload = false; + public ParamRef[] Params = new ParamRef[0]; + public bool OverrideAttenuation = false; + public float OverrideMinDistance = -1.0f; + public float OverrideMaxDistance = -1.0f; + + protected FMOD.Studio.EventDescription eventDescription; + public FMOD.Studio.EventDescription EventDescription { get { return eventDescription; } } + + protected FMOD.Studio.EventInstance instance; + public FMOD.Studio.EventInstance EventInstance { get { return instance; } } + + private bool hasTriggered = false; + private bool isQuitting = false; + private bool isOneshot = false; + + private const string SnapshotString = "snapshot"; + + void Start() + { + RuntimeUtils.EnforceLibraryOrder(); + if (Preload) + { + Lookup(); + eventDescription.loadSampleData(); + RuntimeManager.StudioSystem.update(); + FMOD.Studio.LOADING_STATE loadingState; + eventDescription.getSampleLoadingState(out loadingState); + while(loadingState == FMOD.Studio.LOADING_STATE.LOADING) + { + #if WINDOWS_UWP + System.Threading.Tasks.Task.Delay(1).Wait(); + #else + System.Threading.Thread.Sleep(1); + #endif + eventDescription.getSampleLoadingState(out loadingState); + } + } + HandleGameEvent(EmitterGameEvent.ObjectStart); + } + + void OnApplicationQuit() + { + isQuitting = true; + } + + void OnDestroy() + { + if (!isQuitting) + { + HandleGameEvent(EmitterGameEvent.ObjectDestroy); + if (instance.isValid()) + { + RuntimeManager.DetachInstanceFromGameObject(instance); + if (eventDescription.isValid() && isOneshot) + { + instance.release(); + instance.clearHandle(); + } + } + + if (Preload) + { + eventDescription.unloadSampleData(); + } + } + } + + protected override void HandleGameEvent(EmitterGameEvent gameEvent) + { + if (PlayEvent == gameEvent) + { + Play(); + } + if (StopEvent == gameEvent) + { + Stop(); + } + } + + void Lookup() + { + eventDescription = RuntimeManager.GetEventDescription(Event); + + if (eventDescription.isValid()) + { + for (int i = 0; i < Params.Length; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param; + eventDescription.getParameterDescriptionByName(Params[i].Name, out param); + Params[i].ID = param.id; + } + } + } + + public void Play() + { + if (TriggerOnce && hasTriggered) + { + return; + } + + if (string.IsNullOrEmpty(Event)) + { + return; + } + + if (!eventDescription.isValid()) + { + Lookup(); + } + + if (!Event.StartsWith(SnapshotString, StringComparison.CurrentCultureIgnoreCase)) + { + eventDescription.isOneshot(out isOneshot); + } + bool is3D; + eventDescription.is3D(out is3D); + + if (!instance.isValid()) + { + instance.clearHandle(); + } + + // Let previous oneshot instances play out + if (isOneshot && instance.isValid()) + { + instance.release(); + instance.clearHandle(); + } + + if (!instance.isValid()) + { + eventDescription.createInstance(out instance); + + // Only want to update if we need to set 3D attributes + if (is3D) + { + var rigidBody = GetComponent(); + var rigidBody2D = GetComponent(); + var transform = GetComponent(); + if (rigidBody) + { + instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject, rigidBody)); + RuntimeManager.AttachInstanceToGameObject(instance, transform, rigidBody); + } + else + { + instance.set3DAttributes(RuntimeUtils.To3DAttributes(gameObject, rigidBody2D)); + RuntimeManager.AttachInstanceToGameObject(instance, transform, rigidBody2D); + } + } + } + + foreach(var param in Params) + { + instance.setParameterByID(param.ID, param.Value); + } + + if (is3D && OverrideAttenuation) + { + instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MINIMUM_DISTANCE, OverrideMinDistance); + instance.setProperty(FMOD.Studio.EVENT_PROPERTY.MAXIMUM_DISTANCE, OverrideMaxDistance); + } + + instance.start(); + + hasTriggered = true; + } + + public void Stop() + { + if (instance.isValid()) + { + instance.stop(AllowFadeout ? FMOD.Studio.STOP_MODE.ALLOWFADEOUT : FMOD.Studio.STOP_MODE.IMMEDIATE); + instance.release(); + instance.clearHandle(); + } + } + + public void SetParameter(string name, float value, bool ignoreseekspeed = false) + { + if (instance.isValid()) + { + instance.setParameterByName(name, value, ignoreseekspeed); + } + } + + public void SetParameter(FMOD.Studio.PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + if (instance.isValid()) + { + instance.setParameterByID(id, value, ignoreseekspeed); + } + } + + public bool IsPlaying() + { + if (instance.isValid()) + { + FMOD.Studio.PLAYBACK_STATE playbackState; + instance.getPlaybackState(out playbackState); + return (playbackState != FMOD.Studio.PLAYBACK_STATE.STOPPED); + } + return false; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioEventEmitter.cs.meta b/Assets/Plugins/FMOD/src/Runtime/StudioEventEmitter.cs.meta new file mode 100644 index 0000000..0af7ae5 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioEventEmitter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 9a6610d2e704f1648819acc8d7460285 +timeCreated: 1444629021 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: -220 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioGlobalParameterTrigger.cs b/Assets/Plugins/FMOD/src/Runtime/StudioGlobalParameterTrigger.cs new file mode 100644 index 0000000..3d40ce8 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioGlobalParameterTrigger.cs @@ -0,0 +1,51 @@ +using System; +using UnityEngine; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Global Parameter Trigger")] + public class StudioGlobalParameterTrigger: EventHandler + { + [ParamRef] + public string parameter; + public EmitterGameEvent TriggerEvent; + public float value; + + private FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; + public FMOD.Studio.PARAMETER_DESCRIPTION ParameterDesctription { get { return parameterDescription; } } + + FMOD.RESULT Lookup() + { + FMOD.RESULT result = RuntimeManager.StudioSystem.getParameterDescriptionByName(parameter, out parameterDescription); + return result; + } + + void Awake() + { + if (string.IsNullOrEmpty(parameterDescription.name)) + { + Lookup(); + } + } + + protected override void HandleGameEvent(EmitterGameEvent gameEvent) + { + if (TriggerEvent == gameEvent) + { + TriggerParameters(); + } + } + + public void TriggerParameters() + { + if (!string.IsNullOrEmpty(parameter)) + { + FMOD.RESULT result = RuntimeManager.StudioSystem.setParameterByID(parameterDescription.id, value); + if (result != FMOD.RESULT.OK) + { + Debug.LogError(string.Format(("[FMOD] StudioGlobalParameterTrigger failed to set parameter {0} : result = {1}"), parameter, result)); + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioGlobalParameterTrigger.cs.meta b/Assets/Plugins/FMOD/src/Runtime/StudioGlobalParameterTrigger.cs.meta new file mode 100644 index 0000000..9fa665b --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioGlobalParameterTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b0e04e2572f9a940a47465f6f3c2f00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioListener.cs b/Assets/Plugins/FMOD/src/Runtime/StudioListener.cs new file mode 100644 index 0000000..bf17625 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioListener.cs @@ -0,0 +1,46 @@ +using UnityEngine; + +namespace FMODUnity +{ + [AddComponentMenu("FMOD Studio/FMOD Studio Listener")] + public class StudioListener : MonoBehaviour + { + Rigidbody rigidBody; + Rigidbody2D rigidBody2D; + + public int ListenerNumber = -1; + + void OnEnable() + { + RuntimeUtils.EnforceLibraryOrder(); + rigidBody = gameObject.GetComponent(); + rigidBody2D = gameObject.GetComponent(); + ListenerNumber = RuntimeManager.AddListener(this); + } + + void OnDisable() + { + RuntimeManager.RemoveListener(this); + } + + void Update() + { + if (ListenerNumber >= 0 && ListenerNumber < FMOD.CONSTANTS.MAX_LISTENERS) + { + SetListenerLocation(); + } + } + + void SetListenerLocation() + { + if (rigidBody) + { + RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody); + } + else + { + RuntimeManager.SetListenerLocation(ListenerNumber, gameObject, rigidBody2D); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioListener.cs.meta b/Assets/Plugins/FMOD/src/Runtime/StudioListener.cs.meta new file mode 100644 index 0000000..73b729a --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioListener.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 86c6556701af9e04380698b89f691b6e +timeCreated: 1449016511 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 80 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioParameterTrigger.cs b/Assets/Plugins/FMOD/src/Runtime/StudioParameterTrigger.cs new file mode 100644 index 0000000..478ddbf --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioParameterTrigger.cs @@ -0,0 +1,62 @@ +using System; +using UnityEngine; + +namespace FMODUnity +{ + [Serializable] + public class EmitterRef + { + public StudioEventEmitter Target; + public ParamRef[] Params; + } + + [AddComponentMenu("FMOD Studio/FMOD Studio Parameter Trigger")] + public class StudioParameterTrigger: EventHandler + { + public EmitterRef[] Emitters; + public EmitterGameEvent TriggerEvent; + + void Awake() + { + for (int i = 0; i < Emitters.Length; i++) + { + var emitterRef = Emitters[i]; + if (emitterRef.Target != null && !string.IsNullOrEmpty(emitterRef.Target.Event)) + { + FMOD.Studio.EventDescription eventDesc = FMODUnity.RuntimeManager.GetEventDescription(emitterRef.Target.Event); + if (eventDesc.isValid()) + { + for (int j = 0; j < Emitters[i].Params.Length; j++) + { + FMOD.Studio.PARAMETER_DESCRIPTION param; + eventDesc.getParameterDescriptionByName(emitterRef.Params[j].Name, out param); + emitterRef.Params[j].ID = param.id; + } + } + } + } + } + protected override void HandleGameEvent(EmitterGameEvent gameEvent) + { + if (TriggerEvent == gameEvent) + { + TriggerParameters(); + } + } + + public void TriggerParameters() + { + for (int i = 0; i < Emitters.Length; i++) + { + var emitterRef = Emitters[i]; + if (emitterRef.Target != null && emitterRef.Target.EventInstance.isValid()) + { + for (int j = 0; j < Emitters[i].Params.Length; j++) + { + emitterRef.Target.EventInstance.setParameterByID(Emitters[i].Params[j].ID, Emitters[i].Params[j].Value); + } + } + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/StudioParameterTrigger.cs.meta b/Assets/Plugins/FMOD/src/Runtime/StudioParameterTrigger.cs.meta new file mode 100644 index 0000000..7ac567a --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/StudioParameterTrigger.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 744a208c85da6d04c861d81b992e4ead +timeCreated: 1451968823 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/Timeline.meta b/Assets/Plugins/FMOD/src/Runtime/Timeline.meta new file mode 100644 index 0000000..9a00bf5 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Timeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30aaa31bf04730941a12542740281e72 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventPlayable.cs b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventPlayable.cs new file mode 100644 index 0000000..3975679 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventPlayable.cs @@ -0,0 +1,200 @@ +#if (UNITY_TIMELINE_EXIST || !UNITY_2019_1_OR_NEWER) + +using System; +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +[System.Serializable] +public class FMODEventPlayable : PlayableAsset, ITimelineClipAsset +{ + public FMODEventPlayableBehavior template = new FMODEventPlayableBehavior(); + + public GameObject TrackTargetObject { get; set; } + public float eventLength; //In seconds. + + FMODEventPlayableBehavior behavior; + + [FMODUnity.EventRef] + [SerializeField] public string eventName; + [SerializeField] public STOP_MODE stopType; + + [SerializeField] public FMODUnity.ParamRef[] parameters = new FMODUnity.ParamRef[0]; + + [NonSerialized] public bool cachedParameters = false; + + public override double duration + { + get + { + if (eventName == null) + { + return base.duration; + } + else + { + return eventLength; + } + } + } + + public ClipCaps clipCaps + { + get { return ClipCaps.None; } + } + + public TimelineClip OwningClip { get; set; } + + public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) + { +#if UNITY_EDITOR + if (!string.IsNullOrEmpty(eventName)) +#else + if (!cachedParameters && !string.IsNullOrEmpty(eventName)) +#endif + { + FMOD.Studio.EventDescription eventDescription; + FMODUnity.RuntimeManager.StudioSystem.getEvent(eventName, out eventDescription); + for (int i = 0; i < parameters.Length; i++) + { + FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription; + eventDescription.getParameterDescriptionByName(parameters[i].Name, out parameterDescription); + parameters[i].ID = parameterDescription.id; + } + cachedParameters = true; + } + + var playable = ScriptPlayable.Create(graph, template); + behavior = playable.GetBehaviour(); + + behavior.TrackTargetObject = TrackTargetObject; + behavior.eventName = eventName; + behavior.stopType = stopType; + behavior.parameters = parameters; + behavior.OwningClip = OwningClip; + + return playable; + } + +#if UNITY_EDITOR + public void UpdateEventDuration(float duration) + { + eventLength = duration / 1000f; + } + + public void OnValidate() + { + if (OwningClip != null && !string.IsNullOrEmpty(eventName)) + { + int index = eventName.LastIndexOf("/"); + OwningClip.displayName = eventName.Substring(index + 1); + } + if (behavior != null && !string.IsNullOrEmpty(behavior.eventName)) + { + behavior.eventName = eventName; + } + } +#endif //UNITY_EDITOR +} + +public enum STOP_MODE : int +{ + AllowFadeout, + Immediate, + None +} + +public class FMODEventPlayableBehavior : PlayableBehaviour +{ + public string eventName; + public STOP_MODE stopType = STOP_MODE.AllowFadeout; + public FMODUnity.ParamRef[] parameters = new FMODUnity.ParamRef[0]; + + public GameObject TrackTargetObject; + public TimelineClip OwningClip; + + private bool isPlayheadInside = false; + + private FMOD.Studio.EventInstance eventInstance; + + protected void PlayEvent() + { + if (!string.IsNullOrEmpty(eventName)) + { + eventInstance = FMODUnity.RuntimeManager.CreateInstance(eventName); + // Only attach to object if the game is actually playing, not auditioning. + if (Application.isPlaying && TrackTargetObject) + { + Rigidbody rb = TrackTargetObject.GetComponent(); + if (rb) + { + FMODUnity.RuntimeManager.AttachInstanceToGameObject(eventInstance, TrackTargetObject.transform, rb); + } + else + { + FMODUnity.RuntimeManager.AttachInstanceToGameObject(eventInstance, TrackTargetObject.transform, TrackTargetObject.GetComponent()); + } + } + else + { + eventInstance.set3DAttributes(FMODUnity.RuntimeUtils.To3DAttributes(Vector3.zero)); + } + + foreach (var param in parameters) + { + eventInstance.setParameterByID(param.ID, param.Value); + } + + eventInstance.start(); + } + } + + public void OnEnter() + { + if (!isPlayheadInside) + { + PlayEvent(); + isPlayheadInside = true; + } + } + + public void OnExit() + { + if (isPlayheadInside) + { + if (eventInstance.isValid()) + { + if (stopType != STOP_MODE.None) + { + eventInstance.stop(stopType == STOP_MODE.Immediate ? FMOD.Studio.STOP_MODE.IMMEDIATE : FMOD.Studio.STOP_MODE.ALLOWFADEOUT); + } + eventInstance.release(); + } + isPlayheadInside = false; + } + } + + public void UpdateBehaviour(float time) + { + if ((time >= OwningClip.start) && (time < OwningClip.end)) + { + OnEnter(); + } + else + { + OnExit(); + } + } + + public override void OnGraphStop(Playable playable) + { + isPlayheadInside = false; + if (eventInstance.isValid()) + { + eventInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE); + eventInstance.release(); + FMODUnity.RuntimeManager.StudioSystem.update(); + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventPlayable.cs.meta b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventPlayable.cs.meta new file mode 100644 index 0000000..f94335c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventPlayable.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 987a467495df9d942b56b1b51381d095 +timeCreated: 1523230466 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 392af304825cbe847bbf4e603852e4dd, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventTrack.cs b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventTrack.cs new file mode 100644 index 0000000..7abb966 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventTrack.cs @@ -0,0 +1,71 @@ +#if (UNITY_TIMELINE_EXIST || !UNITY_2019_1_OR_NEWER) + +using UnityEngine; +using UnityEngine.Playables; +using UnityEngine.Timeline; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +[TrackColor(0.066f, 0.134f, 0.244f)] +[TrackClipType(typeof(FMODEventPlayable))] +[TrackBindingType(typeof(GameObject))] +public class FMODEventTrack : TrackAsset +{ + public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount) + { + var director = go.GetComponent(); + var trackTargetObject = director.GetGenericBinding(this) as GameObject; + + foreach (var clip in GetClips()) + { + var playableAsset = clip.asset as FMODEventPlayable; + + if (playableAsset) + { + playableAsset.TrackTargetObject = trackTargetObject; + playableAsset.OwningClip = clip; + } + } + + var scriptPlayable = ScriptPlayable.Create(graph, inputCount); + return scriptPlayable; + } +} + +public class FMODEventMixerBehaviour : PlayableBehaviour +{ + public override void ProcessFrame(Playable playable, FrameData info, object playerData) + { +#if UNITY_EDITOR + /* + * Process frame is called from OnGUI() when auditioning. + * Check playing to avoid retriggering sounds while scrubbing or repainting. + * Check IsQuitting to avoid accessing the RuntimeManager during the Play-In-Editor to Editor transition. + */ + bool playing = playable.GetGraph().IsPlaying(); + if (!playing) + { + return; + } + /* When auditioning manually update the StudioSystem in place of the RuntimeManager. */ + if (!Application.isPlaying) + { + FMODUnity.RuntimeManager.StudioSystem.update(); + } +#endif //UNITY_EDITOR + + int inputCount = playable.GetInputCount(); + float time = (float)playable.GetGraph().GetRootPlayable(0).GetTime(); + + for (int i = 0; i < inputCount; i++) + { + ScriptPlayable inputPlayable = (ScriptPlayable)playable.GetInput(i); + FMODEventPlayableBehavior input = inputPlayable.GetBehaviour(); + + input.UpdateBehaviour(time); + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventTrack.cs.meta b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventTrack.cs.meta new file mode 100644 index 0000000..52306db --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/Timeline/FMODEventTrack.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 133253f56854570409c222a87786b263 +timeCreated: 1523230466 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: a4edfa5854cdec34b98b1c55f0562bdd, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/fmodplugins.cpp b/Assets/Plugins/FMOD/src/Runtime/fmodplugins.cpp new file mode 100644 index 0000000..48f253d --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/fmodplugins.cpp @@ -0,0 +1,58 @@ +struct FMOD_SYSTEM; +struct FMOD_DSP_DESCRIPTION; + +extern "C" unsigned int FMOD5_System_RegisterDSP(FMOD_SYSTEM *system, const FMOD_DSP_DESCRIPTION *description, void *handle); + +extern FMOD_DSP_DESCRIPTION* FMOD_Google_GVRListener_GetDSPDescription(); +extern FMOD_DSP_DESCRIPTION* FMOD_Google_GVRSoundfield_GetDSPDescription(); +extern FMOD_DSP_DESCRIPTION* FMOD_Google_GVRSource_GetDSPDescription(); + +extern FMOD_DSP_DESCRIPTION* FMOD_ResonanceAudioListener_GetDSPDescription(); +extern FMOD_DSP_DESCRIPTION* FMOD_ResonanceAudioSoundfield_GetDSPDescription(); +extern FMOD_DSP_DESCRIPTION* FMOD_ResonanceAudioSource_GetDSPDescription(); + +extern "C" unsigned int FmodUnityNativePluginInit(FMOD_SYSTEM *system) +{ + unsigned int result = 0; + + /* + + This function is invoked on iOS and tvOS after the system has been + initialized and before any banks are loaded. It can be used to manually + register plugins that have been statically linked into the executable. + + Each plugin will require a separate call to FMOD_System_RegisterDSP. + The DSP_DESCRIPTION argument is the same as what is returned by + FMODGetDSPDescription when building a dynamic plugin. + + */ + + /* + result = FMOD5_System_RegisterDSP(system, GetMyDSPDescription(), nullptr); + if (result != 0) + { + return result; + } + */ + + /* Uncomment this next section to use the Resonance Audio plugin on iOS */ + /* + result = FMOD5_System_RegisterDSP(system, FMOD_ResonanceAudioListener_GetDSPDescription(), nullptr); + if (result != 0) + { + return result; + } + result = FMOD5_System_RegisterDSP(system, FMOD_ResonanceAudioSoundfield_GetDSPDescription(), nullptr); + if (result != 0) + { + return result; + } + result = FMOD5_System_RegisterDSP(system, FMOD_ResonanceAudioSource_GetDSPDescription(), nullptr); + if (result != 0) + { + return result; + } + */ + + return result; +} diff --git a/Assets/Plugins/FMOD/src/Runtime/fmodplugins.cpp.meta b/Assets/Plugins/FMOD/src/Runtime/fmodplugins.cpp.meta new file mode 100644 index 0000000..aec2c32 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/fmodplugins.cpp.meta @@ -0,0 +1,57 @@ +fileFormatVersion: 2 +guid: b609b2636c3bd40b6baa2df2e77d015e +timeCreated: 1466052174 +licenseType: Free +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + Linux: + enabled: 0 + settings: + CPU: x86 + Linux64: + enabled: 0 + settings: + CPU: x86_64 + OSXIntel: + enabled: 0 + settings: + CPU: AnyCPU + OSXIntel64: + enabled: 0 + settings: + CPU: AnyCPU + Win: + enabled: 0 + settings: + CPU: AnyCPU + Win64: + enabled: 0 + settings: + CPU: AnyCPU + iOS: + enabled: 1 + settings: + CompileFlags: + FrameworkDependencies: + tvOS: + enabled: 1 + settings: {} + Switch: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper.meta b/Assets/Plugins/FMOD/src/Runtime/wrapper.meta new file mode 100644 index 0000000..e34b295 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: bfaed09c888d2a24096887e3996f48a0 +folderAsset: yes +timeCreated: 1432600460 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs new file mode 100644 index 0000000..b00240f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs @@ -0,0 +1,3794 @@ +/* ======================================================================================== */ +/* FMOD Core API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2020. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Generic; + +namespace FMOD +{ + /* + FMOD version number. Check this against FMOD::System::getVersion / System_GetVersion + 0xaaaabbcc -> aaaa = major version number. bb = minor version number. cc = development version number. + */ + public class VERSION + { + public const int number = 0x00020015; +#if (UNITY_IPHONE || UNITY_TVOS || UNITY_SWITCH || UNITY_WEBGL) && !UNITY_EDITOR + public const string dll = "__Internal"; +#elif (UNITY_PS4) && DEVELOPMENT_BUILD + public const string dll = "libfmodL"; +#elif (UNITY_PS4) && !UNITY_EDITOR + public const string dll = "libfmod"; +#elif (UNITY_PSP2) && !UNITY_EDITOR + public const string dll = "libfmodstudio"; +#elif ((UNITY_WSA || UNITY_ANDROID || UNITY_XBOXONE || UNITY_STADIA) && DEVELOPMENT_BUILD) + public const string dll = "fmodL"; +#elif (UNITY_EDITOR) || (UNITY_STANDALONE && DEVELOPMENT_BUILD) + public const string dll = "fmodstudioL"; +#elif (UNITY_STANDALONE) + public const string dll = "fmodstudio"; +#else + public const string dll = "fmod"; +#endif + } + + public class CONSTANTS + { + public const int MAX_CHANNEL_WIDTH = 32; + public const int MAX_LISTENERS = 8; + public const int REVERB_MAXINSTANCES = 4; + public const int MAX_SYSTEMS = 8; + } + + /* + FMOD core types + */ + public enum RESULT : int + { + OK, + ERR_BADCOMMAND, + ERR_CHANNEL_ALLOC, + ERR_CHANNEL_STOLEN, + ERR_DMA, + ERR_DSP_CONNECTION, + ERR_DSP_DONTPROCESS, + ERR_DSP_FORMAT, + ERR_DSP_INUSE, + ERR_DSP_NOTFOUND, + ERR_DSP_RESERVED, + ERR_DSP_SILENCE, + ERR_DSP_TYPE, + ERR_FILE_BAD, + ERR_FILE_COULDNOTSEEK, + ERR_FILE_DISKEJECTED, + ERR_FILE_EOF, + ERR_FILE_ENDOFDATA, + ERR_FILE_NOTFOUND, + ERR_FORMAT, + ERR_HEADER_MISMATCH, + ERR_HTTP, + ERR_HTTP_ACCESS, + ERR_HTTP_PROXY_AUTH, + ERR_HTTP_SERVER_ERROR, + ERR_HTTP_TIMEOUT, + ERR_INITIALIZATION, + ERR_INITIALIZED, + ERR_INTERNAL, + ERR_INVALID_FLOAT, + ERR_INVALID_HANDLE, + ERR_INVALID_PARAM, + ERR_INVALID_POSITION, + ERR_INVALID_SPEAKER, + ERR_INVALID_SYNCPOINT, + ERR_INVALID_THREAD, + ERR_INVALID_VECTOR, + ERR_MAXAUDIBLE, + ERR_MEMORY, + ERR_MEMORY_CANTPOINT, + ERR_NEEDS3D, + ERR_NEEDSHARDWARE, + ERR_NET_CONNECT, + ERR_NET_SOCKET_ERROR, + ERR_NET_URL, + ERR_NET_WOULD_BLOCK, + ERR_NOTREADY, + ERR_OUTPUT_ALLOCATED, + ERR_OUTPUT_CREATEBUFFER, + ERR_OUTPUT_DRIVERCALL, + ERR_OUTPUT_FORMAT, + ERR_OUTPUT_INIT, + ERR_OUTPUT_NODRIVERS, + ERR_PLUGIN, + ERR_PLUGIN_MISSING, + ERR_PLUGIN_RESOURCE, + ERR_PLUGIN_VERSION, + ERR_RECORD, + ERR_REVERB_CHANNELGROUP, + ERR_REVERB_INSTANCE, + ERR_SUBSOUNDS, + ERR_SUBSOUND_ALLOCATED, + ERR_SUBSOUND_CANTMOVE, + ERR_TAGNOTFOUND, + ERR_TOOMANYCHANNELS, + ERR_TRUNCATED, + ERR_UNIMPLEMENTED, + ERR_UNINITIALIZED, + ERR_UNSUPPORTED, + ERR_VERSION, + ERR_EVENT_ALREADY_LOADED, + ERR_EVENT_LIVEUPDATE_BUSY, + ERR_EVENT_LIVEUPDATE_MISMATCH, + ERR_EVENT_LIVEUPDATE_TIMEOUT, + ERR_EVENT_NOTFOUND, + ERR_STUDIO_UNINITIALIZED, + ERR_STUDIO_NOT_LOADED, + ERR_INVALID_STRING, + ERR_ALREADY_LOCKED, + ERR_NOT_LOCKED, + ERR_RECORD_DISCONNECTED, + ERR_TOOMANYSAMPLES, + } + + public enum CHANNELCONTROL_TYPE : int + { + CHANNEL, + CHANNELGROUP, + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct VECTOR + { + public float x; + public float y; + public float z; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ATTRIBUTES_3D + { + public VECTOR position; + public VECTOR velocity; + public VECTOR forward; + public VECTOR up; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ASYNCREADINFO + { + public IntPtr handle; + public uint offset; + public uint sizebytes; + public int priority; + + public IntPtr userdata; + public IntPtr buffer; + public uint bytesread; + public FILE_ASYNCDONE_FUNC done; + } + + public enum OUTPUTTYPE : int + { + AUTODETECT, + + UNKNOWN, + NOSOUND, + WAVWRITER, + NOSOUND_NRT, + WAVWRITER_NRT, + + WASAPI, + ASIO, + PULSEAUDIO, + ALSA, + COREAUDIO, + AUDIOTRACK, + OPENSL, + AUDIOOUT, + AUDIO3D, + WEBAUDIO, + NNAUDIO, + WINSONIC, + AAUDIO, + + MAX, + } + + public enum DEBUG_MODE : int + { + TTY, + FILE, + CALLBACK, + } + + [Flags] + public enum DEBUG_FLAGS : uint + { + NONE = 0x00000000, + ERROR = 0x00000001, + WARNING = 0x00000002, + LOG = 0x00000004, + + TYPE_MEMORY = 0x00000100, + TYPE_FILE = 0x00000200, + TYPE_CODEC = 0x00000400, + TYPE_TRACE = 0x00000800, + + DISPLAY_TIMESTAMPS = 0x00010000, + DISPLAY_LINENUMBERS = 0x00020000, + DISPLAY_THREAD = 0x00040000, + } + + [Flags] + public enum MEMORY_TYPE : uint + { + NORMAL = 0x00000000, + STREAM_FILE = 0x00000001, + STREAM_DECODE = 0x00000002, + SAMPLEDATA = 0x00000004, + DSP_BUFFER = 0x00000008, + PLUGIN = 0x00000010, + PERSISTENT = 0x00200000, + ALL = 0xFFFFFFFF + } + + public enum SPEAKERMODE : int + { + DEFAULT, + RAW, + MONO, + STEREO, + QUAD, + SURROUND, + _5POINT1, + _7POINT1, + _7POINT1POINT4, + + MAX, + } + + public enum SPEAKER : int + { + NONE = -1, + FRONT_LEFT, + FRONT_RIGHT, + FRONT_CENTER, + LOW_FREQUENCY, + SURROUND_LEFT, + SURROUND_RIGHT, + BACK_LEFT, + BACK_RIGHT, + TOP_FRONT_LEFT, + TOP_FRONT_RIGHT, + TOP_BACK_LEFT, + TOP_BACK_RIGHT, + + MAX, + } + + [Flags] + public enum CHANNELMASK : uint + { + FRONT_LEFT = 0x00000001, + FRONT_RIGHT = 0x00000002, + FRONT_CENTER = 0x00000004, + LOW_FREQUENCY = 0x00000008, + SURROUND_LEFT = 0x00000010, + SURROUND_RIGHT = 0x00000020, + BACK_LEFT = 0x00000040, + BACK_RIGHT = 0x00000080, + BACK_CENTER = 0x00000100, + + MONO = (FRONT_LEFT), + STEREO = (FRONT_LEFT | FRONT_RIGHT), + LRC = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER), + QUAD = (FRONT_LEFT | FRONT_RIGHT | SURROUND_LEFT | SURROUND_RIGHT), + SURROUND = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT), + _5POINT1_REARS = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | BACK_RIGHT), + _7POINT0 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT), + _7POINT1 = (FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SURROUND_LEFT | SURROUND_RIGHT | BACK_LEFT | BACK_RIGHT) + } + + public enum CHANNELORDER : int + { + DEFAULT, + WAVEFORMAT, + PROTOOLS, + ALLMONO, + ALLSTEREO, + ALSA, + + MAX, + } + + public enum PLUGINTYPE : int + { + OUTPUT, + CODEC, + DSP, + + MAX, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGINLIST + { + PLUGINTYPE type; + IntPtr description; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + STREAM_FROM_UPDATE = 0x00000001, + MIX_FROM_UPDATE = 0x00000002, + _3D_RIGHTHANDED = 0x00000004, + CHANNEL_LOWPASS = 0x00000100, + CHANNEL_DISTANCEFILTER = 0x00000200, + PROFILE_ENABLE = 0x00010000, + VOL0_BECOMES_VIRTUAL = 0x00020000, + GEOMETRY_USECLOSEST = 0x00040000, + PREFER_DOLBY_DOWNMIX = 0x00080000, + THREAD_UNSAFE = 0x00100000, + PROFILE_METER_ALL = 0x00200000, + MEMORY_TRACKING = 0x00400000, + } + + public enum SOUND_TYPE : int + { + UNKNOWN, + AIFF, + ASF, + DLS, + FLAC, + FSB, + IT, + MIDI, + MOD, + MPEG, + OGGVORBIS, + PLAYLIST, + RAW, + S3M, + USER, + WAV, + XM, + XMA, + AUDIOQUEUE, + AT9, + VORBIS, + MEDIA_FOUNDATION, + MEDIACODEC, + FADPCM, + OPUS, + + MAX, + } + + public enum SOUND_FORMAT : int + { + NONE, + PCM8, + PCM16, + PCM24, + PCM32, + PCMFLOAT, + BITSTREAM, + + MAX + } + + [Flags] + public enum MODE : uint + { + DEFAULT = 0x00000000, + LOOP_OFF = 0x00000001, + LOOP_NORMAL = 0x00000002, + LOOP_BIDI = 0x00000004, + _2D = 0x00000008, + _3D = 0x00000010, + CREATESTREAM = 0x00000080, + CREATESAMPLE = 0x00000100, + CREATECOMPRESSEDSAMPLE = 0x00000200, + OPENUSER = 0x00000400, + OPENMEMORY = 0x00000800, + OPENMEMORY_POINT = 0x10000000, + OPENRAW = 0x00001000, + OPENONLY = 0x00002000, + ACCURATETIME = 0x00004000, + MPEGSEARCH = 0x00008000, + NONBLOCKING = 0x00010000, + UNIQUE = 0x00020000, + _3D_HEADRELATIVE = 0x00040000, + _3D_WORLDRELATIVE = 0x00080000, + _3D_INVERSEROLLOFF = 0x00100000, + _3D_LINEARROLLOFF = 0x00200000, + _3D_LINEARSQUAREROLLOFF = 0x00400000, + _3D_INVERSETAPEREDROLLOFF = 0x00800000, + _3D_CUSTOMROLLOFF = 0x04000000, + _3D_IGNOREGEOMETRY = 0x40000000, + IGNORETAGS = 0x02000000, + LOWMEM = 0x08000000, + VIRTUAL_PLAYFROMSTART = 0x80000000 + } + + public enum OPENSTATE : int + { + READY = 0, + LOADING, + ERROR, + CONNECTING, + BUFFERING, + SEEKING, + PLAYING, + SETPOSITION, + + MAX, + } + + public enum SOUNDGROUP_BEHAVIOR : int + { + BEHAVIOR_FAIL, + BEHAVIOR_MUTE, + BEHAVIOR_STEALLOWEST, + + MAX, + } + + public enum CHANNELCONTROL_CALLBACK_TYPE : int + { + END, + VIRTUALVOICE, + SYNCPOINT, + OCCLUSION, + + MAX, + } + + public struct CHANNELCONTROL_DSP_INDEX + { + public const int HEAD = -1; + public const int FADER = -2; + public const int TAIL = -3; + } + + public enum ERRORCALLBACK_INSTANCETYPE : int + { + NONE, + SYSTEM, + CHANNEL, + CHANNELGROUP, + CHANNELCONTROL, + SOUND, + SOUNDGROUP, + DSP, + DSPCONNECTION, + GEOMETRY, + REVERB3D, + STUDIO_SYSTEM, + STUDIO_EVENTDESCRIPTION, + STUDIO_EVENTINSTANCE, + STUDIO_PARAMETERINSTANCE, + STUDIO_BUS, + STUDIO_VCA, + STUDIO_BANK, + STUDIO_COMMANDREPLAY + } + + [StructLayout(LayoutKind.Sequential)] + public struct ERRORCALLBACK_INFO + { + public RESULT result; + public ERRORCALLBACK_INSTANCETYPE instancetype; + public IntPtr instance; + public StringWrapper functionname; + public StringWrapper functionparams; + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + DEVICELISTCHANGED = 0x00000001, + DEVICELOST = 0x00000002, + MEMORYALLOCATIONFAILED = 0x00000004, + THREADCREATED = 0x00000008, + BADDSPCONNECTION = 0x00000010, + PREMIX = 0x00000020, + POSTMIX = 0x00000040, + ERROR = 0x00000080, + MIDMIX = 0x00000100, + THREADDESTROYED = 0x00000200, + PREUPDATE = 0x00000400, + POSTUPDATE = 0x00000800, + RECORDLISTCHANGED = 0x00001000, + ALL = 0xFFFFFFFF, + } + + /* + FMOD Callbacks + */ + public delegate RESULT DEBUG_CALLBACK (DEBUG_FLAGS flags, StringWrapper file, int line, StringWrapper func, StringWrapper message); + public delegate RESULT SYSTEM_CALLBACK (IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata1, IntPtr commanddata2, IntPtr userdata); + public delegate RESULT CHANNELCONTROL_CALLBACK(IntPtr channelcontrol, CHANNELCONTROL_TYPE controltype, CHANNELCONTROL_CALLBACK_TYPE callbacktype, IntPtr commanddata1, IntPtr commanddata2); + public delegate RESULT SOUND_NONBLOCK_CALLBACK (IntPtr sound, RESULT result); + public delegate RESULT SOUND_PCMREAD_CALLBACK (IntPtr sound, IntPtr data, uint datalen); + public delegate RESULT SOUND_PCMSETPOS_CALLBACK (IntPtr sound, int subsound, uint position, TIMEUNIT postype); + public delegate RESULT FILE_OPEN_CALLBACK (StringWrapper name, ref uint filesize, ref IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_CLOSE_CALLBACK (IntPtr handle, IntPtr userdata); + public delegate RESULT FILE_READ_CALLBACK (IntPtr handle, IntPtr buffer, uint sizebytes, ref uint bytesread, IntPtr userdata); + public delegate RESULT FILE_SEEK_CALLBACK (IntPtr handle, uint pos, IntPtr userdata); + public delegate RESULT FILE_ASYNCREAD_CALLBACK (IntPtr info, IntPtr userdata); + public delegate RESULT FILE_ASYNCCANCEL_CALLBACK(IntPtr info, IntPtr userdata); + public delegate RESULT FILE_ASYNCDONE_FUNC (IntPtr info, RESULT result); + public delegate IntPtr MEMORY_ALLOC_CALLBACK (uint size, MEMORY_TYPE type, StringWrapper sourcestr); + public delegate IntPtr MEMORY_REALLOC_CALLBACK (IntPtr ptr, uint size, MEMORY_TYPE type, StringWrapper sourcestr); + public delegate void MEMORY_FREE_CALLBACK (IntPtr ptr, MEMORY_TYPE type, StringWrapper sourcestr); + public delegate float CB_3D_ROLLOFF_CALLBACK (IntPtr channelcontrol, float distance); + + public enum DSP_RESAMPLER : int + { + DEFAULT, + NOINTERP, + LINEAR, + CUBIC, + SPLINE, + + MAX, + } + + public enum DSPCONNECTION_TYPE : int + { + STANDARD, + SIDECHAIN, + SEND, + SEND_SIDECHAIN, + + MAX, + } + + public enum TAGTYPE : int + { + UNKNOWN = 0, + ID3V1, + ID3V2, + VORBISCOMMENT, + SHOUTCAST, + ICECAST, + ASF, + MIDI, + PLAYLIST, + FMOD, + USER, + + MAX + } + + public enum TAGDATATYPE : int + { + BINARY = 0, + INT, + FLOAT, + STRING, + STRING_UTF16, + STRING_UTF16BE, + STRING_UTF8, + + MAX + } + + [StructLayout(LayoutKind.Sequential)] + public struct TAG + { + public TAGTYPE type; + public TAGDATATYPE datatype; + public StringWrapper name; + public IntPtr data; + public uint datalen; + public bool updated; + } + + [Flags] + public enum TIMEUNIT : uint + { + MS = 0x00000001, + PCM = 0x00000002, + PCMBYTES = 0x00000004, + RAWBYTES = 0x00000008, + PCMFRACTION = 0x00000010, + MODORDER = 0x00000100, + MODROW = 0x00000200, + MODPATTERN = 0x00000400, + } + + public struct PORT_INDEX + { + public const ulong NONE = 0xFFFFFFFFFFFFFFFF; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CREATESOUNDEXINFO + { + public int cbsize; + public uint length; + public uint fileoffset; + public int numchannels; + public int defaultfrequency; + public SOUND_FORMAT format; + public uint decodebuffersize; + public int initialsubsound; + public int numsubsounds; + public IntPtr inclusionlist; + public int inclusionlistnum; + public SOUND_PCMREAD_CALLBACK pcmreadcallback; + public SOUND_PCMSETPOS_CALLBACK pcmsetposcallback; + public SOUND_NONBLOCK_CALLBACK nonblockcallback; + public IntPtr dlsname; + public IntPtr encryptionkey; + public int maxpolyphony; + public IntPtr userdata; + public SOUND_TYPE suggestedsoundtype; + public FILE_OPEN_CALLBACK fileuseropen; + public FILE_CLOSE_CALLBACK fileuserclose; + public FILE_READ_CALLBACK fileuserread; + public FILE_SEEK_CALLBACK fileuserseek; + public FILE_ASYNCREAD_CALLBACK fileuserasyncread; + public FILE_ASYNCCANCEL_CALLBACK fileuserasynccancel; + public IntPtr fileuserdata; + public int filebuffersize; + public CHANNELORDER channelorder; + public IntPtr initialsoundgroup; + public uint initialseekposition; + public TIMEUNIT initialseekpostype; + public int ignoresetfilesystem; + public uint audioqueuepolicy; + public uint minmidigranularity; + public int nonblockthreadid; + public IntPtr fsbguid; + } + +#pragma warning disable 414 + [StructLayout(LayoutKind.Sequential)] + public struct REVERB_PROPERTIES + { + public float DecayTime; + public float EarlyDelay; + public float LateDelay; + public float HFReference; + public float HFDecayRatio; + public float Diffusion; + public float Density; + public float LowShelfFrequency; + public float LowShelfGain; + public float HighCut; + public float EarlyLateMix; + public float WetLevel; + + #region wrapperinternal + public REVERB_PROPERTIES(float decayTime, float earlyDelay, float lateDelay, float hfReference, + float hfDecayRatio, float diffusion, float density, float lowShelfFrequency, float lowShelfGain, + float highCut, float earlyLateMix, float wetLevel) + { + DecayTime = decayTime; + EarlyDelay = earlyDelay; + LateDelay = lateDelay; + HFReference = hfReference; + HFDecayRatio = hfDecayRatio; + Diffusion = diffusion; + Density = density; + LowShelfFrequency = lowShelfFrequency; + LowShelfGain = lowShelfGain; + HighCut = highCut; + EarlyLateMix = earlyLateMix; + WetLevel = wetLevel; + } + #endregion + } +#pragma warning restore 414 + + public class PRESET + { + /* Instance Env Diffus Room RoomHF RmLF DecTm DecHF DecLF Refl RefDel Revb RevDel ModTm ModDp HFRef LFRef Diffus Densty FLAGS */ + public static REVERB_PROPERTIES OFF() { return new REVERB_PROPERTIES( 1000, 7, 11, 5000, 100, 100, 100, 250, 0, 20, 96, -80.0f );} + public static REVERB_PROPERTIES GENERIC() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 83, 100, 100, 250, 0, 14500, 96, -8.0f );} + public static REVERB_PROPERTIES PADDEDCELL() { return new REVERB_PROPERTIES( 170, 1, 2, 5000, 10, 100, 100, 250, 0, 160, 84, -7.8f );} + public static REVERB_PROPERTIES ROOM() { return new REVERB_PROPERTIES( 400, 2, 3, 5000, 83, 100, 100, 250, 0, 6050, 88, -9.4f );} + public static REVERB_PROPERTIES BATHROOM() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 54, 100, 60, 250, 0, 2900, 83, 0.5f );} + public static REVERB_PROPERTIES LIVINGROOM() { return new REVERB_PROPERTIES( 500, 3, 4, 5000, 10, 100, 100, 250, 0, 160, 58, -19.0f );} + public static REVERB_PROPERTIES STONEROOM() { return new REVERB_PROPERTIES( 2300, 12, 17, 5000, 64, 100, 100, 250, 0, 7800, 71, -8.5f );} + public static REVERB_PROPERTIES AUDITORIUM() { return new REVERB_PROPERTIES( 4300, 20, 30, 5000, 59, 100, 100, 250, 0, 5850, 64, -11.7f );} + public static REVERB_PROPERTIES CONCERTHALL() { return new REVERB_PROPERTIES( 3900, 20, 29, 5000, 70, 100, 100, 250, 0, 5650, 80, -9.8f );} + public static REVERB_PROPERTIES CAVE() { return new REVERB_PROPERTIES( 2900, 15, 22, 5000, 100, 100, 100, 250, 0, 20000, 59, -11.3f );} + public static REVERB_PROPERTIES ARENA() { return new REVERB_PROPERTIES( 7200, 20, 30, 5000, 33, 100, 100, 250, 0, 4500, 80, -9.6f );} + public static REVERB_PROPERTIES HANGAR() { return new REVERB_PROPERTIES( 10000, 20, 30, 5000, 23, 100, 100, 250, 0, 3400, 72, -7.4f );} + public static REVERB_PROPERTIES CARPETTEDHALLWAY() { return new REVERB_PROPERTIES( 300, 2, 30, 5000, 10, 100, 100, 250, 0, 500, 56, -24.0f );} + public static REVERB_PROPERTIES HALLWAY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 59, 100, 100, 250, 0, 7800, 87, -5.5f );} + public static REVERB_PROPERTIES STONECORRIDOR() { return new REVERB_PROPERTIES( 270, 13, 20, 5000, 79, 100, 100, 250, 0, 9000, 86, -6.0f );} + public static REVERB_PROPERTIES ALLEY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 86, 100, 100, 250, 0, 8300, 80, -9.8f );} + public static REVERB_PROPERTIES FOREST() { return new REVERB_PROPERTIES( 1500, 162, 88, 5000, 54, 79, 100, 250, 0, 760, 94, -12.3f );} + public static REVERB_PROPERTIES CITY() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 67, 50, 100, 250, 0, 4050, 66, -26.0f );} + public static REVERB_PROPERTIES MOUNTAINS() { return new REVERB_PROPERTIES( 1500, 300, 100, 5000, 21, 27, 100, 250, 0, 1220, 82, -24.0f );} + public static REVERB_PROPERTIES QUARRY() { return new REVERB_PROPERTIES( 1500, 61, 25, 5000, 83, 100, 100, 250, 0, 3400, 100, -5.0f );} + public static REVERB_PROPERTIES PLAIN() { return new REVERB_PROPERTIES( 1500, 179, 100, 5000, 50, 21, 100, 250, 0, 1670, 65, -28.0f );} + public static REVERB_PROPERTIES PARKINGLOT() { return new REVERB_PROPERTIES( 1700, 8, 12, 5000, 100, 100, 100, 250, 0, 20000, 56, -19.5f );} + public static REVERB_PROPERTIES SEWERPIPE() { return new REVERB_PROPERTIES( 2800, 14, 21, 5000, 14, 80, 60, 250, 0, 3400, 66, 1.2f );} + public static REVERB_PROPERTIES UNDERWATER() { return new REVERB_PROPERTIES( 1500, 7, 11, 5000, 10, 100, 100, 250, 0, 500, 92, 7.0f );} + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbSize; + public int maxMPEGCodecs; + public int maxADPCMCodecs; + public int maxXMACodecs; + public int maxVorbisCodecs; + public int maxAT9Codecs; + public int maxFADPCMCodecs; + public int maxPCMCodecs; + public int ASIONumChannels; + public IntPtr ASIOChannelList; + public IntPtr ASIOSpeakerList; + public float vol0virtualvol; + public uint defaultDecodeBufferSize; + public ushort profilePort; + public uint geometryMaxFadeTime; + public float distanceFilterCenterFreq; + public int reverb3Dinstance; + public int DSPBufferPoolSize; + public uint stackSizeStream; + public uint stackSizeNonBlocking; + public uint stackSizeMixer; + public DSP_RESAMPLER resamplerMethod; + public uint commandQueueSize; + public uint randomSeed; + } + + [Flags] + public enum DRIVER_STATE : uint + { + CONNECTED = 0x00000001, + DEFAULT = 0x00000002, + } + + /* + FMOD System factory functions. Use this to create an FMOD System Instance. below you will see System init/close to get started. + */ + public struct Factory + { + public static RESULT System_Create(out System system) + { + return FMOD5_System_Create(out system.handle); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Create(out IntPtr system); + + #endregion + } + + /* + FMOD global system functions (optional). + */ + public struct Memory + { + public static RESULT Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags = MEMORY_TYPE.ALL) + { + return FMOD5_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); + } + + public static RESULT GetStats(out int currentalloced, out int maxalloced, bool blocking = true) + { + return FMOD5_Memory_GetStats(out currentalloced, out maxalloced, blocking); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_Initialize(IntPtr poolmem, int poollen, MEMORY_ALLOC_CALLBACK useralloc, MEMORY_REALLOC_CALLBACK userrealloc, MEMORY_FREE_CALLBACK userfree, MEMORY_TYPE memtypeflags); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Memory_GetStats (out int currentalloced, out int maxalloced, bool blocking); + + #endregion + } + + public struct Debug + { + public static RESULT Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode = DEBUG_MODE.TTY, DEBUG_CALLBACK callback = null, string filename = null) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Debug_Initialize(flags, mode, callback, encoder.byteFromStringUTF8(filename)); + } + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Debug_Initialize(DEBUG_FLAGS flags, DEBUG_MODE mode, DEBUG_CALLBACK callback, byte[] filename); + + #endregion + } + + /* + 'System' API. + */ + public struct System + { + public RESULT release() + { + return FMOD5_System_Release(this.handle); + } + + // Setup functions. + public RESULT setOutput(OUTPUTTYPE output) + { + return FMOD5_System_SetOutput(this.handle, output); + } + public RESULT getOutput(out OUTPUTTYPE output) + { + return FMOD5_System_GetOutput(this.handle, out output); + } + public RESULT getNumDrivers(out int numdrivers) + { + return FMOD5_System_GetNumDrivers(this.handle, out numdrivers); + } + public RESULT getDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels); + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + name = encoding.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels) + { + return FMOD5_System_GetDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels); + } + public RESULT setDriver(int driver) + { + return FMOD5_System_SetDriver(this.handle, driver); + } + public RESULT getDriver(out int driver) + { + return FMOD5_System_GetDriver(this.handle, out driver); + } + public RESULT setSoftwareChannels(int numsoftwarechannels) + { + return FMOD5_System_SetSoftwareChannels(this.handle, numsoftwarechannels); + } + public RESULT getSoftwareChannels(out int numsoftwarechannels) + { + return FMOD5_System_GetSoftwareChannels(this.handle, out numsoftwarechannels); + } + public RESULT setSoftwareFormat(int samplerate, SPEAKERMODE speakermode, int numrawspeakers) + { + return FMOD5_System_SetSoftwareFormat(this.handle, samplerate, speakermode, numrawspeakers); + } + public RESULT getSoftwareFormat(out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers) + { + return FMOD5_System_GetSoftwareFormat(this.handle, out samplerate, out speakermode, out numrawspeakers); + } + public RESULT setDSPBufferSize(uint bufferlength, int numbuffers) + { + return FMOD5_System_SetDSPBufferSize(this.handle, bufferlength, numbuffers); + } + public RESULT getDSPBufferSize(out uint bufferlength, out int numbuffers) + { + return FMOD5_System_GetDSPBufferSize(this.handle, out bufferlength, out numbuffers); + } + public RESULT setFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign) + { + return FMOD5_System_SetFileSystem(this.handle, useropen, userclose, userread, userseek, userasyncread, userasynccancel, blockalign); + } + public RESULT attachFileSystem(FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek) + { + return FMOD5_System_AttachFileSystem(this.handle, useropen, userclose, userread, userseek); + } + public RESULT setAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = Marshal.SizeOf(settings); + return FMOD5_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT getAdvancedSettings(ref ADVANCEDSETTINGS settings) + { + settings.cbSize = Marshal.SizeOf(settings); + return FMOD5_System_GetAdvancedSettings(this.handle, ref settings); + } + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD5_System_SetCallback(this.handle, callback, callbackmask); + } + + // Plug-in support. + public RESULT setPluginPath(string path) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetPluginPath(this.handle, encoder.byteFromStringUTF8(path)); + } + } + public RESULT loadPlugin(string filename, out uint handle, uint priority = 0) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_LoadPlugin(this.handle, encoder.byteFromStringUTF8(filename), out handle, priority); + } + } + public RESULT unloadPlugin(uint handle) + { + return FMOD5_System_UnloadPlugin(this.handle, handle); + } + public RESULT getNumNestedPlugins(uint handle, out int count) + { + return FMOD5_System_GetNumNestedPlugins(this.handle, handle, out count); + } + public RESULT getNestedPlugin(uint handle, int index, out uint nestedhandle) + { + return FMOD5_System_GetNestedPlugin(this.handle, handle, index, out nestedhandle); + } + public RESULT getNumPlugins(PLUGINTYPE plugintype, out int numplugins) + { + return FMOD5_System_GetNumPlugins(this.handle, plugintype, out numplugins); + } + public RESULT getPluginHandle(PLUGINTYPE plugintype, int index, out uint handle) + { + return FMOD5_System_GetPluginHandle(this.handle, plugintype, index, out handle); + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out string name, int namelen, out uint version) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, stringMem, namelen, out version); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getPluginInfo(uint handle, out PLUGINTYPE plugintype, out uint version) + { + return FMOD5_System_GetPluginInfo(this.handle, handle, out plugintype, IntPtr.Zero, 0, out version); + } + public RESULT setOutputByPlugin(uint handle) + { + return FMOD5_System_SetOutputByPlugin(this.handle, handle); + } + public RESULT getOutputByPlugin(out uint handle) + { + return FMOD5_System_GetOutputByPlugin(this.handle, out handle); + } + public RESULT createDSPByPlugin(uint handle, out DSP dsp) + { + return FMOD5_System_CreateDSPByPlugin(this.handle, handle, out dsp.handle); + } + public RESULT getDSPInfoByPlugin(uint handle, out IntPtr description) + { + return FMOD5_System_GetDSPInfoByPlugin(this.handle, handle, out description); + } + /* + public RESULT registerCodec (ref CODEC_DESCRIPTION description, out uint handle, uint priority) + public RESULT registerCodec (ref CODEC_DESCRIPTION description, out uint handle, uint priority = 0) + public RESULT registerCodec(ref CODEC_DESCRIPTION description, out uint handle, uint priority) + { + return FMOD5_System_RegisterCodec(this.handle, ref description, out handle, priority); + } + */ + public RESULT registerDSP(ref DSP_DESCRIPTION description, out uint handle) + { + return FMOD5_System_RegisterDSP(this.handle, ref description, out handle); + } + /* + public RESULT registerOutput(ref OUTPUT_DESCRIPTION description, out uint handle) + { + return FMOD5_System_RegisterOutput(this.handle, ref description, out handle); + } + */ + + // Init/Close. + public RESULT init(int maxchannels, INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD5_System_Init(this.handle, maxchannels, flags, extradriverdata); + } + public RESULT close() + { + return FMOD5_System_Close(this.handle); + } + + // General post-init system functions. + public RESULT update() + { + return FMOD5_System_Update(this.handle); + } + public RESULT setSpeakerPosition(SPEAKER speaker, float x, float y, bool active) + { + return FMOD5_System_SetSpeakerPosition(this.handle, speaker, x, y, active); + } + public RESULT getSpeakerPosition(SPEAKER speaker, out float x, out float y, out bool active) + { + return FMOD5_System_GetSpeakerPosition(this.handle, speaker, out x, out y, out active); + } + public RESULT setStreamBufferSize(uint filebuffersize, TIMEUNIT filebuffersizetype) + { + return FMOD5_System_SetStreamBufferSize(this.handle, filebuffersize, filebuffersizetype); + } + public RESULT getStreamBufferSize(out uint filebuffersize, out TIMEUNIT filebuffersizetype) + { + return FMOD5_System_GetStreamBufferSize(this.handle, out filebuffersize, out filebuffersizetype); + } + public RESULT set3DSettings(float dopplerscale, float distancefactor, float rolloffscale) + { + return FMOD5_System_Set3DSettings(this.handle, dopplerscale, distancefactor, rolloffscale); + } + public RESULT get3DSettings(out float dopplerscale, out float distancefactor, out float rolloffscale) + { + return FMOD5_System_Get3DSettings(this.handle, out dopplerscale, out distancefactor, out rolloffscale); + } + public RESULT set3DNumListeners(int numlisteners) + { + return FMOD5_System_Set3DNumListeners(this.handle, numlisteners); + } + public RESULT get3DNumListeners(out int numlisteners) + { + return FMOD5_System_Get3DNumListeners(this.handle, out numlisteners); + } + public RESULT set3DListenerAttributes(int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up) + { + return FMOD5_System_Set3DListenerAttributes(this.handle, listener, ref pos, ref vel, ref forward, ref up); + } + public RESULT get3DListenerAttributes(int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up) + { + return FMOD5_System_Get3DListenerAttributes(this.handle, listener, out pos, out vel, out forward, out up); + } + public RESULT set3DRolloffCallback(CB_3D_ROLLOFF_CALLBACK callback) + { + return FMOD5_System_Set3DRolloffCallback(this.handle, callback); + } + public RESULT mixerSuspend() + { + return FMOD5_System_MixerSuspend(this.handle); + } + public RESULT mixerResume() + { + return FMOD5_System_MixerResume(this.handle); + } + public RESULT getDefaultMixMatrix(SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop) + { + return FMOD5_System_GetDefaultMixMatrix(this.handle, sourcespeakermode, targetspeakermode, matrix, matrixhop); + } + public RESULT getSpeakerModeChannels(SPEAKERMODE mode, out int channels) + { + return FMOD5_System_GetSpeakerModeChannels(this.handle, mode, out channels); + } + + // System information functions. + public RESULT getVersion(out uint version) + { + return FMOD5_System_GetVersion(this.handle, out version); + } + public RESULT getOutputHandle(out IntPtr handle) + { + return FMOD5_System_GetOutputHandle(this.handle, out handle); + } + public RESULT getChannelsPlaying(out int channels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, IntPtr.Zero); + } + public RESULT getChannelsPlaying(out int channels, out int realchannels) + { + return FMOD5_System_GetChannelsPlaying(this.handle, out channels, out realchannels); + } + public RESULT getCPUUsage(out float dsp, out float stream, out float geometry, out float update, out float total) + { + return FMOD5_System_GetCPUUsage(this.handle, out dsp, out stream, out geometry, out update, out total); + } + public RESULT getFileUsage(out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead) + { + return FMOD5_System_GetFileUsage(this.handle, out sampleBytesRead, out streamBytesRead, out otherBytesRead); + } + + // Sound/DSP/Channel/FX creation and retrieval. + public RESULT createSound(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSound(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createSound(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateSound(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createSound(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = Marshal.SizeOf(exinfo); + + return createSound(name, mode, ref exinfo, out sound); + } + public RESULT createStream(string name, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateStream(this.handle, encoder.byteFromStringUTF8(name), mode, ref exinfo, out sound.handle); + } + } + public RESULT createStream(byte[] data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out Sound sound) + { + return FMOD5_System_CreateStream(this.handle, name_or_data, mode, ref exinfo, out sound.handle); + } + public RESULT createStream(string name, MODE mode, out Sound sound) + { + CREATESOUNDEXINFO exinfo = new CREATESOUNDEXINFO(); + exinfo.cbsize = Marshal.SizeOf(exinfo); + + return createStream(name, mode, ref exinfo, out sound); + } + public RESULT createDSP(ref DSP_DESCRIPTION description, out DSP dsp) + { + return FMOD5_System_CreateDSP(this.handle, ref description, out dsp.handle); + } + public RESULT createDSPByType(DSP_TYPE type, out DSP dsp) + { + return FMOD5_System_CreateDSPByType(this.handle, type, out dsp.handle); + } + public RESULT createChannelGroup(string name, out ChannelGroup channelgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateChannelGroup(this.handle, encoder.byteFromStringUTF8(name), out channelgroup.handle); + } + } + public RESULT createSoundGroup(string name, out SoundGroup soundgroup) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_CreateSoundGroup(this.handle, encoder.byteFromStringUTF8(name), out soundgroup.handle); + } + } + public RESULT createReverb3D(out Reverb3D reverb) + { + return FMOD5_System_CreateReverb3D(this.handle, out reverb.handle); + } + public RESULT playSound(Sound sound, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlaySound(this.handle, sound.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT playDSP(DSP dsp, ChannelGroup channelgroup, bool paused, out Channel channel) + { + return FMOD5_System_PlayDSP(this.handle, dsp.handle, channelgroup.handle, paused, out channel.handle); + } + public RESULT getChannel(int channelid, out Channel channel) + { + return FMOD5_System_GetChannel(this.handle, channelid, out channel.handle); + } + public RESULT getMasterChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_System_GetMasterChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT getMasterSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_System_GetMasterSoundGroup(this.handle, out soundgroup.handle); + } + + // Routing to ports. + public RESULT attachChannelGroupToPort(uint portType, ulong portIndex, ChannelGroup channelgroup, bool passThru = false) + { + return FMOD5_System_AttachChannelGroupToPort(this.handle, portType, portIndex, channelgroup.handle, passThru); + } + public RESULT detachChannelGroupFromPort(ChannelGroup channelgroup) + { + return FMOD5_System_DetachChannelGroupFromPort(this.handle, channelgroup.handle); + } + + // Reverb api. + public RESULT setReverbProperties(int instance, ref REVERB_PROPERTIES prop) + { + return FMOD5_System_SetReverbProperties(this.handle, instance, ref prop); + } + public RESULT getReverbProperties(int instance, out REVERB_PROPERTIES prop) + { + return FMOD5_System_GetReverbProperties(this.handle, instance, out prop); + } + + // System level DSP functionality. + public RESULT lockDSP() + { + return FMOD5_System_LockDSP(this.handle); + } + public RESULT unlockDSP() + { + return FMOD5_System_UnlockDSP(this.handle); + } + + // Recording api + public RESULT getRecordNumDrivers(out int numdrivers, out int numconnected) + { + return FMOD5_System_GetRecordNumDrivers(this.handle, out numdrivers, out numconnected); + } + public RESULT getRecordDriverInfo(int id, out string name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_System_GetRecordDriverInfo(this.handle, id, stringMem, namelen, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getRecordDriverInfo(int id, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state) + { + return FMOD5_System_GetRecordDriverInfo(this.handle, id, IntPtr.Zero, 0, out guid, out systemrate, out speakermode, out speakermodechannels, out state); + } + public RESULT getRecordPosition(int id, out uint position) + { + return FMOD5_System_GetRecordPosition(this.handle, id, out position); + } + public RESULT recordStart(int id, Sound sound, bool loop) + { + return FMOD5_System_RecordStart(this.handle, id, sound.handle, loop); + } + public RESULT recordStop(int id) + { + return FMOD5_System_RecordStop(this.handle, id); + } + public RESULT isRecording(int id, out bool recording) + { + return FMOD5_System_IsRecording(this.handle, id, out recording); + } + + // Geometry api + public RESULT createGeometry(int maxpolygons, int maxvertices, out Geometry geometry) + { + return FMOD5_System_CreateGeometry(this.handle, maxpolygons, maxvertices, out geometry.handle); + } + public RESULT setGeometrySettings(float maxworldsize) + { + return FMOD5_System_SetGeometrySettings(this.handle, maxworldsize); + } + public RESULT getGeometrySettings(out float maxworldsize) + { + return FMOD5_System_GetGeometrySettings(this.handle, out maxworldsize); + } + public RESULT loadGeometry(IntPtr data, int datasize, out Geometry geometry) + { + return FMOD5_System_LoadGeometry(this.handle, data, datasize, out geometry.handle); + } + public RESULT getGeometryOcclusion(ref VECTOR listener, ref VECTOR source, out float direct, out float reverb) + { + return FMOD5_System_GetGeometryOcclusion(this.handle, ref listener, ref source, out direct, out reverb); + } + + // Network functions + public RESULT setNetworkProxy(string proxy) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_System_SetNetworkProxy(this.handle, encoder.byteFromStringUTF8(proxy)); + } + } + public RESULT getNetworkProxy(out string proxy, int proxylen) + { + IntPtr stringMem = Marshal.AllocHGlobal(proxylen); + + RESULT result = FMOD5_System_GetNetworkProxy(this.handle, stringMem, proxylen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + proxy = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT setNetworkTimeout(int timeout) + { + return FMOD5_System_SetNetworkTimeout(this.handle, timeout); + } + public RESULT getNetworkTimeout(out int timeout) + { + return FMOD5_System_GetNetworkTimeout(this.handle, out timeout); + } + + // Userdata set/get + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_System_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_System_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Release (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutput (IntPtr system, OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutput (IntPtr system, out OUTPUTTYPE output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumDrivers (IntPtr system, out int numdrivers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDriver (IntPtr system, int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDriver (IntPtr system, out int driver); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareChannels (IntPtr system, int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareChannels (IntPtr system, out int numsoftwarechannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSoftwareFormat (IntPtr system, int samplerate, SPEAKERMODE speakermode, int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSoftwareFormat (IntPtr system, out int samplerate, out SPEAKERMODE speakermode, out int numrawspeakers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetDSPBufferSize (IntPtr system, uint bufferlength, int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPBufferSize (IntPtr system, out uint bufferlength, out int numbuffers); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek, FILE_ASYNCREAD_CALLBACK userasyncread, FILE_ASYNCCANCEL_CALLBACK userasynccancel, int blockalign); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachFileSystem (IntPtr system, FILE_OPEN_CALLBACK useropen, FILE_CLOSE_CALLBACK userclose, FILE_READ_CALLBACK userread, FILE_SEEK_CALLBACK userseek); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetPluginPath (IntPtr system, byte[] path); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadPlugin (IntPtr system, byte[] filename, out uint handle, uint priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnloadPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumNestedPlugins (IntPtr system, uint handle, out int count); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNestedPlugin (IntPtr system, uint handle, int index, out uint nestedhandle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNumPlugins (IntPtr system, PLUGINTYPE plugintype, out int numplugins); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginHandle (IntPtr system, PLUGINTYPE plugintype, int index, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetPluginInfo (IntPtr system, uint handle, out PLUGINTYPE plugintype, IntPtr name, int namelen, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetOutputByPlugin (IntPtr system, uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputByPlugin (IntPtr system, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByPlugin (IntPtr system, uint handle, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDSPInfoByPlugin (IntPtr system, uint handle, out IntPtr description); + //[DllImport(VERSION.dll)] + //private static extern RESULT FMOD5_System_RegisterCodec (IntPtr system, out CODEC_DESCRIPTION description, out uint handle, uint priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RegisterDSP (IntPtr system, ref DSP_DESCRIPTION description, out uint handle); + //[DllImport(VERSION.dll)] + //private static extern RESULT FMOD5_System_RegisterOutput (IntPtr system, ref OUTPUT_DESCRIPTION description, out uint handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Init (IntPtr system, int maxchannels, INITFLAGS flags, IntPtr extradriverdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Close (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Update (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetSpeakerPosition (IntPtr system, SPEAKER speaker, float x, float y, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerPosition (IntPtr system, SPEAKER speaker, out float x, out float y, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetStreamBufferSize (IntPtr system, uint filebuffersize, TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetStreamBufferSize (IntPtr system, out uint filebuffersize, out TIMEUNIT filebuffersizetype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DSettings (IntPtr system, float dopplerscale, float distancefactor, float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DSettings (IntPtr system, out float dopplerscale, out float distancefactor, out float rolloffscale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DNumListeners (IntPtr system, int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DNumListeners (IntPtr system, out int numlisteners); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DListenerAttributes (IntPtr system, int listener, ref VECTOR pos, ref VECTOR vel, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Get3DListenerAttributes (IntPtr system, int listener, out VECTOR pos, out VECTOR vel, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_Set3DRolloffCallback (IntPtr system, CB_3D_ROLLOFF_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerSuspend (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_MixerResume (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetDefaultMixMatrix (IntPtr system, SPEAKERMODE sourcespeakermode, SPEAKERMODE targetspeakermode, float[] matrix, int matrixhop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetSpeakerModeChannels (IntPtr system, SPEAKERMODE mode, out int channels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetVersion (IntPtr system, out uint version); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetOutputHandle (IntPtr system, out IntPtr handle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannelsPlaying (IntPtr system, out int channels, out int realchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetCPUUsage (IntPtr system, out float dsp, out float stream, out float geometry, out float update, out float total); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetFileUsage (IntPtr system, out Int64 sampleBytesRead, out Int64 streamBytesRead, out Int64 otherBytesRead); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSound (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, byte[] name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateStream (IntPtr system, IntPtr name_or_data, MODE mode, ref CREATESOUNDEXINFO exinfo, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSP (IntPtr system, ref DSP_DESCRIPTION description, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateDSPByType (IntPtr system, DSP_TYPE type, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateChannelGroup (IntPtr system, byte[] name, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateSoundGroup (IntPtr system, byte[] name, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateReverb3D (IntPtr system, out IntPtr reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlaySound (IntPtr system, IntPtr sound, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_PlayDSP (IntPtr system, IntPtr dsp, IntPtr channelgroup, bool paused, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetChannel (IntPtr system, int channelid, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterChannelGroup (IntPtr system, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetMasterSoundGroup (IntPtr system, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_AttachChannelGroupToPort (IntPtr system, uint portType, ulong portIndex, IntPtr channelgroup, bool passThru); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_DetachChannelGroupFromPort(IntPtr system, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetReverbProperties (IntPtr system, int instance, ref REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetReverbProperties (IntPtr system, int instance, out REVERB_PROPERTIES prop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_UnlockDSP (IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordNumDrivers (IntPtr system, out int numdrivers, out int numconnected); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordDriverInfo (IntPtr system, int id, IntPtr name, int namelen, out Guid guid, out int systemrate, out SPEAKERMODE speakermode, out int speakermodechannels, out DRIVER_STATE state); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetRecordPosition (IntPtr system, int id, out uint position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStart (IntPtr system, int id, IntPtr sound, bool loop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_RecordStop (IntPtr system, int id); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_IsRecording (IntPtr system, int id, out bool recording); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_CreateGeometry (IntPtr system, int maxpolygons, int maxvertices, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetGeometrySettings (IntPtr system, float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometrySettings (IntPtr system, out float maxworldsize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_LoadGeometry (IntPtr system, IntPtr data, int datasize, out IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetGeometryOcclusion (IntPtr system, ref VECTOR listener, ref VECTOR source, out float direct, out float reverb); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkProxy (IntPtr system, byte[] proxy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkProxy (IntPtr system, IntPtr proxy, int proxylen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetNetworkTimeout (IntPtr system, int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetNetworkTimeout (IntPtr system, out int timeout); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_System_GetUserData (IntPtr system, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + + /* + 'Sound' API. + */ + public struct Sound + { + public RESULT release() + { + return FMOD5_Sound_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_Sound_GetSystemObject(this.handle, out system.handle); + } + + // Standard sound manipulation functions. + public RESULT @lock(uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2) + { + return FMOD5_Sound_Lock(this.handle, offset, length, out ptr1, out ptr2, out len1, out len2); + } + public RESULT unlock(IntPtr ptr1, IntPtr ptr2, uint len1, uint len2) + { + return FMOD5_Sound_Unlock(this.handle, ptr1, ptr2, len1, len2); + } + public RESULT setDefaults(float frequency, int priority) + { + return FMOD5_Sound_SetDefaults(this.handle, frequency, priority); + } + public RESULT getDefaults(out float frequency, out int priority) + { + return FMOD5_Sound_GetDefaults(this.handle, out frequency, out priority); + } + public RESULT set3DMinMaxDistance(float min, float max) + { + return FMOD5_Sound_Set3DMinMaxDistance(this.handle, min, max); + } + public RESULT get3DMinMaxDistance(out float min, out float max) + { + return FMOD5_Sound_Get3DMinMaxDistance(this.handle, out min, out max); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Sound_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Sound_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Sound_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Sound_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + + public RESULT getSubSound(int index, out Sound subsound) + { + return FMOD5_Sound_GetSubSound(this.handle, index, out subsound.handle); + } + public RESULT getSubSoundParent(out Sound parentsound) + { + return FMOD5_Sound_GetSubSoundParent(this.handle, out parentsound.handle); + } + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getLength(out uint length, TIMEUNIT lengthtype) + { + return FMOD5_Sound_GetLength(this.handle, out length, lengthtype); + } + public RESULT getFormat(out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits) + { + return FMOD5_Sound_GetFormat(this.handle, out type, out format, out channels, out bits); + } + public RESULT getNumSubSounds(out int numsubsounds) + { + return FMOD5_Sound_GetNumSubSounds(this.handle, out numsubsounds); + } + public RESULT getNumTags(out int numtags, out int numtagsupdated) + { + return FMOD5_Sound_GetNumTags(this.handle, out numtags, out numtagsupdated); + } + public RESULT getTag(string name, int index, out TAG tag) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_GetTag(this.handle, encoder.byteFromStringUTF8(name), index, out tag); + } + } + public RESULT getOpenState(out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy) + { + return FMOD5_Sound_GetOpenState(this.handle, out openstate, out percentbuffered, out starving, out diskbusy); + } + public RESULT readData(IntPtr buffer, uint length, out uint read) + { + return FMOD5_Sound_ReadData(this.handle, buffer, length, out read); + } + public RESULT seekData(uint pcm) + { + return FMOD5_Sound_SeekData(this.handle, pcm); + } + public RESULT setSoundGroup(SoundGroup soundgroup) + { + return FMOD5_Sound_SetSoundGroup(this.handle, soundgroup.handle); + } + public RESULT getSoundGroup(out SoundGroup soundgroup) + { + return FMOD5_Sound_GetSoundGroup(this.handle, out soundgroup.handle); + } + + // Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks. + public RESULT getNumSyncPoints(out int numsyncpoints) + { + return FMOD5_Sound_GetNumSyncPoints(this.handle, out numsyncpoints); + } + public RESULT getSyncPoint(int index, out IntPtr point) + { + return FMOD5_Sound_GetSyncPoint(this.handle, index, out point); + } + public RESULT getSyncPointInfo(IntPtr point, out string name, int namelen, out uint offset, TIMEUNIT offsettype) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_Sound_GetSyncPointInfo(this.handle, point, stringMem, namelen, out offset, offsettype); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getSyncPointInfo(IntPtr point, out uint offset, TIMEUNIT offsettype) + { + return FMOD5_Sound_GetSyncPointInfo(this.handle, point, IntPtr.Zero, 0, out offset, offsettype); + } + public RESULT addSyncPoint(uint offset, TIMEUNIT offsettype, string name, out IntPtr point) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD5_Sound_AddSyncPoint(this.handle, offset, offsettype, encoder.byteFromStringUTF8(name), out point); + } + } + public RESULT deleteSyncPoint(IntPtr point) + { + return FMOD5_Sound_DeleteSyncPoint(this.handle, point); + } + + // Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time. + public RESULT setMode(MODE mode) + { + return FMOD5_Sound_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Sound_GetMode(this.handle, out mode); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Sound_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Sound_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Sound_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // For MOD/S3M/XM/IT/MID sequenced formats only. + public RESULT getMusicNumChannels(out int numchannels) + { + return FMOD5_Sound_GetMusicNumChannels(this.handle, out numchannels); + } + public RESULT setMusicChannelVolume(int channel, float volume) + { + return FMOD5_Sound_SetMusicChannelVolume(this.handle, channel, volume); + } + public RESULT getMusicChannelVolume(int channel, out float volume) + { + return FMOD5_Sound_GetMusicChannelVolume(this.handle, channel, out volume); + } + public RESULT setMusicSpeed(float speed) + { + return FMOD5_Sound_SetMusicSpeed(this.handle, speed); + } + public RESULT getMusicSpeed(out float speed) + { + return FMOD5_Sound_GetMusicSpeed(this.handle, out speed); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Sound_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Sound_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Release (IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSystemObject (IntPtr sound, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Lock (IntPtr sound, uint offset, uint length, out IntPtr ptr1, out IntPtr ptr2, out uint len1, out uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Unlock (IntPtr sound, IntPtr ptr1, IntPtr ptr2, uint len1, uint len2); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetDefaults (IntPtr sound, float frequency, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetDefaults (IntPtr sound, out float frequency, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DMinMaxDistance (IntPtr sound, float min, float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DMinMaxDistance (IntPtr sound, out float min, out float max); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DConeSettings (IntPtr sound, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DConeSettings (IntPtr sound, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Set3DCustomRolloff (IntPtr sound, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_Get3DCustomRolloff (IntPtr sound, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSound (IntPtr sound, int index, out IntPtr subsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSubSoundParent (IntPtr sound, out IntPtr parentsound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetName (IntPtr sound, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLength (IntPtr sound, out uint length, TIMEUNIT lengthtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetFormat (IntPtr sound, out SOUND_TYPE type, out SOUND_FORMAT format, out int channels, out int bits); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSubSounds (IntPtr sound, out int numsubsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumTags (IntPtr sound, out int numtags, out int numtagsupdated); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetTag (IntPtr sound, byte[] name, int index, out TAG tag); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetOpenState (IntPtr sound, out OPENSTATE openstate, out uint percentbuffered, out bool starving, out bool diskbusy); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_ReadData (IntPtr sound, IntPtr buffer, uint length, out uint read); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SeekData (IntPtr sound, uint pcm); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetSoundGroup (IntPtr sound, IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSoundGroup (IntPtr sound, out IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetNumSyncPoints (IntPtr sound, out int numsyncpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPoint (IntPtr sound, int index, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetSyncPointInfo (IntPtr sound, IntPtr point, IntPtr name, int namelen, out uint offset, TIMEUNIT offsettype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_AddSyncPoint (IntPtr sound, uint offset, TIMEUNIT offsettype, byte[] name, out IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_DeleteSyncPoint (IntPtr sound, IntPtr point); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMode (IntPtr sound, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMode (IntPtr sound, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopCount (IntPtr sound, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopCount (IntPtr sound, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetLoopPoints (IntPtr sound, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetLoopPoints (IntPtr sound, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicNumChannels (IntPtr sound, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicChannelVolume (IntPtr sound, int channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicChannelVolume (IntPtr sound, int channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetMusicSpeed (IntPtr sound, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetMusicSpeed (IntPtr sound, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_SetUserData (IntPtr sound, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Sound_GetUserData (IntPtr sound, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelControl' API + */ + interface IChannelControl + { + RESULT getSystemObject (out System system); + + // General control functionality for Channels and ChannelGroups. + RESULT stop (); + RESULT setPaused (bool paused); + RESULT getPaused (out bool paused); + RESULT setVolume (float volume); + RESULT getVolume (out float volume); + RESULT setVolumeRamp (bool ramp); + RESULT getVolumeRamp (out bool ramp); + RESULT getAudibility (out float audibility); + RESULT setPitch (float pitch); + RESULT getPitch (out float pitch); + RESULT setMute (bool mute); + RESULT getMute (out bool mute); + RESULT setReverbProperties (int instance, float wet); + RESULT getReverbProperties (int instance, out float wet); + RESULT setLowPassGain (float gain); + RESULT getLowPassGain (out float gain); + RESULT setMode (MODE mode); + RESULT getMode (out MODE mode); + RESULT setCallback (CHANNELCONTROL_CALLBACK callback); + RESULT isPlaying (out bool isplaying); + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + RESULT setPan (float pan); + RESULT setMixLevelsOutput (float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + RESULT setMixLevelsInput (float[] levels, int numlevels); + RESULT setMixMatrix (float[] matrix, int outchannels, int inchannels, int inchannel_hop); + RESULT getMixMatrix (float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + + // Clock based functionality. + RESULT getDSPClock (out ulong dspclock, out ulong parentclock); + RESULT setDelay (ulong dspclock_start, ulong dspclock_end, bool stopchannels); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end); + RESULT getDelay (out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + RESULT addFadePoint (ulong dspclock, float volume); + RESULT setFadePointRamp (ulong dspclock, float volume); + RESULT removeFadePoints (ulong dspclock_start, ulong dspclock_end); + RESULT getFadePoints (ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + + // DSP effects. + RESULT getDSP (int index, out DSP dsp); + RESULT addDSP (int index, DSP dsp); + RESULT removeDSP (DSP dsp); + RESULT getNumDSPs (out int numdsps); + RESULT setDSPIndex (DSP dsp, int index); + RESULT getDSPIndex (DSP dsp, out int index); + + // 3D functionality. + RESULT set3DAttributes (ref VECTOR pos, ref VECTOR vel); + RESULT get3DAttributes (out VECTOR pos, out VECTOR vel); + RESULT set3DMinMaxDistance (float mindistance, float maxdistance); + RESULT get3DMinMaxDistance (out float mindistance, out float maxdistance); + RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume); + RESULT get3DConeSettings (out float insideconeangle, out float outsideconeangle, out float outsidevolume); + RESULT set3DConeOrientation (ref VECTOR orientation); + RESULT get3DConeOrientation (out VECTOR orientation); + RESULT set3DCustomRolloff (ref VECTOR points, int numpoints); + RESULT get3DCustomRolloff (out IntPtr points, out int numpoints); + RESULT set3DOcclusion (float directocclusion, float reverbocclusion); + RESULT get3DOcclusion (out float directocclusion, out float reverbocclusion); + RESULT set3DSpread (float angle); + RESULT get3DSpread (out float angle); + RESULT set3DLevel (float level); + RESULT get3DLevel (out float level); + RESULT set3DDopplerLevel (float level); + RESULT get3DDopplerLevel (out float level); + RESULT set3DDistanceFilter (bool custom, float customLevel, float centerFreq); + RESULT get3DDistanceFilter (out bool custom, out float customLevel, out float centerFreq); + + // Userdata set/get. + RESULT setUserData (IntPtr userdata); + RESULT getUserData (out IntPtr userdata); + } + + /* + 'Channel' API + */ + public struct Channel : IChannelControl + { + // Channel specific control functionality. + public RESULT setFrequency(float frequency) + { + return FMOD5_Channel_SetFrequency(this.handle, frequency); + } + public RESULT getFrequency(out float frequency) + { + return FMOD5_Channel_GetFrequency(this.handle, out frequency); + } + public RESULT setPriority(int priority) + { + return FMOD5_Channel_SetPriority(this.handle, priority); + } + public RESULT getPriority(out int priority) + { + return FMOD5_Channel_GetPriority(this.handle, out priority); + } + public RESULT setPosition(uint position, TIMEUNIT postype) + { + return FMOD5_Channel_SetPosition(this.handle, position, postype); + } + public RESULT getPosition(out uint position, TIMEUNIT postype) + { + return FMOD5_Channel_GetPosition(this.handle, out position, postype); + } + public RESULT setChannelGroup(ChannelGroup channelgroup) + { + return FMOD5_Channel_SetChannelGroup(this.handle, channelgroup.handle); + } + public RESULT getChannelGroup(out ChannelGroup channelgroup) + { + return FMOD5_Channel_GetChannelGroup(this.handle, out channelgroup.handle); + } + public RESULT setLoopCount(int loopcount) + { + return FMOD5_Channel_SetLoopCount(this.handle, loopcount); + } + public RESULT getLoopCount(out int loopcount) + { + return FMOD5_Channel_GetLoopCount(this.handle, out loopcount); + } + public RESULT setLoopPoints(uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_SetLoopPoints(this.handle, loopstart, loopstarttype, loopend, loopendtype); + } + public RESULT getLoopPoints(out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype) + { + return FMOD5_Channel_GetLoopPoints(this.handle, out loopstart, loopstarttype, out loopend, loopendtype); + } + + // Information only functions. + public RESULT isVirtual(out bool isvirtual) + { + return FMOD5_Channel_IsVirtual(this.handle, out isvirtual); + } + public RESULT getCurrentSound(out Sound sound) + { + return FMOD5_Channel_GetCurrentSound(this.handle, out sound.handle); + } + public RESULT getIndex(out int index) + { + return FMOD5_Channel_GetIndex(this.handle, out index); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_Channel_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_Channel_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_Channel_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_Channel_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_Channel_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_Channel_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_Channel_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_Channel_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_Channel_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_Channel_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_Channel_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_Channel_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_Channel_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_Channel_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_Channel_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_Channel_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_Channel_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_Channel_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_Channel_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_Channel_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_Channel_IsPlaying(this.handle, out isplaying); + } + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + public RESULT setPan(float pan) + { + return FMOD5_Channel_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_Channel_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_Channel_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_Channel_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_Channel_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels = true) + { + return FMOD5_Channel_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_Channel_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_Channel_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_Channel_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_Channel_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_Channel_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_Channel_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_Channel_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_Channel_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_Channel_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_Channel_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_Channel_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_Channel_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_Channel_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_Channel_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_Channel_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_Channel_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_Channel_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_Channel_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_Channel_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_Channel_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_Channel_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_Channel_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_Channel_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_Channel_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_Channel_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_Channel_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_Channel_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_Channel_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_Channel_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_Channel_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_Channel_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Channel_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Channel_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFrequency (IntPtr channel, float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFrequency (IntPtr channel, out float frequency); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPriority (IntPtr channel, int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPriority (IntPtr channel, out int priority); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPosition (IntPtr channel, uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPosition (IntPtr channel, out uint position, TIMEUNIT postype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetChannelGroup (IntPtr channel, IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetChannelGroup (IntPtr channel, out IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopCount (IntPtr channel, int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopCount (IntPtr channel, out int loopcount); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLoopPoints (IntPtr channel, uint loopstart, TIMEUNIT loopstarttype, uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLoopPoints (IntPtr channel, out uint loopstart, TIMEUNIT loopstarttype, out uint loopend, TIMEUNIT loopendtype); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsVirtual (IntPtr channel, out bool isvirtual); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetCurrentSound (IntPtr channel, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetIndex (IntPtr channel, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetSystemObject (IntPtr channel, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Stop (IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPaused (IntPtr channel, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPaused (IntPtr channel, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolume (IntPtr channel, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolume (IntPtr channel, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetVolumeRamp (IntPtr channel, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetVolumeRamp (IntPtr channel, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetAudibility (IntPtr channel, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPitch (IntPtr channel, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetPitch (IntPtr channel, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMute (IntPtr channel, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMute (IntPtr channel, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetReverbProperties (IntPtr channel, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetReverbProperties (IntPtr channel, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetLowPassGain (IntPtr channel, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetLowPassGain (IntPtr channel, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMode (IntPtr channel, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMode (IntPtr channel, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetCallback (IntPtr channel, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_IsPlaying (IntPtr channel, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetPan (IntPtr channel, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsOutput (IntPtr channel, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixLevelsInput (IntPtr channel, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetMixMatrix (IntPtr channel, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetMixMatrix (IntPtr channel, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPClock (IntPtr channel, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDelay (IntPtr channel, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDelay (IntPtr channel, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddFadePoint (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetFadePointRamp (IntPtr channel, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveFadePoints (IntPtr channel, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetFadePoints (IntPtr channel, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSP (IntPtr channel, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_AddDSP (IntPtr channel, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_RemoveDSP (IntPtr channel, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetNumDSPs (IntPtr channel, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetDSPIndex (IntPtr channel, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetDSPIndex (IntPtr channel, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DAttributes (IntPtr channel, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DAttributes (IntPtr channel, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DMinMaxDistance (IntPtr channel, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DMinMaxDistance (IntPtr channel, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeSettings (IntPtr channel, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeSettings (IntPtr channel, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DConeOrientation (IntPtr channel, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DConeOrientation (IntPtr channel, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DCustomRolloff (IntPtr channel, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DCustomRolloff (IntPtr channel, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DOcclusion (IntPtr channel, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DOcclusion (IntPtr channel, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DSpread (IntPtr channel, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DSpread (IntPtr channel, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDopplerLevel (IntPtr channel, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDopplerLevel (IntPtr channel, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Set3DDistanceFilter (IntPtr channel, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_Get3DDistanceFilter (IntPtr channel, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_SetUserData (IntPtr channel, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Channel_GetUserData (IntPtr channel, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'ChannelGroup' API + */ + public struct ChannelGroup : IChannelControl + { + public RESULT release() + { + return FMOD5_ChannelGroup_Release(this.handle); + } + + // Nested channel groups. + public RESULT addGroup(ChannelGroup group, bool propagatedspclock = true) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, IntPtr.Zero); + } + public RESULT addGroup(ChannelGroup group, bool propagatedspclock, out DSPConnection connection) + { + return FMOD5_ChannelGroup_AddGroup(this.handle, group.handle, propagatedspclock, out connection.handle); + } + public RESULT getNumGroups(out int numgroups) + { + return FMOD5_ChannelGroup_GetNumGroups(this.handle, out numgroups); + } + public RESULT getGroup(int index, out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetGroup(this.handle, index, out group.handle); + } + public RESULT getParentGroup(out ChannelGroup group) + { + return FMOD5_ChannelGroup_GetParentGroup(this.handle, out group.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_ChannelGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumChannels(out int numchannels) + { + return FMOD5_ChannelGroup_GetNumChannels(this.handle, out numchannels); + } + public RESULT getChannel(int index, out Channel channel) + { + return FMOD5_ChannelGroup_GetChannel(this.handle, index, out channel.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_ChannelGroup_GetSystemObject(this.handle, out system.handle); + } + + // General control functionality for Channels and ChannelGroups. + public RESULT stop() + { + return FMOD5_ChannelGroup_Stop(this.handle); + } + public RESULT setPaused(bool paused) + { + return FMOD5_ChannelGroup_SetPaused(this.handle, paused); + } + public RESULT getPaused(out bool paused) + { + return FMOD5_ChannelGroup_GetPaused(this.handle, out paused); + } + public RESULT setVolume(float volume) + { + return FMOD5_ChannelGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_ChannelGroup_GetVolume(this.handle, out volume); + } + public RESULT setVolumeRamp(bool ramp) + { + return FMOD5_ChannelGroup_SetVolumeRamp(this.handle, ramp); + } + public RESULT getVolumeRamp(out bool ramp) + { + return FMOD5_ChannelGroup_GetVolumeRamp(this.handle, out ramp); + } + public RESULT getAudibility(out float audibility) + { + return FMOD5_ChannelGroup_GetAudibility(this.handle, out audibility); + } + public RESULT setPitch(float pitch) + { + return FMOD5_ChannelGroup_SetPitch(this.handle, pitch); + } + public RESULT getPitch(out float pitch) + { + return FMOD5_ChannelGroup_GetPitch(this.handle, out pitch); + } + public RESULT setMute(bool mute) + { + return FMOD5_ChannelGroup_SetMute(this.handle, mute); + } + public RESULT getMute(out bool mute) + { + return FMOD5_ChannelGroup_GetMute(this.handle, out mute); + } + public RESULT setReverbProperties(int instance, float wet) + { + return FMOD5_ChannelGroup_SetReverbProperties(this.handle, instance, wet); + } + public RESULT getReverbProperties(int instance, out float wet) + { + return FMOD5_ChannelGroup_GetReverbProperties(this.handle, instance, out wet); + } + public RESULT setLowPassGain(float gain) + { + return FMOD5_ChannelGroup_SetLowPassGain(this.handle, gain); + } + public RESULT getLowPassGain(out float gain) + { + return FMOD5_ChannelGroup_GetLowPassGain(this.handle, out gain); + } + public RESULT setMode(MODE mode) + { + return FMOD5_ChannelGroup_SetMode(this.handle, mode); + } + public RESULT getMode(out MODE mode) + { + return FMOD5_ChannelGroup_GetMode(this.handle, out mode); + } + public RESULT setCallback(CHANNELCONTROL_CALLBACK callback) + { + return FMOD5_ChannelGroup_SetCallback(this.handle, callback); + } + public RESULT isPlaying(out bool isplaying) + { + return FMOD5_ChannelGroup_IsPlaying(this.handle, out isplaying); + } + + // Note all 'set' functions alter a final matrix, this is why the only get function is getMixMatrix, to avoid other get functions returning incorrect/obsolete values. + public RESULT setPan(float pan) + { + return FMOD5_ChannelGroup_SetPan(this.handle, pan); + } + public RESULT setMixLevelsOutput(float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright) + { + return FMOD5_ChannelGroup_SetMixLevelsOutput(this.handle, frontleft, frontright, center, lfe, surroundleft, surroundright, backleft, backright); + } + public RESULT setMixLevelsInput(float[] levels, int numlevels) + { + return FMOD5_ChannelGroup_SetMixLevelsInput(this.handle, levels, numlevels); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop) + { + return FMOD5_ChannelGroup_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + + // Clock based functionality. + public RESULT getDSPClock(out ulong dspclock, out ulong parentclock) + { + return FMOD5_ChannelGroup_GetDSPClock(this.handle, out dspclock, out parentclock); + } + public RESULT setDelay(ulong dspclock_start, ulong dspclock_end, bool stopchannels) + { + return FMOD5_ChannelGroup_SetDelay(this.handle, dspclock_start, dspclock_end, stopchannels); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, IntPtr.Zero); + } + public RESULT getDelay(out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels) + { + return FMOD5_ChannelGroup_GetDelay(this.handle, out dspclock_start, out dspclock_end, out stopchannels); + } + public RESULT addFadePoint(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_AddFadePoint(this.handle, dspclock, volume); + } + public RESULT setFadePointRamp(ulong dspclock, float volume) + { + return FMOD5_ChannelGroup_SetFadePointRamp(this.handle, dspclock, volume); + } + public RESULT removeFadePoints(ulong dspclock_start, ulong dspclock_end) + { + return FMOD5_ChannelGroup_RemoveFadePoints(this.handle, dspclock_start, dspclock_end); + } + public RESULT getFadePoints(ref uint numpoints, ulong[] point_dspclock, float[] point_volume) + { + return FMOD5_ChannelGroup_GetFadePoints(this.handle, ref numpoints, point_dspclock, point_volume); + } + + // DSP effects. + public RESULT getDSP(int index, out DSP dsp) + { + return FMOD5_ChannelGroup_GetDSP(this.handle, index, out dsp.handle); + } + public RESULT addDSP(int index, DSP dsp) + { + return FMOD5_ChannelGroup_AddDSP(this.handle, index, dsp.handle); + } + public RESULT removeDSP(DSP dsp) + { + return FMOD5_ChannelGroup_RemoveDSP(this.handle, dsp.handle); + } + public RESULT getNumDSPs(out int numdsps) + { + return FMOD5_ChannelGroup_GetNumDSPs(this.handle, out numdsps); + } + public RESULT setDSPIndex(DSP dsp, int index) + { + return FMOD5_ChannelGroup_SetDSPIndex(this.handle, dsp.handle, index); + } + public RESULT getDSPIndex(DSP dsp, out int index) + { + return FMOD5_ChannelGroup_GetDSPIndex(this.handle, dsp.handle, out index); + } + + // 3D functionality. + public RESULT set3DAttributes(ref VECTOR pos, ref VECTOR vel) + { + return FMOD5_ChannelGroup_Set3DAttributes(this.handle, ref pos, ref vel); + } + public RESULT get3DAttributes(out VECTOR pos, out VECTOR vel) + { + return FMOD5_ChannelGroup_Get3DAttributes(this.handle, out pos, out vel); + } + public RESULT set3DMinMaxDistance(float mindistance, float maxdistance) + { + return FMOD5_ChannelGroup_Set3DMinMaxDistance(this.handle, mindistance, maxdistance); + } + public RESULT get3DMinMaxDistance(out float mindistance, out float maxdistance) + { + return FMOD5_ChannelGroup_Get3DMinMaxDistance(this.handle, out mindistance, out maxdistance); + } + public RESULT set3DConeSettings(float insideconeangle, float outsideconeangle, float outsidevolume) + { + return FMOD5_ChannelGroup_Set3DConeSettings(this.handle, insideconeangle, outsideconeangle, outsidevolume); + } + public RESULT get3DConeSettings(out float insideconeangle, out float outsideconeangle, out float outsidevolume) + { + return FMOD5_ChannelGroup_Get3DConeSettings(this.handle, out insideconeangle, out outsideconeangle, out outsidevolume); + } + public RESULT set3DConeOrientation(ref VECTOR orientation) + { + return FMOD5_ChannelGroup_Set3DConeOrientation(this.handle, ref orientation); + } + public RESULT get3DConeOrientation(out VECTOR orientation) + { + return FMOD5_ChannelGroup_Get3DConeOrientation(this.handle, out orientation); + } + public RESULT set3DCustomRolloff(ref VECTOR points, int numpoints) + { + return FMOD5_ChannelGroup_Set3DCustomRolloff(this.handle, ref points, numpoints); + } + public RESULT get3DCustomRolloff(out IntPtr points, out int numpoints) + { + return FMOD5_ChannelGroup_Get3DCustomRolloff(this.handle, out points, out numpoints); + } + public RESULT set3DOcclusion(float directocclusion, float reverbocclusion) + { + return FMOD5_ChannelGroup_Set3DOcclusion(this.handle, directocclusion, reverbocclusion); + } + public RESULT get3DOcclusion(out float directocclusion, out float reverbocclusion) + { + return FMOD5_ChannelGroup_Get3DOcclusion(this.handle, out directocclusion, out reverbocclusion); + } + public RESULT set3DSpread(float angle) + { + return FMOD5_ChannelGroup_Set3DSpread(this.handle, angle); + } + public RESULT get3DSpread(out float angle) + { + return FMOD5_ChannelGroup_Get3DSpread(this.handle, out angle); + } + public RESULT set3DLevel(float level) + { + return FMOD5_ChannelGroup_Set3DLevel(this.handle, level); + } + public RESULT get3DLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DLevel(this.handle, out level); + } + public RESULT set3DDopplerLevel(float level) + { + return FMOD5_ChannelGroup_Set3DDopplerLevel(this.handle, level); + } + public RESULT get3DDopplerLevel(out float level) + { + return FMOD5_ChannelGroup_Get3DDopplerLevel(this.handle, out level); + } + public RESULT set3DDistanceFilter(bool custom, float customLevel, float centerFreq) + { + return FMOD5_ChannelGroup_Set3DDistanceFilter(this.handle, custom, customLevel, centerFreq); + } + public RESULT get3DDistanceFilter(out bool custom, out float customLevel, out float centerFreq) + { + return FMOD5_ChannelGroup_Get3DDistanceFilter(this.handle, out custom, out customLevel, out centerFreq); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_ChannelGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_ChannelGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Release (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddGroup (IntPtr channelgroup, IntPtr group, bool propagatedspclock, out IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumGroups (IntPtr channelgroup, out int numgroups); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetGroup (IntPtr channelgroup, int index, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetParentGroup (IntPtr channelgroup, out IntPtr group); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetName (IntPtr channelgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumChannels (IntPtr channelgroup, out int numchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetChannel (IntPtr channelgroup, int index, out IntPtr channel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetSystemObject (IntPtr channelgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Stop (IntPtr channelgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPaused (IntPtr channelgroup, bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPaused (IntPtr channelgroup, out bool paused); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolume (IntPtr channelgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolume (IntPtr channelgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetVolumeRamp (IntPtr channelgroup, bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetVolumeRamp (IntPtr channelgroup, out bool ramp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetAudibility (IntPtr channelgroup, out float audibility); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPitch (IntPtr channelgroup, float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetPitch (IntPtr channelgroup, out float pitch); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMute (IntPtr channelgroup, bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMute (IntPtr channelgroup, out bool mute); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetReverbProperties (IntPtr channelgroup, int instance, float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetReverbProperties (IntPtr channelgroup, int instance, out float wet); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetLowPassGain (IntPtr channelgroup, float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetLowPassGain (IntPtr channelgroup, out float gain); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMode (IntPtr channelgroup, MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMode (IntPtr channelgroup, out MODE mode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetCallback (IntPtr channelgroup, CHANNELCONTROL_CALLBACK callback); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_IsPlaying (IntPtr channelgroup, out bool isplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetPan (IntPtr channelgroup, float pan); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsOutput (IntPtr channelgroup, float frontleft, float frontright, float center, float lfe, float surroundleft, float surroundright, float backleft, float backright); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixLevelsInput (IntPtr channelgroup, float[] levels, int numlevels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetMixMatrix (IntPtr channelgroup, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetMixMatrix (IntPtr channelgroup, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPClock (IntPtr channelgroup, out ulong dspclock, out ulong parentclock); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDelay (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end, bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, IntPtr zero); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDelay (IntPtr channelgroup, out ulong dspclock_start, out ulong dspclock_end, out bool stopchannels); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddFadePoint (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetFadePointRamp (IntPtr channelgroup, ulong dspclock, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveFadePoints (IntPtr channelgroup, ulong dspclock_start, ulong dspclock_end); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetFadePoints (IntPtr channelgroup, ref uint numpoints, ulong[] point_dspclock, float[] point_volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSP (IntPtr channelgroup, int index, out IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_AddDSP (IntPtr channelgroup, int index, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_RemoveDSP (IntPtr channelgroup, IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetNumDSPs (IntPtr channelgroup, out int numdsps); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetDSPIndex (IntPtr channelgroup, IntPtr dsp, int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetDSPIndex (IntPtr channelgroup, IntPtr dsp, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DAttributes (IntPtr channelgroup, ref VECTOR pos, ref VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DAttributes (IntPtr channelgroup, out VECTOR pos, out VECTOR vel); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DMinMaxDistance (IntPtr channelgroup, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DMinMaxDistance (IntPtr channelgroup, out float mindistance, out float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeSettings (IntPtr channelgroup, float insideconeangle, float outsideconeangle, float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeSettings (IntPtr channelgroup, out float insideconeangle, out float outsideconeangle, out float outsidevolume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DConeOrientation(IntPtr channelgroup, ref VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DConeOrientation(IntPtr channelgroup, out VECTOR orientation); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DCustomRolloff (IntPtr channelgroup, ref VECTOR points, int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DCustomRolloff (IntPtr channelgroup, out IntPtr points, out int numpoints); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DOcclusion (IntPtr channelgroup, float directocclusion, float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DOcclusion (IntPtr channelgroup, out float directocclusion, out float reverbocclusion); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DSpread (IntPtr channelgroup, float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DSpread (IntPtr channelgroup, out float angle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDopplerLevel (IntPtr channelgroup, float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDopplerLevel (IntPtr channelgroup, out float level); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Set3DDistanceFilter (IntPtr channelgroup, bool custom, float customLevel, float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_Get3DDistanceFilter (IntPtr channelgroup, out bool custom, out float customLevel, out float centerFreq); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_SetUserData (IntPtr channelgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_ChannelGroup_GetUserData (IntPtr channelgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'SoundGroup' API + */ + public struct SoundGroup + { + public RESULT release() + { + return FMOD5_SoundGroup_Release(this.handle); + } + + public RESULT getSystemObject(out System system) + { + return FMOD5_SoundGroup_GetSystemObject(this.handle, out system.handle); + } + + // SoundGroup control functions. + public RESULT setMaxAudible(int maxaudible) + { + return FMOD5_SoundGroup_SetMaxAudible(this.handle, maxaudible); + } + public RESULT getMaxAudible(out int maxaudible) + { + return FMOD5_SoundGroup_GetMaxAudible(this.handle, out maxaudible); + } + public RESULT setMaxAudibleBehavior(SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_SetMaxAudibleBehavior(this.handle, behavior); + } + public RESULT getMaxAudibleBehavior(out SOUNDGROUP_BEHAVIOR behavior) + { + return FMOD5_SoundGroup_GetMaxAudibleBehavior(this.handle, out behavior); + } + public RESULT setMuteFadeSpeed(float speed) + { + return FMOD5_SoundGroup_SetMuteFadeSpeed(this.handle, speed); + } + public RESULT getMuteFadeSpeed(out float speed) + { + return FMOD5_SoundGroup_GetMuteFadeSpeed(this.handle, out speed); + } + public RESULT setVolume(float volume) + { + return FMOD5_SoundGroup_SetVolume(this.handle, volume); + } + public RESULT getVolume(out float volume) + { + return FMOD5_SoundGroup_GetVolume(this.handle, out volume); + } + public RESULT stop() + { + return FMOD5_SoundGroup_Stop(this.handle); + } + + // Information only functions. + public RESULT getName(out string name, int namelen) + { + IntPtr stringMem = Marshal.AllocHGlobal(namelen); + + RESULT result = FMOD5_SoundGroup_GetName(this.handle, stringMem, namelen); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + + return result; + } + public RESULT getNumSounds(out int numsounds) + { + return FMOD5_SoundGroup_GetNumSounds(this.handle, out numsounds); + } + public RESULT getSound(int index, out Sound sound) + { + return FMOD5_SoundGroup_GetSound(this.handle, index, out sound.handle); + } + public RESULT getNumPlaying(out int numplaying) + { + return FMOD5_SoundGroup_GetNumPlaying(this.handle, out numplaying); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_SoundGroup_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_SoundGroup_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Release (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSystemObject (IntPtr soundgroup, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudible (IntPtr soundgroup, int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudible (IntPtr soundgroup, out int maxaudible); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMaxAudibleBehavior (IntPtr soundgroup, SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMaxAudibleBehavior (IntPtr soundgroup, out SOUNDGROUP_BEHAVIOR behavior); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetMuteFadeSpeed (IntPtr soundgroup, float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetMuteFadeSpeed (IntPtr soundgroup, out float speed); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetVolume (IntPtr soundgroup, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetVolume (IntPtr soundgroup, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_Stop (IntPtr soundgroup); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetName (IntPtr soundgroup, IntPtr name, int namelen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumSounds (IntPtr soundgroup, out int numsounds); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetSound (IntPtr soundgroup, int index, out IntPtr sound); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetNumPlaying (IntPtr soundgroup, out int numplaying); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_SetUserData (IntPtr soundgroup, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_SoundGroup_GetUserData (IntPtr soundgroup, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSP' API + */ + public struct DSP + { + public RESULT release() + { + return FMOD5_DSP_Release(this.handle); + } + public RESULT getSystemObject(out System system) + { + return FMOD5_DSP_GetSystemObject(this.handle, out system.handle); + } + + // Connection / disconnection / input and output enumeration. + public RESULT addInput(DSP input) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, IntPtr.Zero, DSPCONNECTION_TYPE.STANDARD); + } + public RESULT addInput(DSP input, out DSPConnection connection, DSPCONNECTION_TYPE type = DSPCONNECTION_TYPE.STANDARD) + { + return FMOD5_DSP_AddInput(this.handle, input.handle, out connection.handle, type); + } + public RESULT disconnectFrom(DSP target, DSPConnection connection) + { + return FMOD5_DSP_DisconnectFrom(this.handle, target.handle, connection.handle); + } + public RESULT disconnectAll(bool inputs, bool outputs) + { + return FMOD5_DSP_DisconnectAll(this.handle, inputs, outputs); + } + public RESULT getNumInputs(out int numinputs) + { + return FMOD5_DSP_GetNumInputs(this.handle, out numinputs); + } + public RESULT getNumOutputs(out int numoutputs) + { + return FMOD5_DSP_GetNumOutputs(this.handle, out numoutputs); + } + public RESULT getInput(int index, out DSP input, out DSPConnection inputconnection) + { + return FMOD5_DSP_GetInput(this.handle, index, out input.handle, out inputconnection.handle); + } + public RESULT getOutput(int index, out DSP output, out DSPConnection outputconnection) + { + return FMOD5_DSP_GetOutput(this.handle, index, out output.handle, out outputconnection.handle); + } + + // DSP unit control. + public RESULT setActive(bool active) + { + return FMOD5_DSP_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_DSP_GetActive(this.handle, out active); + } + public RESULT setBypass(bool bypass) + { + return FMOD5_DSP_SetBypass(this.handle, bypass); + } + public RESULT getBypass(out bool bypass) + { + return FMOD5_DSP_GetBypass(this.handle, out bypass); + } + public RESULT setWetDryMix(float prewet, float postwet, float dry) + { + return FMOD5_DSP_SetWetDryMix(this.handle, prewet, postwet, dry); + } + public RESULT getWetDryMix(out float prewet, out float postwet, out float dry) + { + return FMOD5_DSP_GetWetDryMix(this.handle, out prewet, out postwet, out dry); + } + public RESULT setChannelFormat(CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_SetChannelFormat(this.handle, channelmask, numchannels, source_speakermode); + } + public RESULT getChannelFormat(out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode) + { + return FMOD5_DSP_GetChannelFormat(this.handle, out channelmask, out numchannels, out source_speakermode); + } + public RESULT getOutputChannelFormat(CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode) + { + return FMOD5_DSP_GetOutputChannelFormat(this.handle, inmask, inchannels, inspeakermode, out outmask, out outchannels, out outspeakermode); + } + public RESULT reset() + { + return FMOD5_DSP_Reset(this.handle); + } + + // DSP parameter control. + public RESULT setParameterFloat(int index, float value) + { + return FMOD5_DSP_SetParameterFloat(this.handle, index, value); + } + public RESULT setParameterInt(int index, int value) + { + return FMOD5_DSP_SetParameterInt(this.handle, index, value); + } + public RESULT setParameterBool(int index, bool value) + { + return FMOD5_DSP_SetParameterBool(this.handle, index, value); + } + public RESULT setParameterData(int index, byte[] data) + { + return FMOD5_DSP_SetParameterData(this.handle, index, Marshal.UnsafeAddrOfPinnedArrayElement(data, 0), (uint)data.Length); + } + public RESULT getParameterFloat(int index, out float value) + { + return FMOD5_DSP_GetParameterFloat(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterInt(int index, out int value) + { + return FMOD5_DSP_GetParameterInt(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterBool(int index, out bool value) + { + return FMOD5_DSP_GetParameterBool(this.handle, index, out value, IntPtr.Zero, 0); + } + public RESULT getParameterData(int index, out IntPtr data, out uint length) + { + return FMOD5_DSP_GetParameterData(this.handle, index, out data, out length, IntPtr.Zero, 0); + } + public RESULT getNumParameters(out int numparams) + { + return FMOD5_DSP_GetNumParameters(this.handle, out numparams); + } + public RESULT getParameterInfo(int index, out DSP_PARAMETER_DESC desc) + { + IntPtr descPtr; + RESULT result = FMOD5_DSP_GetParameterInfo(this.handle, index, out descPtr); + #if (UNITY_2017_4_OR_NEWER) && !NET_4_6 + desc = (DSP_PARAMETER_DESC)Marshal.PtrToStructure(descPtr, typeof(DSP_PARAMETER_DESC)); + #else + desc = Marshal.PtrToStructure(descPtr); + #endif // (UNITY_2017_4_OR_NEWER) && !NET_4_6 + return result; + } + public RESULT getDataParameterIndex(int datatype, out int index) + { + return FMOD5_DSP_GetDataParameterIndex(this.handle, datatype, out index); + } + public RESULT showConfigDialog(IntPtr hwnd, bool show) + { + return FMOD5_DSP_ShowConfigDialog(this.handle, hwnd, show); + } + + // DSP attributes. + public RESULT getInfo(out string name, out uint version, out int channels, out int configwidth, out int configheight) + { + IntPtr nameMem = Marshal.AllocHGlobal(32); + + RESULT result = FMOD5_DSP_GetInfo(this.handle, nameMem, out version, out channels, out configwidth, out configheight); + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + name = encoder.stringFromNative(nameMem); + } + Marshal.FreeHGlobal(nameMem); + return result; + } + public RESULT getInfo(out uint version, out int channels, out int configwidth, out int configheight) + { + return FMOD5_DSP_GetInfo(this.handle, IntPtr.Zero, out version, out channels, out configwidth, out configheight); ; + } + public RESULT getType(out DSP_TYPE type) + { + return FMOD5_DSP_GetType(this.handle, out type); + } + public RESULT getIdle(out bool idle) + { + return FMOD5_DSP_GetIdle(this.handle, out idle); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSP_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSP_GetUserData(this.handle, out userdata); + } + + // Metering. + public RESULT setMeteringEnabled(bool inputEnabled, bool outputEnabled) + { + return FMOD5_DSP_SetMeteringEnabled(this.handle, inputEnabled, outputEnabled); + } + public RESULT getMeteringEnabled(out bool inputEnabled, out bool outputEnabled) + { + return FMOD5_DSP_GetMeteringEnabled(this.handle, out inputEnabled, out outputEnabled); + } + + public RESULT getMeteringInfo(IntPtr zero, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, zero, out outputInfo); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, IntPtr zero) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, zero); + } + public RESULT getMeteringInfo(out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo) + { + return FMOD5_DSP_GetMeteringInfo(this.handle, out inputInfo, out outputInfo); + } + + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD5_DSP_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Release (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetSystemObject (IntPtr dsp, out IntPtr system); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, IntPtr zero, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_AddInput (IntPtr dsp, IntPtr input, out IntPtr connection, DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectFrom (IntPtr dsp, IntPtr target, IntPtr connection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_DisconnectAll (IntPtr dsp, bool inputs, bool outputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumInputs (IntPtr dsp, out int numinputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumOutputs (IntPtr dsp, out int numoutputs); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInput (IntPtr dsp, int index, out IntPtr input, out IntPtr inputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutput (IntPtr dsp, int index, out IntPtr output, out IntPtr outputconnection); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetActive (IntPtr dsp, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetActive (IntPtr dsp, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetBypass (IntPtr dsp, bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetBypass (IntPtr dsp, out bool bypass); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetWetDryMix (IntPtr dsp, float prewet, float postwet, float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetWetDryMix (IntPtr dsp, out float prewet, out float postwet, out float dry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetChannelFormat (IntPtr dsp, CHANNELMASK channelmask, int numchannels, SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetChannelFormat (IntPtr dsp, out CHANNELMASK channelmask, out int numchannels, out SPEAKERMODE source_speakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetOutputChannelFormat (IntPtr dsp, CHANNELMASK inmask, int inchannels, SPEAKERMODE inspeakermode, out CHANNELMASK outmask, out int outchannels, out SPEAKERMODE outspeakermode); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_Reset (IntPtr dsp); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterFloat (IntPtr dsp, int index, float value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterInt (IntPtr dsp, int index, int value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterBool (IntPtr dsp, int index, bool value); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetParameterData (IntPtr dsp, int index, IntPtr data, uint length); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterFloat (IntPtr dsp, int index, out float value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInt (IntPtr dsp, int index, out int value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterBool (IntPtr dsp, int index, out bool value, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterData (IntPtr dsp, int index, out IntPtr data, out uint length, IntPtr valuestr, int valuestrlen); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetNumParameters (IntPtr dsp, out int numparams); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetParameterInfo (IntPtr dsp, int index, out IntPtr desc); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetDataParameterIndex (IntPtr dsp, int datatype, out int index); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_ShowConfigDialog (IntPtr dsp, IntPtr hwnd, bool show); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetInfo (IntPtr dsp, IntPtr name, out uint version, out int channels, out int configwidth, out int configheight); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetType (IntPtr dsp, out DSP_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetIdle (IntPtr dsp, out bool idle); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_SetUserData (IntPtr dsp, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSP_GetUserData (IntPtr dsp, out IntPtr userdata); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_SetMeteringEnabled (IntPtr dsp, bool inputEnabled, bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringEnabled (IntPtr dsp, out bool inputEnabled, out bool outputEnabled); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, IntPtr zero, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, IntPtr zero); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetMeteringInfo (IntPtr dsp, out DSP_METERING_INFO inputInfo, out DSP_METERING_INFO outputInfo); + [DllImport(VERSION.dll)] + public static extern RESULT FMOD5_DSP_GetCPUUsage (IntPtr dsp, out uint exclusive, out uint inclusive); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'DSPConnection' API + */ + public struct DSPConnection + { + public RESULT getInput(out DSP input) + { + return FMOD5_DSPConnection_GetInput(this.handle, out input.handle); + } + public RESULT getOutput(out DSP output) + { + return FMOD5_DSPConnection_GetOutput(this.handle, out output.handle); + } + public RESULT setMix(float volume) + { + return FMOD5_DSPConnection_SetMix(this.handle, volume); + } + public RESULT getMix(out float volume) + { + return FMOD5_DSPConnection_GetMix(this.handle, out volume); + } + public RESULT setMixMatrix(float[] matrix, int outchannels, int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_SetMixMatrix(this.handle, matrix, outchannels, inchannels, inchannel_hop); + } + public RESULT getMixMatrix(float[] matrix, out int outchannels, out int inchannels, int inchannel_hop = 0) + { + return FMOD5_DSPConnection_GetMixMatrix(this.handle, matrix, out outchannels, out inchannels, inchannel_hop); + } + public RESULT getType(out DSPCONNECTION_TYPE type) + { + return FMOD5_DSPConnection_GetType(this.handle, out type); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_DSPConnection_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_DSPConnection_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetInput (IntPtr dspconnection, out IntPtr input); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetOutput (IntPtr dspconnection, out IntPtr output); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMix (IntPtr dspconnection, float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMix (IntPtr dspconnection, out float volume); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetMixMatrix (IntPtr dspconnection, float[] matrix, int outchannels, int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetMixMatrix (IntPtr dspconnection, float[] matrix, out int outchannels, out int inchannels, int inchannel_hop); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetType (IntPtr dspconnection, out DSPCONNECTION_TYPE type); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_SetUserData (IntPtr dspconnection, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_DSPConnection_GetUserData (IntPtr dspconnection, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Geometry' API + */ + public struct Geometry + { + public RESULT release() + { + return FMOD5_Geometry_Release(this.handle); + } + + // Polygon manipulation. + public RESULT addPolygon(float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex) + { + return FMOD5_Geometry_AddPolygon(this.handle, directocclusion, reverbocclusion, doublesided, numvertices, vertices, out polygonindex); + } + public RESULT getNumPolygons(out int numpolygons) + { + return FMOD5_Geometry_GetNumPolygons(this.handle, out numpolygons); + } + public RESULT getMaxPolygons(out int maxpolygons, out int maxvertices) + { + return FMOD5_Geometry_GetMaxPolygons(this.handle, out maxpolygons, out maxvertices); + } + public RESULT getPolygonNumVertices(int index, out int numvertices) + { + return FMOD5_Geometry_GetPolygonNumVertices(this.handle, index, out numvertices); + } + public RESULT setPolygonVertex(int index, int vertexindex, ref VECTOR vertex) + { + return FMOD5_Geometry_SetPolygonVertex(this.handle, index, vertexindex, ref vertex); + } + public RESULT getPolygonVertex(int index, int vertexindex, out VECTOR vertex) + { + return FMOD5_Geometry_GetPolygonVertex(this.handle, index, vertexindex, out vertex); + } + public RESULT setPolygonAttributes(int index, float directocclusion, float reverbocclusion, bool doublesided) + { + return FMOD5_Geometry_SetPolygonAttributes(this.handle, index, directocclusion, reverbocclusion, doublesided); + } + public RESULT getPolygonAttributes(int index, out float directocclusion, out float reverbocclusion, out bool doublesided) + { + return FMOD5_Geometry_GetPolygonAttributes(this.handle, index, out directocclusion, out reverbocclusion, out doublesided); + } + + // Object manipulation. + public RESULT setActive(bool active) + { + return FMOD5_Geometry_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Geometry_GetActive(this.handle, out active); + } + public RESULT setRotation(ref VECTOR forward, ref VECTOR up) + { + return FMOD5_Geometry_SetRotation(this.handle, ref forward, ref up); + } + public RESULT getRotation(out VECTOR forward, out VECTOR up) + { + return FMOD5_Geometry_GetRotation(this.handle, out forward, out up); + } + public RESULT setPosition(ref VECTOR position) + { + return FMOD5_Geometry_SetPosition(this.handle, ref position); + } + public RESULT getPosition(out VECTOR position) + { + return FMOD5_Geometry_GetPosition(this.handle, out position); + } + public RESULT setScale(ref VECTOR scale) + { + return FMOD5_Geometry_SetScale(this.handle, ref scale); + } + public RESULT getScale(out VECTOR scale) + { + return FMOD5_Geometry_GetScale(this.handle, out scale); + } + public RESULT save(IntPtr data, out int datasize) + { + return FMOD5_Geometry_Save(this.handle, data, out datasize); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Geometry_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Geometry_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Release (IntPtr geometry); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, out int polygonindex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetNumPolygons (IntPtr geometry, out int numpolygons); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetMaxPolygons (IntPtr geometry, out int maxpolygons, out int maxvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonNumVertices(IntPtr geometry, int index, out int numvertices); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonVertex (IntPtr geometry, int index, int vertexindex, ref VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonVertex (IntPtr geometry, int index, int vertexindex, out VECTOR vertex); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPolygonAttributes (IntPtr geometry, int index, float directocclusion, float reverbocclusion, bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPolygonAttributes (IntPtr geometry, int index, out float directocclusion, out float reverbocclusion, out bool doublesided); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetActive (IntPtr geometry, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetActive (IntPtr geometry, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetRotation (IntPtr geometry, ref VECTOR forward, ref VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetRotation (IntPtr geometry, out VECTOR forward, out VECTOR up); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetPosition (IntPtr geometry, ref VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetPosition (IntPtr geometry, out VECTOR position); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetScale (IntPtr geometry, ref VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetScale (IntPtr geometry, out VECTOR scale); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_Save (IntPtr geometry, IntPtr data, out int datasize); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_SetUserData (IntPtr geometry, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Geometry_GetUserData (IntPtr geometry, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + /* + 'Reverb3D' API + */ + public struct Reverb3D + { + public RESULT release() + { + return FMOD5_Reverb3D_Release(this.handle); + } + + // Reverb manipulation. + public RESULT set3DAttributes(ref VECTOR position, float mindistance, float maxdistance) + { + return FMOD5_Reverb3D_Set3DAttributes(this.handle, ref position, mindistance, maxdistance); + } + public RESULT get3DAttributes(ref VECTOR position, ref float mindistance, ref float maxdistance) + { + return FMOD5_Reverb3D_Get3DAttributes(this.handle, ref position, ref mindistance, ref maxdistance); + } + public RESULT setProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_SetProperties(this.handle, ref properties); + } + public RESULT getProperties(ref REVERB_PROPERTIES properties) + { + return FMOD5_Reverb3D_GetProperties(this.handle, ref properties); + } + public RESULT setActive(bool active) + { + return FMOD5_Reverb3D_SetActive(this.handle, active); + } + public RESULT getActive(out bool active) + { + return FMOD5_Reverb3D_GetActive(this.handle, out active); + } + + // Userdata set/get. + public RESULT setUserData(IntPtr userdata) + { + return FMOD5_Reverb3D_SetUserData(this.handle, userdata); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD5_Reverb3D_GetUserData(this.handle, out userdata); + } + + #region importfunctions + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Release (IntPtr reverb3d); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Set3DAttributes (IntPtr reverb3d, ref VECTOR position, float mindistance, float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_Get3DAttributes (IntPtr reverb3d, ref VECTOR position, ref float mindistance, ref float maxdistance); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetProperties (IntPtr reverb3d, ref REVERB_PROPERTIES properties); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetActive (IntPtr reverb3d, bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetActive (IntPtr reverb3d, out bool active); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_SetUserData (IntPtr reverb3d, IntPtr userdata); + [DllImport(VERSION.dll)] + private static extern RESULT FMOD5_Reverb3D_GetUserData (IntPtr reverb3d, out IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + #endregion + } + + #region String Helper Functions + [StructLayout(LayoutKind.Sequential)] + public struct StringWrapper + { + IntPtr nativeUtf8Ptr; + + public static implicit operator string(StringWrapper fstring) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return encoder.stringFromNative(fstring.nativeUtf8Ptr); + } + } + } + + static class StringHelper + { + public class ThreadSafeEncoding : IDisposable + { + UTF8Encoding encoding = new UTF8Encoding(); + byte[] encodedBuffer = new byte[128]; + char[] decodedBuffer = new char[128]; + bool inUse; + GCHandle gcHandle; + + public bool InUse() { return inUse; } + public void SetInUse() { inUse = true; } + + private int roundUpPowerTwo(int number) + { + int newNumber = 1; + while (newNumber <= number) + { + newNumber *= 2; + } + + return newNumber; + } + + public byte[] byteFromStringUTF8(string s) + { + if (s == null) + { + return null; + } + + int maximumLength = encoding.GetMaxByteCount(s.Length) + 1; // +1 for null terminator + if (maximumLength > encodedBuffer.Length) + { + int encodedLength = encoding.GetByteCount(s) + 1; // +1 for null terminator + if (encodedLength > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(encodedLength)]; + } + } + + int byteCount = encoding.GetBytes(s, 0, s.Length, encodedBuffer, 0); + encodedBuffer[byteCount] = 0; // Apply null terminator + + return encodedBuffer; + } + + public IntPtr intptrFromStringUTF8(string s) + { + if (s == null) + { + return IntPtr.Zero; + } + + gcHandle = GCHandle.Alloc(byteFromStringUTF8(s), GCHandleType.Pinned); + return gcHandle.AddrOfPinnedObject(); + } + + public string stringFromNative(IntPtr nativePtr) + { + if (nativePtr == IntPtr.Zero) + { + return ""; + } + + int nativeLen = 0; + while (Marshal.ReadByte(nativePtr, nativeLen) != 0) + { + nativeLen++; + } + + if (nativeLen == 0) + { + return ""; + } + + if (nativeLen > encodedBuffer.Length) + { + encodedBuffer = new byte[roundUpPowerTwo(nativeLen)]; + } + + Marshal.Copy(nativePtr, encodedBuffer, 0, nativeLen); + + int maximumLength = encoding.GetMaxCharCount(nativeLen); + if (maximumLength > decodedBuffer.Length) + { + int decodedLength = encoding.GetCharCount(encodedBuffer, 0, nativeLen); + if (decodedLength > decodedBuffer.Length) + { + decodedBuffer = new char[roundUpPowerTwo(decodedLength)]; + } + } + + int charCount = encoding.GetChars(encodedBuffer, 0, nativeLen, decodedBuffer, 0); + + return new String(decodedBuffer, 0, charCount); + } + + public void Dispose() + { + if (gcHandle.IsAllocated) + { + gcHandle.Free(); + } + lock (encoders) + { + inUse = false; + } + } + } + + static List encoders = new List(1); + + public static ThreadSafeEncoding GetFreeHelper() + { + lock (encoders) + { + ThreadSafeEncoding helper = null; + // Search for not in use helper + for (int i = 0; i < encoders.Count; i++) + { + if (!encoders[i].InUse()) + { + helper = encoders[i]; + break; + } + } + // Otherwise create another helper + if (helper == null) + { + helper = new ThreadSafeEncoding(); + encoders.Add(helper); + } + helper.SetInUse(); + return helper; + } + } + } + + #endregion +} diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs.meta b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs.meta new file mode 100644 index 0000000..1193a07 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bd0d0c955caff8940ac1667ee36dd4c9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_android.cs b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_android.cs new file mode 100644 index 0000000..a1d80aa --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_android.cs @@ -0,0 +1,46 @@ +#if UNITY_ANDROID +using System.Runtime.InteropServices; + +namespace FMOD +{ + static class Android + { + public static RESULT setThreadAffinity(ref THREADAFFINITY affinity) + { + return FMOD_Android_SetThreadAffinity(ref affinity); + } + + [StructLayout(LayoutKind.Sequential)] + public struct THREADAFFINITY + { + public THREAD mixer; /* Software mixer thread. */ + public THREAD stream; /* Stream thread. */ + public THREAD nonblocking; /* Asynchronous sound loading thread. */ + public THREAD file; /* File thread. */ + public THREAD geometry; /* Geometry processing thread. */ + public THREAD profiler; /* Profiler thread. */ + public THREAD studioUpdate; /* Studio update thread. */ + public THREAD studioLoadBank; /* Studio bank loading thread. */ + public THREAD studioLoadSample; /* Studio sample loading thread. */ + } + + [global::System.Flags] + public enum THREAD : uint + { + DEFAULT = 0, /* Use default thread assignment. */ + CORE0 = 1 << 0, + CORE1 = 1 << 1, + CORE2 = 1 << 2, + CORE3 = 1 << 3, + CORE4 = 1 << 4, + CORE5 = 1 << 5, + CORE6 = 1 << 6, + CORE7 = 1 << 7, + } + + [DllImport(VERSION.dll)] + private static extern RESULT FMOD_Android_SetThreadAffinity(ref THREADAFFINITY affinity); + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_android.cs.meta b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_android.cs.meta new file mode 100644 index 0000000..d02d77f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_android.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7c52b59df68a5a41bb820a3a1decdbb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_dsp.cs b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_dsp.cs new file mode 100644 index 0000000..0435f94 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_dsp.cs @@ -0,0 +1,846 @@ +/* ======================================================================================== */ +/* FMOD Core API - DSP header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2020. */ +/* */ +/* Use this header if you are wanting to develop your own DSP plugin to use with FMODs */ +/* dsp system. With this header you can make your own DSP plugin that FMOD can */ +/* register and use. See the documentation and examples on how to make a working plugin. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=plugin-api-dsp.html */ +/* =========================================================================================*/ + +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace FMOD +{ + [StructLayout(LayoutKind.Sequential)] + public struct DSP_BUFFER_ARRAY + { + public int numbuffers; + public int[] buffernumchannels; + public CHANNELMASK[] bufferchannelmask; + public IntPtr[] buffers; + public SPEAKERMODE speakermode; + } + + public enum DSP_PROCESS_OPERATION + { + PROCESS_PERFORM = 0, + PROCESS_QUERY + } + + [StructLayout(LayoutKind.Sequential)] + public struct COMPLEX + { + public float real; + public float imag; + } + + public enum DSP_PAN_SURROUND_FLAGS + { + DEFAULT = 0, + ROTATION_NOT_BIASED = 1, + } + + + /* + DSP callbacks + */ + public delegate RESULT DSP_CREATECALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_RELEASECALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_RESETCALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SETPOSITIONCALLBACK (ref DSP_STATE dsp_state, uint pos); + public delegate RESULT DSP_READCALLBACK (ref DSP_STATE dsp_state, IntPtr inbuffer, IntPtr outbuffer, uint length, int inchannels, ref int outchannels); + public delegate RESULT DSP_SHOULDIPROCESS_CALLBACK (ref DSP_STATE dsp_state, bool inputsidle, uint length, CHANNELMASK inmask, int inchannels, SPEAKERMODE speakermode); + public delegate RESULT DSP_PROCESS_CALLBACK (ref DSP_STATE dsp_state, uint length, ref DSP_BUFFER_ARRAY inbufferarray, ref DSP_BUFFER_ARRAY outbufferarray, bool inputsidle, DSP_PROCESS_OPERATION op); + public delegate RESULT DSP_SETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, float value); + public delegate RESULT DSP_SETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, int value); + public delegate RESULT DSP_SETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, bool value); + public delegate RESULT DSP_SETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, IntPtr data, uint length); + public delegate RESULT DSP_GETPARAM_FLOAT_CALLBACK (ref DSP_STATE dsp_state, int index, ref float value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_INT_CALLBACK (ref DSP_STATE dsp_state, int index, ref int value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_BOOL_CALLBACK (ref DSP_STATE dsp_state, int index, ref bool value, IntPtr valuestr); + public delegate RESULT DSP_GETPARAM_DATA_CALLBACK (ref DSP_STATE dsp_state, int index, ref IntPtr data, ref uint length, IntPtr valuestr); + public delegate RESULT DSP_SYSTEM_REGISTER_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SYSTEM_DEREGISTER_CALLBACK (ref DSP_STATE dsp_state); + public delegate RESULT DSP_SYSTEM_MIX_CALLBACK (ref DSP_STATE dsp_state, int stage); + + + /* + DSP functions + */ + public delegate IntPtr DSP_ALLOC_FUNC (uint size, MEMORY_TYPE type, StringWrapper sourcestr); + public delegate IntPtr DSP_REALLOC_FUNC (IntPtr ptr, uint size, MEMORY_TYPE type, StringWrapper sourcestr); + public delegate void DSP_FREE_FUNC (IntPtr ptr, MEMORY_TYPE type, StringWrapper sourcestr); + public delegate void DSP_LOG_FUNC (DEBUG_FLAGS level, StringWrapper file, int line, StringWrapper function, StringWrapper format); + public delegate RESULT DSP_GETSAMPLERATE_FUNC (ref DSP_STATE dsp_state, ref int rate); + public delegate RESULT DSP_GETBLOCKSIZE_FUNC (ref DSP_STATE dsp_state, ref uint blocksize); + public delegate RESULT DSP_GETSPEAKERMODE_FUNC (ref DSP_STATE dsp_state, ref int speakermode_mixer, ref int speakermode_output); + public delegate RESULT DSP_GETCLOCK_FUNC (ref DSP_STATE dsp_state, out ulong clock, out uint offset, out uint length); + public delegate RESULT DSP_GETLISTENERATTRIBUTES_FUNC (ref DSP_STATE dsp_state, ref int numlisteners, IntPtr attributes); + public delegate RESULT DSP_GETUSERDATA_FUNC (ref DSP_STATE dsp_state, out IntPtr userdata); + public delegate RESULT DSP_DFT_FFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr signal, IntPtr dft, IntPtr window, int signalhop); + public delegate RESULT DSP_DFT_IFFTREAL_FUNC (ref DSP_STATE dsp_state, int size, IntPtr dft, IntPtr signal, IntPtr window, int signalhop); + public delegate RESULT DSP_PAN_SUMMONOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float lowFrequencyGain, float overallGain, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSTEREOMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, float pan, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int sourceSpeakerMode, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix, DSP_PAN_SURROUND_FLAGS flags); + public delegate RESULT DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC (ref DSP_STATE dsp_state, int targetSpeakerMode, float direction, float extent, float rotation, float lowFrequencyGain, float overallGain, int matrixHop, IntPtr matrix); + public delegate RESULT DSP_PAN_GETROLLOFFGAIN_FUNC (ref DSP_STATE dsp_state, DSP_PAN_3D_ROLLOFF_TYPE rolloff, float distance, float mindistance, float maxdistance, out float gain); + + + public enum DSP_TYPE : int + { + UNKNOWN, + MIXER, + OSCILLATOR, + LOWPASS, + ITLOWPASS, + HIGHPASS, + ECHO, + FADER, + FLANGE, + DISTORTION, + NORMALIZE, + LIMITER, + PARAMEQ, + PITCHSHIFT, + CHORUS, + VSTPLUGIN, + WINAMPPLUGIN, + ITECHO, + COMPRESSOR, + SFXREVERB, + LOWPASS_SIMPLE, + DELAY, + TREMOLO, + LADSPAPLUGIN, + SEND, + RETURN, + HIGHPASS_SIMPLE, + PAN, + THREE_EQ, + FFT, + LOUDNESS_METER, + ENVELOPEFOLLOWER, + CONVOLUTIONREVERB, + CHANNELMIX, + TRANSCEIVER, + OBJECTPAN, + MULTIBAND_EQ, + MAX + } + + public enum DSP_PARAMETER_TYPE + { + FLOAT = 0, + INT, + BOOL, + DATA, + MAX + } + + public enum DSP_PARAMETER_FLOAT_MAPPING_TYPE + { + DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR = 0, + DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO, + DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR, + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR + { + public int numpoints; + public IntPtr pointparamvalues; + public IntPtr pointpositions; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FLOAT_MAPPING + { + public DSP_PARAMETER_FLOAT_MAPPING_TYPE type; + public DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR piecewiselinearmapping; + } + + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_FLOAT + { + public float min; + public float max; + public float defaultval; + public DSP_PARAMETER_FLOAT_MAPPING mapping; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_INT + { + public int min; + public int max; + public int defaultval; + public bool goestoinf; + public IntPtr valuenames; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_BOOL + { + public bool defaultval; + public IntPtr valuenames; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC_DATA + { + public int datatype; + } + + [StructLayout(LayoutKind.Explicit)] + public struct DSP_PARAMETER_DESC_UNION + { + [FieldOffset(0)] + public DSP_PARAMETER_DESC_FLOAT floatdesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_INT intdesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_BOOL booldesc; + [FieldOffset(0)] + public DSP_PARAMETER_DESC_DATA datadesc; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_DESC + { + public DSP_PARAMETER_TYPE type; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] name; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] + public byte[] label; + public string description; + + public DSP_PARAMETER_DESC_UNION desc; + } + + public enum DSP_PARAMETER_DATA_TYPE + { + DSP_PARAMETER_DATA_TYPE_USER = 0, + DSP_PARAMETER_DATA_TYPE_OVERALLGAIN = -1, + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES = -2, + DSP_PARAMETER_DATA_TYPE_SIDECHAIN = -3, + DSP_PARAMETER_DATA_TYPE_FFT = -4, + DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI = -5 + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_OVERALLGAIN + { + public float linear_gain; + public float linear_gain_additive; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_3DATTRIBUTES + { + public ATTRIBUTES_3D relative; + public ATTRIBUTES_3D absolute; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_3DATTRIBUTES_MULTI + { + public int numlisteners; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public ATTRIBUTES_3D[] relative; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + public float[] weight; + public ATTRIBUTES_3D absolute; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_SIDECHAIN + { + public int sidechainenable; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_PARAMETER_FFT + { + public int length; + public int numchannels; + + [MarshalAs(UnmanagedType.ByValArray,SizeConst=32)] + private IntPtr[] spectrum_internal; + + public float[][] spectrum + { + get + { + var buffer = new float[numchannels][]; + + for (int i = 0; i < numchannels; ++i) + { + buffer[i] = new float[length]; + Marshal.Copy(spectrum_internal[i], buffer[i], 0, length); + } + + return buffer; + } + } + + public void getSpectrum(ref float[][] buffer) + { + int bufferLength = Math.Min(buffer.Length, numchannels); + for (int i = 0; i < bufferLength; ++i) + { + getSpectrum(i, ref buffer[i]); + } + } + + public void getSpectrum(int channel, ref float[] buffer) + { + int bufferLength = Math.Min(buffer.Length, length); + Marshal.Copy(spectrum_internal[channel], buffer, 0, bufferLength); + } + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_DESCRIPTION + { + public uint pluginsdkversion; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] + public byte[] name; + public uint version; + public int numinputbuffers; + public int numoutputbuffers; + public DSP_CREATECALLBACK create; + public DSP_RELEASECALLBACK release; + public DSP_RESETCALLBACK reset; + public DSP_READCALLBACK read; + public DSP_PROCESS_CALLBACK process; + public DSP_SETPOSITIONCALLBACK setposition; + + public int numparameters; + public IntPtr paramdesc; + public DSP_SETPARAM_FLOAT_CALLBACK setparameterfloat; + public DSP_SETPARAM_INT_CALLBACK setparameterint; + public DSP_SETPARAM_BOOL_CALLBACK setparameterbool; + public DSP_SETPARAM_DATA_CALLBACK setparameterdata; + public DSP_GETPARAM_FLOAT_CALLBACK getparameterfloat; + public DSP_GETPARAM_INT_CALLBACK getparameterint; + public DSP_GETPARAM_BOOL_CALLBACK getparameterbool; + public DSP_GETPARAM_DATA_CALLBACK getparameterdata; + public DSP_SHOULDIPROCESS_CALLBACK shouldiprocess; + public IntPtr userdata; + + public DSP_SYSTEM_REGISTER_CALLBACK sys_register; + public DSP_SYSTEM_DEREGISTER_CALLBACK sys_deregister; + public DSP_SYSTEM_MIX_CALLBACK sys_mix; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_DFT_FUNCTIONS + { + public DSP_DFT_FFTREAL_FUNC fftreal; + public DSP_DFT_IFFTREAL_FUNC inversefftreal; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_PAN_FUNCTIONS + { + public DSP_PAN_SUMMONOMATRIX_FUNC summonomatrix; + public DSP_PAN_SUMSTEREOMATRIX_FUNC sumstereomatrix; + public DSP_PAN_SUMSURROUNDMATRIX_FUNC sumsurroundmatrix; + public DSP_PAN_SUMMONOTOSURROUNDMATRIX_FUNC summonotosurroundmatrix; + public DSP_PAN_SUMSTEREOTOSURROUNDMATRIX_FUNC sumstereotosurroundmatrix; + public DSP_PAN_GETROLLOFFGAIN_FUNC getrolloffgain; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE_FUNCTIONS + { + public DSP_ALLOC_FUNC alloc; + public DSP_REALLOC_FUNC realloc; + public DSP_FREE_FUNC free; + public DSP_GETSAMPLERATE_FUNC getsamplerate; + public DSP_GETBLOCKSIZE_FUNC getblocksize; + public IntPtr dft; + public IntPtr pan; + public DSP_GETSPEAKERMODE_FUNC getspeakermode; + public DSP_GETCLOCK_FUNC getclock; + public DSP_GETLISTENERATTRIBUTES_FUNC getlistenerattributes; + public DSP_LOG_FUNC log; + public DSP_GETUSERDATA_FUNC getuserdata; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_STATE + { + public IntPtr instance; + public IntPtr plugindata; + public uint channelmask; + public int source_speakermode; + public IntPtr sidechaindata; + public int sidechainchannels; + public IntPtr functions; + public int systemobject; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DSP_METERING_INFO + { + public int numsamples; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] + public float[] peaklevel; + [MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] + public float[] rmslevel; + public short numchannels; + } + + /* + ============================================================================================================== + + FMOD built in effect parameters. + Use DSP::setParameter with these enums for the 'index' parameter. + + ============================================================================================================== + */ + + public enum DSP_OSCILLATOR : int + { + TYPE, + RATE + } + + public enum DSP_LOWPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_ITLOWPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_HIGHPASS : int + { + CUTOFF, + RESONANCE + } + + public enum DSP_ECHO : int + { + DELAY, + FEEDBACK, + DRYLEVEL, + WETLEVEL + } + + public enum DSP_FADER : int + { + GAIN, + OVERALL_GAIN, + } + + public enum DSP_DELAY : int + { + CH0, + CH1, + CH2, + CH3, + CH4, + CH5, + CH6, + CH7, + CH8, + CH9, + CH10, + CH11, + CH12, + CH13, + CH14, + CH15, + MAXDELAY, + } + + public enum DSP_FLANGE : int + { + MIX, + DEPTH, + RATE + } + + public enum DSP_TREMOLO : int + { + FREQUENCY, + DEPTH, + SHAPE, + SKEW, + DUTY, + SQUARE, + PHASE, + SPREAD + } + + public enum DSP_DISTORTION : int + { + LEVEL + } + + public enum DSP_NORMALIZE : int + { + FADETIME, + THRESHHOLD, + MAXAMP + } + + public enum DSP_LIMITER : int + { + RELEASETIME, + CEILING, + MAXIMIZERGAIN, + MODE, + } + + public enum DSP_PARAMEQ : int + { + CENTER, + BANDWIDTH, + GAIN + } + + public enum DSP_MULTIBAND_EQ : int + { + A_FILTER, + A_FREQUENCY, + A_Q, + A_GAIN, + B_FILTER, + B_FREQUENCY, + B_Q, + B_GAIN, + C_FILTER, + C_FREQUENCY, + C_Q, + C_GAIN, + D_FILTER, + D_FREQUENCY, + D_Q, + D_GAIN, + E_FILTER, + E_FREQUENCY, + E_Q, + E_GAIN, + } + + public enum DSP_MULTIBAND_EQ_FILTER_TYPE : int + { + DISABLED, + LOWPASS_12DB, + LOWPASS_24DB, + LOWPASS_48DB, + HIGHPASS_12DB, + HIGHPASS_24DB, + HIGHPASS_48DB, + LOWSHELF, + HIGHSHELF, + PEAKING, + BANDPASS, + NOTCH, + ALLPASS, + } + + public enum DSP_PITCHSHIFT : int + { + PITCH, + FFTSIZE, + OVERLAP, + MAXCHANNELS + } + + public enum DSP_CHORUS : int + { + MIX, + RATE, + DEPTH, + } + + public enum DSP_ITECHO : int + { + WETDRYMIX, + FEEDBACK, + LEFTDELAY, + RIGHTDELAY, + PANDELAY + } + + public enum DSP_COMPRESSOR : int + { + THRESHOLD, + RATIO, + ATTACK, + RELEASE, + GAINMAKEUP, + USESIDECHAIN, + LINKED + } + + public enum DSP_SFXREVERB : int + { + DECAYTIME, + EARLYDELAY, + LATEDELAY, + HFREFERENCE, + HFDECAYRATIO, + DIFFUSION, + DENSITY, + LOWSHELFFREQUENCY, + LOWSHELFGAIN, + HIGHCUT, + EARLYLATEMIX, + WETLEVEL, + DRYLEVEL + } + + public enum DSP_LOWPASS_SIMPLE : int + { + CUTOFF + } + + public enum DSP_SEND : int + { + RETURNID, + LEVEL, + } + + public enum DSP_RETURN : int + { + ID, + INPUT_SPEAKER_MODE + } + + public enum DSP_HIGHPASS_SIMPLE : int + { + CUTOFF + } + + public enum DSP_PAN_2D_STEREO_MODE_TYPE : int + { + DISTRIBUTED, + DISCRETE + } + + public enum DSP_PAN_MODE_TYPE : int + { + MONO, + STEREO, + SURROUND + } + + public enum DSP_PAN_3D_ROLLOFF_TYPE : int + { + LINEARSQUARED, + LINEAR, + INVERSE, + INVERSETAPERED, + CUSTOM + } + + public enum DSP_PAN_3D_EXTENT_MODE_TYPE : int + { + AUTO, + USER, + OFF + } + + public enum DSP_PAN : int + { + MODE, + _2D_STEREO_POSITION, + _2D_DIRECTION, + _2D_EXTENT, + _2D_ROTATION, + _2D_LFE_LEVEL, + _2D_STEREO_MODE, + _2D_STEREO_SEPARATION, + _2D_STEREO_AXIS, + ENABLED_SPEAKERS, + _3D_POSITION, + _3D_ROLLOFF, + _3D_MIN_DISTANCE, + _3D_MAX_DISTANCE, + _3D_EXTENT_MODE, + _3D_SOUND_SIZE, + _3D_MIN_EXTENT, + _3D_PAN_BLEND, + LFE_UPMIX_ENABLED, + OVERALL_GAIN, + SURROUND_SPEAKER_MODE, + _2D_HEIGHT_BLEND, + } + + public enum DSP_THREE_EQ_CROSSOVERSLOPE_TYPE : int + { + _12DB, + _24DB, + _48DB + } + + public enum DSP_THREE_EQ : int + { + LOWGAIN, + MIDGAIN, + HIGHGAIN, + LOWCROSSOVER, + HIGHCROSSOVER, + CROSSOVERSLOPE + } + + public enum DSP_FFT_WINDOW : int + { + RECT, + TRIANGLE, + HAMMING, + HANNING, + BLACKMAN, + BLACKMANHARRIS + } + + public enum DSP_FFT : int + { + WINDOWSIZE, + WINDOWTYPE, + SPECTRUMDATA, + DOMINANT_FREQ + } + + public enum DSP_ENVELOPEFOLLOWER : int + { + ATTACK, + RELEASE, + ENVELOPE, + USESIDECHAIN + } + + public enum DSP_CONVOLUTION_REVERB : int + { + IR, + WET, + DRY, + LINKED + } + + public enum DSP_CHANNELMIX_OUTPUT : int + { + DEFAULT, + ALLMONO, + ALLSTEREO, + ALLQUAD, + ALL5POINT1, + ALL7POINT1, + ALLLFE, + ALL7POINT1POINT4 + } + + public enum DSP_CHANNELMIX : int + { + OUTPUTGROUPING, + GAIN_CH0, + GAIN_CH1, + GAIN_CH2, + GAIN_CH3, + GAIN_CH4, + GAIN_CH5, + GAIN_CH6, + GAIN_CH7, + GAIN_CH8, + GAIN_CH9, + GAIN_CH10, + GAIN_CH11, + GAIN_CH12, + GAIN_CH13, + GAIN_CH14, + GAIN_CH15, + GAIN_CH16, + GAIN_CH17, + GAIN_CH18, + GAIN_CH19, + GAIN_CH20, + GAIN_CH21, + GAIN_CH22, + GAIN_CH23, + GAIN_CH24, + GAIN_CH25, + GAIN_CH26, + GAIN_CH27, + GAIN_CH28, + GAIN_CH29, + GAIN_CH30, + GAIN_CH31, + OUTPUT_CH0, + OUTPUT_CH1, + OUTPUT_CH2, + OUTPUT_CH3, + OUTPUT_CH4, + OUTPUT_CH5, + OUTPUT_CH6, + OUTPUT_CH7, + OUTPUT_CH8, + OUTPUT_CH9, + OUTPUT_CH10, + OUTPUT_CH11, + OUTPUT_CH12, + OUTPUT_CH13, + OUTPUT_CH14, + OUTPUT_CH15, + OUTPUT_CH16, + OUTPUT_CH17, + OUTPUT_CH18, + OUTPUT_CH19, + OUTPUT_CH20, + OUTPUT_CH21, + OUTPUT_CH22, + OUTPUT_CH23, + OUTPUT_CH24, + OUTPUT_CH25, + OUTPUT_CH26, + OUTPUT_CH27, + OUTPUT_CH28, + OUTPUT_CH29, + OUTPUT_CH30, + OUTPUT_CH31, + } + + public enum DSP_TRANSCEIVER_SPEAKERMODE : int + { + AUTO = -1, + MONO = 0, + STEREO, + SURROUND, + } + + public enum DSP_TRANSCEIVER : int + { + TRANSMIT, + GAIN, + CHANNEL, + TRANSMITSPEAKERMODE + } + + public enum DSP_OBJECTPAN : int + { + _3D_POSITION, + _3D_ROLLOFF, + _3D_MIN_DISTANCE, + _3D_MAX_DISTANCE, + _3D_EXTENT_MODE, + _3D_SOUND_SIZE, + _3D_MIN_EXTENT, + OVERALL_GAIN, + OUTPUTGAIN + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_dsp.cs.meta b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_dsp.cs.meta new file mode 100644 index 0000000..53e10b4 --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_dsp.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b7b10c26cf550794183b926ffae615a7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_errors.cs b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_errors.cs new file mode 100644 index 0000000..b50ca5e --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_errors.cs @@ -0,0 +1,106 @@ +/* ============================================================================================== */ +/* FMOD Core / Studio API - Error string header file. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2020. */ +/* */ +/* Use this header if you want to store or display a string version / english explanation */ +/* of the FMOD error codes. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api-common.html#fmod_result */ +/* =============================================================================================== */ + +namespace FMOD +{ + public class Error + { + public static string String(FMOD.RESULT errcode) + { + switch (errcode) + { + case FMOD.RESULT.OK: return "No errors."; + case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound)."; + case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel."; + case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound."; + case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information."; + case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts."; + case FMOD.RESULT.ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph."; + case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map."; + case FMOD.RESULT.ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released."; + case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified."; + case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system."; + case FMOD.RESULT.ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph."; + case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type."; + case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file."; + case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format."; + case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading."; + case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?)."; + case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data."; + case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found."; + case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format."; + case FMOD.RESULT.ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library."; + case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere."; + case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden."; + case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource."; + case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred."; + case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out."; + case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function."; + case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init."; + case FMOD.RESULT.ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support."; + case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float."; + case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used."; + case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function."; + case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function."; + case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode."; + case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle."; + case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported."; + case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular."; + case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup."; + case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources."; + case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used."; + case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound."; + case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support."; + case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host."; + case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere."; + case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved."; + case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately."; + case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready."; + case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused."; + case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer."; + case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted."; + case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format."; + case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device."; + case FMOD.RESULT.ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails."; + case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin."; + case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available."; + case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)"; + case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version."; + case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device."; + case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection."; + case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist."; + case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound."; + case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first."; + case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file."; + case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags."; + case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat."; + case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated."; + case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!"; + case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called."; + case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified."; + case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported."; + case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool."; + case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out."; + case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found."; + case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized."; + case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded."; + case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function."; + case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked."; + case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked."; + case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected."; + case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit."; + default: return "Unknown error."; + } + } + } +} diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_errors.cs.meta b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_errors.cs.meta new file mode 100644 index 0000000..a22cd1c --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_errors.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6e0992509b0077e479d2da05c8f52eb0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_studio.cs b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_studio.cs new file mode 100644 index 0000000..8ffef2b --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_studio.cs @@ -0,0 +1,2027 @@ +/* ======================================================================================== */ +/* FMOD Studio API - C# wrapper. */ +/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2020. */ +/* */ +/* For more detail visit: */ +/* https://fmod.com/resources/documentation-api?version=2.0&page=page=studio-api.html */ +/* ======================================================================================== */ + +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections; + +namespace FMOD.Studio +{ + public class STUDIO_VERSION + { +#if (UNITY_IPHONE || UNITY_TVOS || UNITY_SWITCH || UNITY_WEBGL) && !UNITY_EDITOR + public const string dll = "__Internal"; +#elif (UNITY_PS4) && DEVELOPMENT_BUILD + public const string dll = "libfmodstudioL"; +#elif (UNITY_PS4 || UNITY_WIIU || UNITY_PSP2) && !UNITY_EDITOR + public const string dll = "libfmodstudio"; +#elif UNITY_EDITOR || ((UNITY_STANDALONE || UNITY_WSA || UNITY_ANDROID || UNITY_XBOXONE || UNITY_STADIA) && DEVELOPMENT_BUILD) + public const string dll = "fmodstudioL"; +#else + public const string dll = "fmodstudio"; +#endif + } + + public enum STOP_MODE : int + { + ALLOWFADEOUT, + IMMEDIATE, + } + + public enum LOADING_STATE : int + { + UNLOADING, + UNLOADED, + LOADING, + LOADED, + ERROR, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PROGRAMMER_SOUND_PROPERTIES + { + public StringWrapper name; + public IntPtr sound; + public int subsoundIndex; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_MARKER_PROPERTIES + { + public StringWrapper name; + public int position; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TIMELINE_BEAT_PROPERTIES + { + public int bar; + public int beat; + public int position; + public float tempo; + public int timesignatureupper; + public int timesignaturelower; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ADVANCEDSETTINGS + { + public int cbsize; + public int commandqueuesize; + public int handleinitialsize; + public int studioupdateperiod; + public int idlesampledatapoolsize; + public int streamingscheduledelay; + public IntPtr encryptionkey; + } + + [StructLayout(LayoutKind.Sequential)] + public struct CPU_USAGE + { + public float dspusage; + public float streamusage; + public float geometryusage; + public float updateusage; + public float studiousage; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BUFFER_INFO + { + public int currentusage; + public int peakusage; + public int capacity; + public int stallcount; + public float stalltime; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BUFFER_USAGE + { + public BUFFER_INFO studiocommandqueue; + public BUFFER_INFO studiohandle; + } + + [StructLayout(LayoutKind.Sequential)] + public struct BANK_INFO + { + public int size; + public IntPtr userdata; + public int userdatalength; + public FILE_OPEN_CALLBACK opencallback; + public FILE_CLOSE_CALLBACK closecallback; + public FILE_READ_CALLBACK readcallback; + public FILE_SEEK_CALLBACK seekcallback; + } + + [Flags] + public enum SYSTEM_CALLBACK_TYPE : uint + { + PREUPDATE = 0x00000001, + POSTUPDATE = 0x00000002, + BANK_UNLOAD = 0x00000004, + ALL = 0xFFFFFFFF, + } + + public delegate RESULT SYSTEM_CALLBACK(IntPtr system, SYSTEM_CALLBACK_TYPE type, IntPtr commanddata, IntPtr userdata); + + public enum PARAMETER_TYPE : int + { + GAME_CONTROLLED, + AUTOMATIC_DISTANCE, + AUTOMATIC_EVENT_CONE_ANGLE, + AUTOMATIC_EVENT_ORIENTATION, + AUTOMATIC_DIRECTION, + AUTOMATIC_ELEVATION, + AUTOMATIC_LISTENER_ORIENTATION, + AUTOMATIC_SPEED, + MAX + } + + [Flags] + public enum PARAMETER_FLAGS : uint + { + READONLY = 0x00000001, + AUTOMATIC = 0x00000002, + GLOBAL = 0x00000004, + } + + [StructLayout(LayoutKind.Sequential)] + public struct PARAMETER_ID + { + public uint data1; + public uint data2; + } + + [StructLayout(LayoutKind.Sequential)] + public struct PARAMETER_DESCRIPTION + { + public StringWrapper name; + public PARAMETER_ID id; + public float minimum; + public float maximum; + public float defaultvalue; + public PARAMETER_TYPE type; + public PARAMETER_FLAGS flags; + } + + // This is only need for loading memory and given our C# wrapper LOAD_MEMORY_POINT isn't feasible anyway + enum LOAD_MEMORY_MODE : int + { + LOAD_MEMORY, + LOAD_MEMORY_POINT, + } + + enum LOAD_MEMORY_ALIGNMENT : int + { + VALUE = 32 + } + + [StructLayout(LayoutKind.Sequential)] + public struct SOUND_INFO + { + public IntPtr name_or_data; + public MODE mode; + public CREATESOUNDEXINFO exinfo; + public int subsoundindex; + + public string name + { + get + { + using (StringHelper.ThreadSafeEncoding encoding = StringHelper.GetFreeHelper()) + { + return ((mode & (MODE.OPENMEMORY | MODE.OPENMEMORY_POINT)) == 0) ? encoding.stringFromNative(name_or_data) : String.Empty; + } + } + } + } + + public enum USER_PROPERTY_TYPE : int + { + INTEGER, + BOOLEAN, + FLOAT, + STRING, + } + + [StructLayout(LayoutKind.Sequential)] + public struct USER_PROPERTY + { + public StringWrapper name; + public USER_PROPERTY_TYPE type; + private Union_IntBoolFloatString value; + + public int intValue() { return (type == USER_PROPERTY_TYPE.INTEGER) ? value.intvalue : -1; } + public bool boolValue() { return (type == USER_PROPERTY_TYPE.BOOLEAN) ? value.boolvalue : false; } + public float floatValue() { return (type == USER_PROPERTY_TYPE.FLOAT) ? value.floatvalue : -1; } + public string stringValue() { return (type == USER_PROPERTY_TYPE.STRING) ? value.stringvalue : ""; } + }; + + [StructLayout(LayoutKind.Explicit)] + struct Union_IntBoolFloatString + { + [FieldOffset(0)] + public int intvalue; + [FieldOffset(0)] + public bool boolvalue; + [FieldOffset(0)] + public float floatvalue; + [FieldOffset(0)] + public StringWrapper stringvalue; + } + + [Flags] + public enum INITFLAGS : uint + { + NORMAL = 0x00000000, + LIVEUPDATE = 0x00000001, + ALLOW_MISSING_PLUGINS = 0x00000002, + SYNCHRONOUS_UPDATE = 0x00000004, + DEFERRED_CALLBACKS = 0x00000008, + LOAD_FROM_UPDATE = 0x00000010, + MEMORY_TRACKING = 0x00000020, + } + + [Flags] + public enum LOAD_BANK_FLAGS : uint + { + NORMAL = 0x00000000, + NONBLOCKING = 0x00000001, + DECOMPRESS_SAMPLES = 0x00000002, + UNENCRYPTED = 0x00000004, + } + + [Flags] + public enum COMMANDCAPTURE_FLAGS : uint + { + NORMAL = 0x00000000, + FILEFLUSH = 0x00000001, + SKIP_INITIAL_STATE = 0x00000002, + } + + [Flags] + public enum COMMANDREPLAY_FLAGS : uint + { + NORMAL = 0x00000000, + SKIP_CLEANUP = 0x00000001, + FAST_FORWARD = 0x00000002, + SKIP_BANK_LOAD = 0x00000004, + } + + public enum PLAYBACK_STATE : int + { + PLAYING, + SUSTAINING, + STOPPED, + STARTING, + STOPPING, + } + + public enum EVENT_PROPERTY : int + { + CHANNELPRIORITY, + SCHEDULE_DELAY, + SCHEDULE_LOOKAHEAD, + MINIMUM_DISTANCE, + MAXIMUM_DISTANCE, + COOLDOWN, + MAX + }; + + [StructLayout(LayoutKind.Sequential)] + public struct PLUGIN_INSTANCE_PROPERTIES + { + public IntPtr name; + public IntPtr dsp; + } + + [Flags] + public enum EVENT_CALLBACK_TYPE : uint + { + CREATED = 0x00000001, + DESTROYED = 0x00000002, + STARTING = 0x00000004, + STARTED = 0x00000008, + RESTARTED = 0x00000010, + STOPPED = 0x00000020, + START_FAILED = 0x00000040, + CREATE_PROGRAMMER_SOUND = 0x00000080, + DESTROY_PROGRAMMER_SOUND = 0x00000100, + PLUGIN_CREATED = 0x00000200, + PLUGIN_DESTROYED = 0x00000400, + TIMELINE_MARKER = 0x00000800, + TIMELINE_BEAT = 0x00001000, + SOUND_PLAYED = 0x00002000, + SOUND_STOPPED = 0x00004000, + REAL_TO_VIRTUAL = 0x00008000, + VIRTUAL_TO_REAL = 0x00010000, + + ALL = 0xFFFFFFFF, + } + + public delegate RESULT EVENT_CALLBACK(EVENT_CALLBACK_TYPE type, EventInstance _event, IntPtr parameters); + + public delegate RESULT COMMANDREPLAY_FRAME_CALLBACK(CommandReplay replay, int commandindex, float currenttime, IntPtr userdata); + public delegate RESULT COMMANDREPLAY_LOAD_BANK_CALLBACK(CommandReplay replay, int commandindex, Guid bankguid, StringWrapper bankfilename, LOAD_BANK_FLAGS flags, out Bank bank, IntPtr userdata); + public delegate RESULT COMMANDREPLAY_CREATE_INSTANCE_CALLBACK(CommandReplay replay, int commandindex, EventDescription eventdescription, out EventInstance instance, IntPtr userdata); + + public enum INSTANCETYPE : int + { + NONE, + SYSTEM, + EVENTDESCRIPTION, + EVENTINSTANCE, + PARAMETERINSTANCE, + BUS, + VCA, + BANK, + COMMANDREPLAY, + } + + [StructLayout(LayoutKind.Sequential)] + public struct COMMAND_INFO + { + public StringWrapper commandname; + public int parentcommandindex; + public int framenumber; + public float frametime; + public INSTANCETYPE instancetype; + public INSTANCETYPE outputtype; + public UInt32 instancehandle; + public UInt32 outputhandle; + } + + [StructLayout(LayoutKind.Sequential)] + public struct MEMORY_USAGE + { + public int exclusive; + public int inclusive; + public int sampledata; + } + + public struct Util + { + public static RESULT parseID(string idString, out Guid id) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_ParseID(encoder.byteFromStringUTF8(idString), out id); + } + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_ParseID(byte[] idString, out Guid id); + #endregion + } + + public struct System + { + // Initialization / system functions. + public static RESULT create(out System system) + { + return FMOD_Studio_System_Create(out system.handle, VERSION.number); + } + public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings) + { + settings.cbsize = Marshal.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD_Studio_System_SetAdvancedSettings(this.handle, ref settings); + } + public RESULT setAdvancedSettings(ADVANCEDSETTINGS settings, string encryptionKey) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr userKey = settings.encryptionkey; + settings.encryptionkey = encoder.intptrFromStringUTF8(encryptionKey); + FMOD.RESULT result = setAdvancedSettings(settings); + settings.encryptionkey = userKey; + return result; + } + } + public RESULT getAdvancedSettings(out ADVANCEDSETTINGS settings) + { + settings.cbsize = Marshal.SizeOf(typeof(ADVANCEDSETTINGS)); + return FMOD_Studio_System_GetAdvancedSettings(this.handle, out settings); + } + public RESULT initialize(int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata) + { + return FMOD_Studio_System_Initialize(this.handle, maxchannels, studioflags, flags, extradriverdata); + } + public RESULT release() + { + return FMOD_Studio_System_Release(this.handle); + } + public RESULT update() + { + return FMOD_Studio_System_Update(this.handle); + } + public RESULT getCoreSystem(out FMOD.System coresystem) + { + return FMOD_Studio_System_GetCoreSystem(this.handle, out coresystem.handle); + } + public RESULT getEvent(string path, out EventDescription _event) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetEvent(this.handle, encoder.byteFromStringUTF8(path), out _event.handle); + } + } + public RESULT getBus(string path, out Bus bus) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetBus(this.handle, encoder.byteFromStringUTF8(path), out bus.handle); + } + } + public RESULT getVCA(string path, out VCA vca) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetVCA(this.handle, encoder.byteFromStringUTF8(path), out vca.handle); + } + } + public RESULT getBank(string path, out Bank bank) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetBank(this.handle, encoder.byteFromStringUTF8(path), out bank.handle); + } + } + + public RESULT getEventByID(Guid id, out EventDescription _event) + { + return FMOD_Studio_System_GetEventByID(this.handle, ref id, out _event.handle); + } + public RESULT getBusByID(Guid id, out Bus bus) + { + return FMOD_Studio_System_GetBusByID(this.handle, ref id, out bus.handle); + } + public RESULT getVCAByID(Guid id, out VCA vca) + { + return FMOD_Studio_System_GetVCAByID(this.handle, ref id, out vca.handle); + } + public RESULT getBankByID(Guid id, out Bank bank) + { + return FMOD_Studio_System_GetBankByID(this.handle, ref id, out bank.handle); + } + public RESULT getSoundInfo(string key, out SOUND_INFO info) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetSoundInfo(this.handle, encoder.byteFromStringUTF8(key), out info); + } + } + public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); + } + } + public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_System_GetParameterDescriptionByID(this.handle, id, out parameter); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value) + { + float finalValue; + return getParameterByID(id, out value, out finalValue); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) + { + return FMOD_Studio_System_GetParameterByID(this.handle, id, out value, out finalvalue); + } + public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + return FMOD_Studio_System_SetParameterByID(this.handle, id, value, ignoreseekspeed); + } + public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) + { + return FMOD_Studio_System_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); + } + public RESULT getParameterByName(string name, out float value) + { + float finalValue; + return getParameterByName(name, out value, out finalValue); + } + public RESULT getParameterByName(string name, out float value, out float finalvalue) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); + } + } + public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); + } + } + public RESULT lookupID(string path, out Guid id) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LookupID(this.handle, encoder.byteFromStringUTF8(path), out id); + } + } + public RESULT lookupPath(Guid id, out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_System_LookupPath(this.handle, ref id, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getNumListeners(out int numlisteners) + { + return FMOD_Studio_System_GetNumListeners(this.handle, out numlisteners); + } + public RESULT setNumListeners(int numlisteners) + { + return FMOD_Studio_System_SetNumListeners(this.handle, numlisteners); + } + public RESULT getListenerAttributes(int listener, out ATTRIBUTES_3D attributes) + { + return FMOD_Studio_System_GetListenerAttributes(this.handle, listener, out attributes); + } + public RESULT setListenerAttributes(int listener, ATTRIBUTES_3D attributes) + { + return FMOD_Studio_System_SetListenerAttributes(this.handle, listener, ref attributes); + } + public RESULT getListenerWeight(int listener, out float weight) + { + return FMOD_Studio_System_GetListenerWeight(this.handle, listener, out weight); + } + public RESULT setListenerWeight(int listener, float weight) + { + return FMOD_Studio_System_SetListenerWeight(this.handle, listener, weight); + } + public RESULT loadBankFile(string filename, LOAD_BANK_FLAGS flags, out Bank bank) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LoadBankFile(this.handle, encoder.byteFromStringUTF8(filename), flags, out bank.handle); + } + } + public RESULT loadBankMemory(byte[] buffer, LOAD_BANK_FLAGS flags, out Bank bank) + { + // Manually pin the byte array. It's what the marshaller should do anyway but don't leave it to chance. + GCHandle pinnedArray = GCHandle.Alloc(buffer, GCHandleType.Pinned); + IntPtr pointer = pinnedArray.AddrOfPinnedObject(); + RESULT result = FMOD_Studio_System_LoadBankMemory(this.handle, pointer, buffer.Length, LOAD_MEMORY_MODE.LOAD_MEMORY, flags, out bank.handle); + pinnedArray.Free(); + return result; + } + public RESULT loadBankCustom(BANK_INFO info, LOAD_BANK_FLAGS flags, out Bank bank) + { + info.size = Marshal.SizeOf(info); + return FMOD_Studio_System_LoadBankCustom(this.handle, ref info, flags, out bank.handle); + } + public RESULT unloadAll() + { + return FMOD_Studio_System_UnloadAll(this.handle); + } + public RESULT flushCommands() + { + return FMOD_Studio_System_FlushCommands(this.handle); + } + public RESULT flushSampleLoading() + { + return FMOD_Studio_System_FlushSampleLoading(this.handle); + } + public RESULT startCommandCapture(string filename, COMMANDCAPTURE_FLAGS flags) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_StartCommandCapture(this.handle, encoder.byteFromStringUTF8(filename), flags); + } + } + public RESULT stopCommandCapture() + { + return FMOD_Studio_System_StopCommandCapture(this.handle); + } + public RESULT loadCommandReplay(string filename, COMMANDREPLAY_FLAGS flags, out CommandReplay replay) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_System_LoadCommandReplay(this.handle, encoder.byteFromStringUTF8(filename), flags, out replay.handle); + } + } + public RESULT getBankCount(out int count) + { + return FMOD_Studio_System_GetBankCount(this.handle, out count); + } + public RESULT getBankList(out Bank[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_System_GetBankCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new Bank[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_System_GetBankList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new Bank[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getParameterDescriptionCount(out int count) + { + return FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out count); + } + public RESULT getParameterDescriptionList(out PARAMETER_DESCRIPTION[] array) + { + array = null; + + int capacity; + RESULT result = FMOD_Studio_System_GetParameterDescriptionCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new PARAMETER_DESCRIPTION[0]; + return RESULT.OK; + } + + PARAMETER_DESCRIPTION[] tempArray = new PARAMETER_DESCRIPTION[capacity]; + int actualCount; + result = FMOD_Studio_System_GetParameterDescriptionList(this.handle, tempArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + + if (actualCount != capacity) + { + Array.Resize(ref tempArray, actualCount); + } + + array = tempArray; + + return RESULT.OK; + } + public RESULT getCPUUsage(out CPU_USAGE usage) + { + return FMOD_Studio_System_GetCPUUsage(this.handle, out usage); + } + public RESULT getBufferUsage(out BUFFER_USAGE usage) + { + return FMOD_Studio_System_GetBufferUsage(this.handle, out usage); + } + public RESULT resetBufferUsage() + { + return FMOD_Studio_System_ResetBufferUsage(this.handle); + } + + public RESULT setCallback(SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask = SYSTEM_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_System_SetCallback(this.handle, callback, callbackmask); + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_System_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_System_SetUserData(this.handle, userdata); + } + + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_System_GetMemoryUsage(this.handle, out memoryusage); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Create (out IntPtr system, uint headerversion); + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_System_IsValid (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetAdvancedSettings (IntPtr system, ref ADVANCEDSETTINGS settings); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetAdvancedSettings (IntPtr system, out ADVANCEDSETTINGS settings); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Initialize (IntPtr system, int maxchannels, INITFLAGS studioflags, FMOD.INITFLAGS flags, IntPtr extradriverdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Release (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_Update (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetCoreSystem (IntPtr system, out IntPtr coresystem); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetEvent (IntPtr system, byte[] path, out IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBus (IntPtr system, byte[] path, out IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetVCA (IntPtr system, byte[] path, out IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBank (IntPtr system, byte[] path, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetEventByID (IntPtr system, ref Guid id, out IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBusByID (IntPtr system, ref Guid id, out IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetVCAByID (IntPtr system, ref Guid id, out IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankByID (IntPtr system, ref Guid id, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetSoundInfo (IntPtr system, byte[] key, out SOUND_INFO info); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByName(IntPtr system, byte[] name, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionByID(IntPtr system, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterByID (IntPtr system, PARAMETER_ID id, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByID (IntPtr system, PARAMETER_ID id, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParametersByIDs (IntPtr system, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterByName (IntPtr system, byte[] name, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetParameterByName (IntPtr system, byte[] name, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LookupID (IntPtr system, byte[] path, out Guid id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LookupPath (IntPtr system, ref Guid id, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetNumListeners (IntPtr system, out int numlisteners); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetNumListeners (IntPtr system, int numlisteners); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerAttributes (IntPtr system, int listener, out ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerAttributes (IntPtr system, int listener, ref ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetListenerWeight (IntPtr system, int listener, out float weight); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetListenerWeight (IntPtr system, int listener, float weight); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankFile (IntPtr system, byte[] filename, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankMemory (IntPtr system, IntPtr buffer, int length, LOAD_MEMORY_MODE mode, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadBankCustom (IntPtr system, ref BANK_INFO info, LOAD_BANK_FLAGS flags, out IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_UnloadAll (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_FlushCommands (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_FlushSampleLoading (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_StartCommandCapture (IntPtr system, byte[] filename, COMMANDCAPTURE_FLAGS flags); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_StopCommandCapture (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_LoadCommandReplay (IntPtr system, byte[] filename, COMMANDREPLAY_FLAGS flags, out IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankCount (IntPtr system, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBankList (IntPtr system, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionCount(IntPtr system, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetParameterDescriptionList(IntPtr system, [Out] PARAMETER_DESCRIPTION[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetCPUUsage (IntPtr system, out CPU_USAGE usage); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetBufferUsage (IntPtr system, out BUFFER_USAGE usage); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_ResetBufferUsage (IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetCallback (IntPtr system, SYSTEM_CALLBACK callback, SYSTEM_CALLBACK_TYPE callbackmask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetUserData (IntPtr system, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_SetUserData (IntPtr system, IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_System_GetMemoryUsage (IntPtr system, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_System_IsValid(this.handle); + } + + #endregion + } + + public struct EventDescription + { + public RESULT getID(out Guid id) + { + return FMOD_Studio_EventDescription_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_EventDescription_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getParameterDescriptionCount(out int count) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionCount(this.handle, out count); + } + public RESULT getParameterDescriptionByIndex(int index, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(this.handle, index, out parameter); + } + public RESULT getParameterDescriptionByName(string name, out PARAMETER_DESCRIPTION parameter) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByName(this.handle, encoder.byteFromStringUTF8(name), out parameter); + } + } + public RESULT getParameterDescriptionByID(PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter) + { + return FMOD_Studio_EventDescription_GetParameterDescriptionByID(this.handle, id, out parameter); + } + public RESULT getUserPropertyCount(out int count) + { + return FMOD_Studio_EventDescription_GetUserPropertyCount(this.handle, out count); + } + public RESULT getUserPropertyByIndex(int index, out USER_PROPERTY property) + { + return FMOD_Studio_EventDescription_GetUserPropertyByIndex(this.handle, index, out property); + } + public RESULT getUserProperty(string name, out USER_PROPERTY property) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventDescription_GetUserProperty(this.handle, encoder.byteFromStringUTF8(name), out property); + } + } + public RESULT getLength(out int length) + { + return FMOD_Studio_EventDescription_GetLength(this.handle, out length); + } + public RESULT getMinimumDistance(out float distance) + { + return FMOD_Studio_EventDescription_GetMinimumDistance(this.handle, out distance); + } + public RESULT getMaximumDistance(out float distance) + { + return FMOD_Studio_EventDescription_GetMaximumDistance(this.handle, out distance); + } + public RESULT getSoundSize(out float size) + { + return FMOD_Studio_EventDescription_GetSoundSize(this.handle, out size); + } + public RESULT isSnapshot(out bool snapshot) + { + return FMOD_Studio_EventDescription_IsSnapshot(this.handle, out snapshot); + } + public RESULT isOneshot(out bool oneshot) + { + return FMOD_Studio_EventDescription_IsOneshot(this.handle, out oneshot); + } + public RESULT isStream(out bool isStream) + { + return FMOD_Studio_EventDescription_IsStream(this.handle, out isStream); + } + public RESULT is3D(out bool is3D) + { + return FMOD_Studio_EventDescription_Is3D(this.handle, out is3D); + } + public RESULT hasCue(out bool cue) + { + return FMOD_Studio_EventDescription_HasCue(this.handle, out cue); + } + + public RESULT createInstance(out EventInstance instance) + { + return FMOD_Studio_EventDescription_CreateInstance(this.handle, out instance.handle); + } + + public RESULT getInstanceCount(out int count) + { + return FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out count); + } + public RESULT getInstanceList(out EventInstance[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_EventDescription_GetInstanceCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new EventInstance[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_EventDescription_GetInstanceList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new EventInstance[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + + public RESULT loadSampleData() + { + return FMOD_Studio_EventDescription_LoadSampleData(this.handle); + } + + public RESULT unloadSampleData() + { + return FMOD_Studio_EventDescription_UnloadSampleData(this.handle); + } + + public RESULT getSampleLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_EventDescription_GetSampleLoadingState(this.handle, out state); + } + + public RESULT releaseAllInstances() + { + return FMOD_Studio_EventDescription_ReleaseAllInstances(this.handle); + } + public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_EventDescription_SetCallback(this.handle, callback, callbackmask); + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_EventDescription_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_EventDescription_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_EventDescription_IsValid (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetID (IntPtr eventdescription, out Guid id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetPath (IntPtr eventdescription, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionCount(IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByIndex(IntPtr eventdescription, int index, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByName(IntPtr eventdescription, byte[] name, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetParameterDescriptionByID(IntPtr eventdescription, PARAMETER_ID id, out PARAMETER_DESCRIPTION parameter); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyCount (IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserPropertyByIndex(IntPtr eventdescription, int index, out USER_PROPERTY property); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserProperty (IntPtr eventdescription, byte[] name, out USER_PROPERTY property); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetLength (IntPtr eventdescription, out int length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetMinimumDistance (IntPtr eventdescription, out float distance); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetMaximumDistance (IntPtr eventdescription, out float distance); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetSoundSize (IntPtr eventdescription, out float size); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsSnapshot (IntPtr eventdescription, out bool snapshot); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsOneshot (IntPtr eventdescription, out bool oneshot); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_IsStream (IntPtr eventdescription, out bool isStream); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_Is3D (IntPtr eventdescription, out bool is3D); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_HasCue (IntPtr eventdescription, out bool cue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_CreateInstance (IntPtr eventdescription, out IntPtr instance); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetInstanceCount (IntPtr eventdescription, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetInstanceList (IntPtr eventdescription, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_LoadSampleData (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_UnloadSampleData (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetSampleLoadingState (IntPtr eventdescription, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_ReleaseAllInstances (IntPtr eventdescription); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_SetCallback (IntPtr eventdescription, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_GetUserData (IntPtr eventdescription, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventDescription_SetUserData (IntPtr eventdescription, IntPtr userdata); + #endregion + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_EventDescription_IsValid(this.handle); + } + + #endregion + } + + public struct EventInstance + { + public RESULT getDescription(out EventDescription description) + { + return FMOD_Studio_EventInstance_GetDescription(this.handle, out description.handle); + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_EventInstance_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_EventInstance_SetVolume(this.handle, volume); + } + public RESULT getPitch(out float pitch) + { + float finalPitch; + return getPitch(out pitch, out finalPitch); + } + public RESULT getPitch(out float pitch, out float finalpitch) + { + return FMOD_Studio_EventInstance_GetPitch(this.handle, out pitch, out finalpitch); + } + public RESULT setPitch(float pitch) + { + return FMOD_Studio_EventInstance_SetPitch(this.handle, pitch); + } + public RESULT get3DAttributes(out ATTRIBUTES_3D attributes) + { + return FMOD_Studio_EventInstance_Get3DAttributes(this.handle, out attributes); + } + public RESULT set3DAttributes(ATTRIBUTES_3D attributes) + { + return FMOD_Studio_EventInstance_Set3DAttributes(this.handle, ref attributes); + } + public RESULT getListenerMask(out uint mask) + { + return FMOD_Studio_EventInstance_GetListenerMask(this.handle, out mask); + } + public RESULT setListenerMask(uint mask) + { + return FMOD_Studio_EventInstance_SetListenerMask(this.handle, mask); + } + public RESULT getProperty(EVENT_PROPERTY index, out float value) + { + return FMOD_Studio_EventInstance_GetProperty(this.handle, index, out value); + } + public RESULT setProperty(EVENT_PROPERTY index, float value) + { + return FMOD_Studio_EventInstance_SetProperty(this.handle, index, value); + } + public RESULT getReverbLevel(int index, out float level) + { + return FMOD_Studio_EventInstance_GetReverbLevel(this.handle, index, out level); + } + public RESULT setReverbLevel(int index, float level) + { + return FMOD_Studio_EventInstance_SetReverbLevel(this.handle, index, level); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_EventInstance_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_EventInstance_SetPaused(this.handle, paused); + } + public RESULT start() + { + return FMOD_Studio_EventInstance_Start(this.handle); + } + public RESULT stop(STOP_MODE mode) + { + return FMOD_Studio_EventInstance_Stop(this.handle, mode); + } + public RESULT getTimelinePosition(out int position) + { + return FMOD_Studio_EventInstance_GetTimelinePosition(this.handle, out position); + } + public RESULT setTimelinePosition(int position) + { + return FMOD_Studio_EventInstance_SetTimelinePosition(this.handle, position); + } + public RESULT getPlaybackState(out PLAYBACK_STATE state) + { + return FMOD_Studio_EventInstance_GetPlaybackState(this.handle, out state); + } + public RESULT getChannelGroup(out FMOD.ChannelGroup group) + { + return FMOD_Studio_EventInstance_GetChannelGroup(this.handle, out group.handle); + } + public RESULT release() + { + return FMOD_Studio_EventInstance_Release(this.handle); + } + public RESULT isVirtual(out bool virtualstate) + { + return FMOD_Studio_EventInstance_IsVirtual(this.handle, out virtualstate); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value) + { + float finalvalue; + return getParameterByID(id, out value, out finalvalue); + } + public RESULT getParameterByID(PARAMETER_ID id, out float value, out float finalvalue) + { + return FMOD_Studio_EventInstance_GetParameterByID(this.handle, id, out value, out finalvalue); + } + public RESULT setParameterByID(PARAMETER_ID id, float value, bool ignoreseekspeed = false) + { + return FMOD_Studio_EventInstance_SetParameterByID(this.handle, id, value, ignoreseekspeed); + } + public RESULT setParametersByIDs(PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed = false) + { + return FMOD_Studio_EventInstance_SetParametersByIDs(this.handle, ids, values, count, ignoreseekspeed); + } + public RESULT getParameterByName(string name, out float value) + { + float finalValue; + return getParameterByName(name, out value, out finalValue); + } + public RESULT getParameterByName(string name, out float value, out float finalvalue) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_GetParameterByName(this.handle, encoder.byteFromStringUTF8(name), out value, out finalvalue); + } + } + public RESULT setParameterByName(string name, float value, bool ignoreseekspeed = false) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_EventInstance_SetParameterByName(this.handle, encoder.byteFromStringUTF8(name), value, ignoreseekspeed); + } + } + public RESULT triggerCue() + { + return FMOD_Studio_EventInstance_TriggerCue(this.handle); + } + public RESULT setCallback(EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask = EVENT_CALLBACK_TYPE.ALL) + { + return FMOD_Studio_EventInstance_SetCallback(this.handle, callback, callbackmask); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_EventInstance_GetUserData(this.handle, out userdata); + } + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_EventInstance_SetUserData(this.handle, userdata); + } + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD_Studio_EventInstance_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_EventInstance_GetMemoryUsage(this.handle, out memoryusage); + } + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_EventInstance_IsValid (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetDescription (IntPtr _event, out IntPtr description); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetVolume (IntPtr _event, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetVolume (IntPtr _event, float volume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPitch (IntPtr _event, out float pitch, out float finalpitch); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetPitch (IntPtr _event, float pitch); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Get3DAttributes (IntPtr _event, out ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Set3DAttributes (IntPtr _event, ref ATTRIBUTES_3D attributes); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetListenerMask (IntPtr _event, out uint mask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetListenerMask (IntPtr _event, uint mask); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetProperty (IntPtr _event, EVENT_PROPERTY index, out float value); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetProperty (IntPtr _event, EVENT_PROPERTY index, float value); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetReverbLevel (IntPtr _event, int index, out float level); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetReverbLevel (IntPtr _event, int index, float level); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPaused (IntPtr _event, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetPaused (IntPtr _event, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Start (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Stop (IntPtr _event, STOP_MODE mode); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetTimelinePosition (IntPtr _event, out int position); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetTimelinePosition (IntPtr _event, int position); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetPlaybackState (IntPtr _event, out PLAYBACK_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetChannelGroup (IntPtr _event, out IntPtr group); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_Release (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_IsVirtual (IntPtr _event, out bool virtualstate); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetParameterByName (IntPtr _event, byte[] name, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByName (IntPtr _event, byte[] name, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetParameterByID (IntPtr _event, PARAMETER_ID id, out float value, out float finalvalue); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParameterByID (IntPtr _event, PARAMETER_ID id, float value, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetParametersByIDs (IntPtr _event, PARAMETER_ID[] ids, float[] values, int count, bool ignoreseekspeed); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_TriggerCue (IntPtr _event); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetCallback (IntPtr _event, EVENT_CALLBACK callback, EVENT_CALLBACK_TYPE callbackmask); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetUserData (IntPtr _event, out IntPtr userdata); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_SetUserData (IntPtr _event, IntPtr userdata); + [DllImport (STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetCPUUsage (IntPtr _event, out uint exclusive, out uint inclusive); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_EventInstance_GetMemoryUsage (IntPtr _event, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_EventInstance_IsValid(this.handle); + } + + #endregion + } + + public struct Bus + { + public RESULT getID(out Guid id) + { + return FMOD_Studio_Bus_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bus_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_Bus_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_Bus_SetVolume(this.handle, volume); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_Bus_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_Bus_SetPaused(this.handle, paused); + } + public RESULT getMute(out bool mute) + { + return FMOD_Studio_Bus_GetMute(this.handle, out mute); + } + public RESULT setMute(bool mute) + { + return FMOD_Studio_Bus_SetMute(this.handle, mute); + } + public RESULT stopAllEvents(STOP_MODE mode) + { + return FMOD_Studio_Bus_StopAllEvents(this.handle, mode); + } + public RESULT lockChannelGroup() + { + return FMOD_Studio_Bus_LockChannelGroup(this.handle); + } + public RESULT unlockChannelGroup() + { + return FMOD_Studio_Bus_UnlockChannelGroup(this.handle); + } + public RESULT getChannelGroup(out FMOD.ChannelGroup group) + { + return FMOD_Studio_Bus_GetChannelGroup(this.handle, out group.handle); + } + public RESULT getCPUUsage(out uint exclusive, out uint inclusive) + { + return FMOD_Studio_Bus_GetCPUUsage(this.handle, out exclusive, out inclusive); + } + public RESULT getMemoryUsage(out MEMORY_USAGE memoryusage) + { + return FMOD_Studio_Bus_GetMemoryUsage(this.handle, out memoryusage); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_Bus_IsValid (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetID (IntPtr bus, out Guid id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPath (IntPtr bus, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetVolume (IntPtr bus, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetVolume (IntPtr bus, float volume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetPaused (IntPtr bus, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetPaused (IntPtr bus, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetMute (IntPtr bus, out bool mute); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_SetMute (IntPtr bus, bool mute); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_StopAllEvents (IntPtr bus, STOP_MODE mode); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_LockChannelGroup (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_UnlockChannelGroup (IntPtr bus); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetChannelGroup (IntPtr bus, out IntPtr group); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetCPUUsage (IntPtr bus, out uint exclusive, out uint inclusive); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bus_GetMemoryUsage (IntPtr bus, out MEMORY_USAGE memoryusage); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_Bus_IsValid(this.handle); + } + + #endregion + } + + public struct VCA + { + public RESULT getID(out Guid id) + { + return FMOD_Studio_VCA_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_VCA_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getVolume(out float volume) + { + float finalVolume; + return getVolume(out volume, out finalVolume); + } + public RESULT getVolume(out float volume, out float finalvolume) + { + return FMOD_Studio_VCA_GetVolume(this.handle, out volume, out finalvolume); + } + public RESULT setVolume(float volume) + { + return FMOD_Studio_VCA_SetVolume(this.handle, volume); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_VCA_IsValid (IntPtr vca); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetID (IntPtr vca, out Guid id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetPath (IntPtr vca, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_GetVolume (IntPtr vca, out float volume, out float finalvolume); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_VCA_SetVolume (IntPtr vca, float volume); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_VCA_IsValid(this.handle); + } + + #endregion + } + + public struct Bank + { + // Property access + + public RESULT getID(out Guid id) + { + return FMOD_Studio_Bank_GetID(this.handle, out id); + } + public RESULT getPath(out string path) + { + path = null; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bank_GetPath(this.handle, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT unload() + { + return FMOD_Studio_Bank_Unload(this.handle); + } + public RESULT loadSampleData() + { + return FMOD_Studio_Bank_LoadSampleData(this.handle); + } + public RESULT unloadSampleData() + { + return FMOD_Studio_Bank_UnloadSampleData(this.handle); + } + public RESULT getLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_Bank_GetLoadingState(this.handle, out state); + } + public RESULT getSampleLoadingState(out LOADING_STATE state) + { + return FMOD_Studio_Bank_GetSampleLoadingState(this.handle, out state); + } + + // Enumeration + public RESULT getStringCount(out int count) + { + return FMOD_Studio_Bank_GetStringCount(this.handle, out count); + } + public RESULT getStringInfo(int index, out Guid id, out string path) + { + path = null; + id = Guid.Empty; + + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + IntPtr stringMem = Marshal.AllocHGlobal(256); + int retrieved = 0; + RESULT result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, 256, out retrieved); + + if (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringMem = Marshal.AllocHGlobal(retrieved); + result = FMOD_Studio_Bank_GetStringInfo(this.handle, index, out id, stringMem, retrieved, out retrieved); + } + + if (result == RESULT.OK) + { + path = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + + public RESULT getEventCount(out int count) + { + return FMOD_Studio_Bank_GetEventCount(this.handle, out count); + } + public RESULT getEventList(out EventDescription[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetEventCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new EventDescription[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetEventList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new EventDescription[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getBusCount(out int count) + { + return FMOD_Studio_Bank_GetBusCount(this.handle, out count); + } + public RESULT getBusList(out Bus[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetBusCount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new Bus[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetBusList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new Bus[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + public RESULT getVCACount(out int count) + { + return FMOD_Studio_Bank_GetVCACount(this.handle, out count); + } + public RESULT getVCAList(out VCA[] array) + { + array = null; + + RESULT result; + int capacity; + result = FMOD_Studio_Bank_GetVCACount(this.handle, out capacity); + if (result != RESULT.OK) + { + return result; + } + if (capacity == 0) + { + array = new VCA[0]; + return result; + } + + IntPtr[] rawArray = new IntPtr[capacity]; + int actualCount; + result = FMOD_Studio_Bank_GetVCAList(this.handle, rawArray, capacity, out actualCount); + if (result != RESULT.OK) + { + return result; + } + if (actualCount > capacity) // More items added since we queried just now? + { + actualCount = capacity; + } + array = new VCA[actualCount]; + for (int i = 0; i < actualCount; ++i) + { + array[i].handle = rawArray[i]; + } + return RESULT.OK; + } + + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_Bank_GetUserData(this.handle, out userdata); + } + + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_Bank_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_Bank_IsValid (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetID (IntPtr bank, out Guid id); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetPath (IntPtr bank, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_Unload (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_LoadSampleData (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_UnloadSampleData (IntPtr bank); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetLoadingState (IntPtr bank, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetSampleLoadingState (IntPtr bank, out LOADING_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetStringCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetStringInfo (IntPtr bank, int index, out Guid id, IntPtr path, int size, out int retrieved); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetEventCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetEventList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetBusCount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetBusList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetVCACount (IntPtr bank, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetVCAList (IntPtr bank, IntPtr[] array, int capacity, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_GetUserData (IntPtr bank, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_Bank_SetUserData (IntPtr bank, IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_Bank_IsValid(this.handle); + } + + #endregion + } + + public struct CommandReplay + { + // Information query + public RESULT getSystem(out System system) + { + return FMOD_Studio_CommandReplay_GetSystem(this.handle, out system.handle); + } + + public RESULT getLength(out float length) + { + return FMOD_Studio_CommandReplay_GetLength(this.handle, out length); + } + public RESULT getCommandCount(out int count) + { + return FMOD_Studio_CommandReplay_GetCommandCount(this.handle, out count); + } + public RESULT getCommandInfo(int commandIndex, out COMMAND_INFO info) + { + return FMOD_Studio_CommandReplay_GetCommandInfo(this.handle, commandIndex, out info); + } + + public RESULT getCommandString(int commandIndex, out string buffer) + { + buffer = null; + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + int stringLength = 256; + IntPtr stringMem = Marshal.AllocHGlobal(256); + RESULT result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); + + while (result == RESULT.ERR_TRUNCATED) + { + Marshal.FreeHGlobal(stringMem); + stringLength *= 2; + stringMem = Marshal.AllocHGlobal(stringLength); + result = FMOD_Studio_CommandReplay_GetCommandString(this.handle, commandIndex, stringMem, stringLength); + } + + if (result == RESULT.OK) + { + buffer = encoder.stringFromNative(stringMem); + } + Marshal.FreeHGlobal(stringMem); + return result; + } + } + public RESULT getCommandAtTime(float time, out int commandIndex) + { + return FMOD_Studio_CommandReplay_GetCommandAtTime(this.handle, time, out commandIndex); + } + // Playback + public RESULT setBankPath(string bankPath) + { + using (StringHelper.ThreadSafeEncoding encoder = StringHelper.GetFreeHelper()) + { + return FMOD_Studio_CommandReplay_SetBankPath(this.handle, encoder.byteFromStringUTF8(bankPath)); + } + } + public RESULT start() + { + return FMOD_Studio_CommandReplay_Start(this.handle); + } + public RESULT stop() + { + return FMOD_Studio_CommandReplay_Stop(this.handle); + } + public RESULT seekToTime(float time) + { + return FMOD_Studio_CommandReplay_SeekToTime(this.handle, time); + } + public RESULT seekToCommand(int commandIndex) + { + return FMOD_Studio_CommandReplay_SeekToCommand(this.handle, commandIndex); + } + public RESULT getPaused(out bool paused) + { + return FMOD_Studio_CommandReplay_GetPaused(this.handle, out paused); + } + public RESULT setPaused(bool paused) + { + return FMOD_Studio_CommandReplay_SetPaused(this.handle, paused); + } + public RESULT getPlaybackState(out PLAYBACK_STATE state) + { + return FMOD_Studio_CommandReplay_GetPlaybackState(this.handle, out state); + } + public RESULT getCurrentCommand(out int commandIndex, out float currentTime) + { + return FMOD_Studio_CommandReplay_GetCurrentCommand(this.handle, out commandIndex, out currentTime); + } + // Release + public RESULT release() + { + return FMOD_Studio_CommandReplay_Release(this.handle); + } + // Callbacks + public RESULT setFrameCallback(COMMANDREPLAY_FRAME_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetFrameCallback(this.handle, callback); + } + public RESULT setLoadBankCallback(COMMANDREPLAY_LOAD_BANK_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetLoadBankCallback(this.handle, callback); + } + public RESULT setCreateInstanceCallback(COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback) + { + return FMOD_Studio_CommandReplay_SetCreateInstanceCallback(this.handle, callback); + } + public RESULT getUserData(out IntPtr userdata) + { + return FMOD_Studio_CommandReplay_GetUserData(this.handle, out userdata); + } + public RESULT setUserData(IntPtr userdata) + { + return FMOD_Studio_CommandReplay_SetUserData(this.handle, userdata); + } + + #region importfunctions + [DllImport(STUDIO_VERSION.dll)] + private static extern bool FMOD_Studio_CommandReplay_IsValid (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetSystem (IntPtr replay, out IntPtr system); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetLength (IntPtr replay, out float length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandCount (IntPtr replay, out int count); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandInfo (IntPtr replay, int commandindex, out COMMAND_INFO info); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandString (IntPtr replay, int commandIndex, IntPtr buffer, int length); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCommandAtTime (IntPtr replay, float time, out int commandIndex); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetBankPath (IntPtr replay, byte[] bankPath); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Start (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Stop (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SeekToTime (IntPtr replay, float time); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SeekToCommand (IntPtr replay, int commandIndex); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetPaused (IntPtr replay, out bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetPaused (IntPtr replay, bool paused); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetPlaybackState (IntPtr replay, out PLAYBACK_STATE state); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetCurrentCommand (IntPtr replay, out int commandIndex, out float currentTime); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_Release (IntPtr replay); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetFrameCallback (IntPtr replay, COMMANDREPLAY_FRAME_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetLoadBankCallback (IntPtr replay, COMMANDREPLAY_LOAD_BANK_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetCreateInstanceCallback(IntPtr replay, COMMANDREPLAY_CREATE_INSTANCE_CALLBACK callback); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_GetUserData (IntPtr replay, out IntPtr userdata); + [DllImport(STUDIO_VERSION.dll)] + private static extern RESULT FMOD_Studio_CommandReplay_SetUserData (IntPtr replay, IntPtr userdata); + #endregion + + #region wrapperinternal + + public IntPtr handle; + + public bool hasHandle() { return this.handle != IntPtr.Zero; } + public void clearHandle() { this.handle = IntPtr.Zero; } + + public bool isValid() + { + return hasHandle() && FMOD_Studio_CommandReplay_IsValid(this.handle); + } + + #endregion + } +} // FMOD diff --git a/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_studio.cs.meta b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_studio.cs.meta new file mode 100644 index 0000000..f858a3f --- /dev/null +++ b/Assets/Plugins/FMOD/src/Runtime/wrapper/fmod_studio.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ae7eb0b6a2bff364b9c1fae52173e74c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/cai_added_this_or_unity_wouldnt_save.unity b/Assets/Scenes/cai_added_this_or_unity_wouldnt_save.unity new file mode 100644 index 0000000..471670a --- /dev/null +++ b/Assets/Scenes/cai_added_this_or_unity_wouldnt_save.unity @@ -0,0 +1,334 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &521051525 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 521051529} + - component: {fileID: 521051528} + - component: {fileID: 521051527} + - component: {fileID: 521051526} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &521051526 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 521051525} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RenderShadows: 1 + m_RequiresDepthTextureOption: 2 + m_RequiresOpaqueTextureOption: 2 + m_CameraType: 0 + m_Cameras: [] + m_RendererIndex: -1 + m_VolumeLayerMask: + serializedVersion: 2 + m_Bits: 1 + m_VolumeTrigger: {fileID: 0} + m_RenderPostProcessing: 0 + m_Antialiasing: 0 + m_AntialiasingQuality: 2 + m_StopNaN: 0 + m_Dithering: 0 + m_ClearDepth: 1 + m_AllowXRRendering: 1 + m_RequiresDepthTexture: 0 + m_RequiresColorTexture: 0 + m_Version: 2 +--- !u!81 &521051527 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 521051525} + m_Enabled: 1 +--- !u!20 &521051528 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 521051525} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &521051529 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 521051525} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1594474024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1594474026} + - component: {fileID: 1594474025} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1594474025 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1594474024} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1594474026 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1594474024} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} diff --git a/Assets/Scenes/cai_added_this_or_unity_wouldnt_save.unity.meta b/Assets/Scenes/cai_added_this_or_unity_wouldnt_save.unity.meta new file mode 100644 index 0000000..7ac8ea0 --- /dev/null +++ b/Assets/Scenes/cai_added_this_or_unity_wouldnt_save.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4547c7f19009e6e498d2e480d3749eb4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets.meta b/Assets/StreamingAssets.meta new file mode 100644 index 0000000..603b015 --- /dev/null +++ b/Assets/StreamingAssets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f92f4f7507255346985cc05348b829f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/Master.bank b/Assets/StreamingAssets/Master.bank new file mode 100644 index 0000000..2ea5513 Binary files /dev/null and b/Assets/StreamingAssets/Master.bank differ diff --git a/Assets/StreamingAssets/Master.bank.meta b/Assets/StreamingAssets/Master.bank.meta new file mode 100644 index 0000000..b8a3388 --- /dev/null +++ b/Assets/StreamingAssets/Master.bank.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 5329d97b03ee8dd49905d088d917922b +labels: +- FMOD +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/StreamingAssets/Master.strings.bank b/Assets/StreamingAssets/Master.strings.bank new file mode 100644 index 0000000..14cb29f Binary files /dev/null and b/Assets/StreamingAssets/Master.strings.bank differ diff --git a/Assets/StreamingAssets/Master.strings.bank.meta b/Assets/StreamingAssets/Master.strings.bank.meta new file mode 100644 index 0000000..8c3c25a --- /dev/null +++ b/Assets/StreamingAssets/Master.strings.bank.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: aaf2f228587ce6b4898575b37dc4700a +labels: +- FMOD +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: