diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedListenerInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedListenerInspector.cs index c6594963..39f098b6 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedListenerInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedListenerInspector.cs @@ -11,6 +11,7 @@ namespace SteamAudio [CustomEditor(typeof(SteamAudioBakedListener))] public class SteamAudioBakedListenerInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mInfluenceRadius; SerializedProperty mUseAllProbeBatches; SerializedProperty mProbeBatches; @@ -75,5 +76,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedSourceInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedSourceInspector.cs index a7057208..1c831210 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedSourceInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioBakedSourceInspector.cs @@ -11,6 +11,7 @@ namespace SteamAudio [CustomEditor(typeof(SteamAudioBakedSource))] public class SteamAudioBakedSourceInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mInfluenceRadius; SerializedProperty mUseAllProbeBatches; SerializedProperty mProbeBatches; @@ -75,5 +76,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioDynamicObjectInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioDynamicObjectInspector.cs index 8a6aa154..09dc48d3 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioDynamicObjectInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioDynamicObjectInspector.cs @@ -12,6 +12,7 @@ namespace SteamAudio [CustomEditor(typeof(SteamAudioDynamicObject))] public class SteamAudioDynamicObjectInspector : Editor { + #if STEAMAUDIO_ENABLED SerializedProperty mAsset; private void OnEnable() @@ -53,5 +54,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioGeometryInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioGeometryInspector.cs index 4169e30e..4003bad0 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioGeometryInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioGeometryInspector.cs @@ -12,6 +12,7 @@ namespace SteamAudio [CanEditMultipleObjects] public class SteamAudioGeometryInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mMaterial; SerializedProperty mExportAllChildren; SerializedProperty mTerrainSimplificationLevel; @@ -48,5 +49,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioListenerInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioListenerInspector.cs index 9f488de9..09cb01ce 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioListenerInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioListenerInspector.cs @@ -11,6 +11,7 @@ namespace SteamAudio [CustomEditor(typeof(SteamAudioListener))] public class SteamAudioListenerInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mCurrentBakedListener; SerializedProperty mApplyReverb; SerializedProperty mReverbType; @@ -86,5 +87,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioManagerInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioManagerInspector.cs index edd44c56..25587b58 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioManagerInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioManagerInspector.cs @@ -11,6 +11,7 @@ namespace SteamAudio [CanEditMultipleObjects] public class SteamAudioManagerInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mCurrentHRTF; private void OnEnable() @@ -35,5 +36,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioProbeBatchInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioProbeBatchInspector.cs index 1cb9a2f2..786c2b2d 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioProbeBatchInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioProbeBatchInspector.cs @@ -13,6 +13,7 @@ namespace SteamAudio [CustomEditor(typeof(SteamAudioProbeBatch))] public class SteamAudioProbeBatchInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mPlacementStrategy; SerializedProperty mHorizontalSpacing; SerializedProperty mHeightAboveFloor; @@ -121,5 +122,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioStaticMeshInspector.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioStaticMeshInspector.cs index faab69d4..3c08bf2b 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioStaticMeshInspector.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Editor/SteamAudioStaticMeshInspector.cs @@ -11,6 +11,7 @@ namespace SteamAudio [CustomEditor(typeof(SteamAudioStaticMesh))] public class SteamAudioStaticMeshInspector : Editor { +#if STEAMAUDIO_ENABLED SerializedProperty mAsset; SerializedProperty mSceneNameWhenExported; @@ -53,5 +54,11 @@ public override void OnInspectorGUI() serializedObject.ApplyModifiedProperties(); } +#else + public override void OnInspectorGUI() + { + EditorGUILayout.HelpBox("Steam Audio is not supported for the target platform or STEAMAUDIO_ENABLED define symbol is missing.", MessageType.Warning); + } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineSource.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineSource.cs index a60a02db..31629855 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineSource.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineSource.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using UnityEngine; @@ -35,3 +36,5 @@ public static AudioEngineSource Create(AudioEngineType type) } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineState.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineState.cs index c8dab70f..30fd5c12 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineState.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/AudioEngineState.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using UnityEngine; @@ -60,3 +61,5 @@ public static AudioEngineStateHelpers Create(AudioEngineType type) } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Baker.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Baker.cs index 1e0969e2..5d0ae2a7 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Baker.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Baker.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using AOT; using System; @@ -334,3 +335,4 @@ static void BakeThread() } } +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineSource.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineSource.cs index bd12b552..0a38ab1b 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineSource.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineSource.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using System.Reflection; @@ -170,3 +171,5 @@ static void BindToFMODStudioPlugin() } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineState.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineState.cs index e972bf9c..495d2d17 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineState.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/FMODStudioAudioEngineState.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using System.Reflection; @@ -93,3 +94,5 @@ static void BindToFMODStudioPlugin() } } } + +#endif \ No newline at end of file diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/InstancedMesh.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/InstancedMesh.cs index 6c4f9bee..aec601d5 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/InstancedMesh.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/InstancedMesh.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using UnityEngine; @@ -61,3 +62,5 @@ public void UpdateTransform(Scene scene, Transform transform) } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/ProbeBatch.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/ProbeBatch.cs index 18f55e62..d480dc44 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/ProbeBatch.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/ProbeBatch.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using UnityEngine; @@ -136,3 +137,4 @@ public UIntPtr GetDataSize(BakedDataIdentifier identifier) } } } +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Scene.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Scene.cs index 451b9f84..402b4595 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Scene.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Scene.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; @@ -32,7 +33,7 @@ public Scene(Context context, SceneType type, EmbreeDevice embreeDevice, RadeonR public Scene(Context context, SceneSettings sceneSettings, SerializedData dataAsset) { mContext = context; - + var serializedObject = new SerializedObject(context, dataAsset); var status = API.iplSceneLoad(context.Get(), ref sceneSettings, serializedObject.Get(), null, IntPtr.Zero, out mScene); if (status != Error.Success) @@ -99,3 +100,4 @@ public void Commit() } } } +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SerializedObject.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SerializedObject.cs index 66a0b167..6635d488 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SerializedObject.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SerializedObject.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using System.Collections.Generic; @@ -126,3 +127,4 @@ public static void FlushAllWrites() } } } +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Simulator.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Simulator.cs index fde1cdd6..41d44367 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Simulator.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/Simulator.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using UnityEngine; @@ -137,3 +138,4 @@ public SimulationOutputs GetOutputs(SimulationFlags flags) } } } +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/StaticMesh.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/StaticMesh.cs index f195c0c9..9f232271 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/StaticMesh.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/StaticMesh.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using System.Runtime.InteropServices; @@ -52,7 +53,7 @@ public StaticMesh(Context context, Scene scene, Vector3[] vertices, Triangle[] t if (status != Error.Success) { throw new Exception(string.Format("Unable to create static mesh for export ({0} vertices, {1} triangles, {2} materials): [{3}]", - staticMeshSettings.numVertices.ToString(), staticMeshSettings.numTriangles.ToString(), staticMeshSettings.numMaterials.ToString(), + staticMeshSettings.numVertices.ToString(), staticMeshSettings.numTriangles.ToString(), staticMeshSettings.numMaterials.ToString(), status.ToString())); } @@ -120,3 +121,5 @@ public void RemoveFromScene(Scene scene) } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedListener.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedListener.cs index 36b359f0..26681498 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedListener.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedListener.cs @@ -26,6 +26,7 @@ public class SteamAudioBakedListener : MonoBehaviour [SerializeField] SteamAudioProbeBatch[] mProbeBatchesUsed = null; +#if STEAMAUDIO_ENABLED public int GetTotalDataSize() { return mTotalDataSize; @@ -133,5 +134,6 @@ void CacheProbeBatchesUsed() { mProbeBatchesUsed = (useAllProbeBatches) ? FindObjectsOfType() : probeBatches; } +#endif } } \ No newline at end of file diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedSource.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedSource.cs index 24218aa1..aead7ba2 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedSource.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioBakedSource.cs @@ -26,6 +26,7 @@ public class SteamAudioBakedSource : MonoBehaviour [SerializeField] SteamAudioProbeBatch[] mProbeBatchesUsed = null; +#if STEAMAUDIO_ENABLED public int GetTotalDataSize() { return mTotalDataSize; @@ -133,5 +134,6 @@ void CacheProbeBatchesUsed() { mProbeBatchesUsed = (useAllProbeBatches) ? FindObjectsOfType() : probeBatches; } +#endif } } \ No newline at end of file diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioDynamicObject.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioDynamicObject.cs index 8041e097..ad0d5d56 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioDynamicObject.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioDynamicObject.cs @@ -14,6 +14,7 @@ public class SteamAudioDynamicObject : MonoBehaviour [Header("Export Settings")] public SerializedData asset = null; +#if STEAMAUDIO_ENABLED InstancedMesh mInstancedMesh = null; private void OnDestroy() @@ -56,5 +57,6 @@ private void Update() mInstancedMesh.UpdateTransform(SteamAudioManager.CurrentScene, transform); } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioGeometry.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioGeometry.cs index d5f8a0fe..af6fcff5 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioGeometry.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioGeometry.cs @@ -18,6 +18,7 @@ public class SteamAudioGeometry : MonoBehaviour [Range(0, 10)] public int terrainSimplificationLevel = 0; +#if STEAMAUDIO_ENABLED public int GetNumVertices() { if (exportAllChildren) @@ -57,5 +58,6 @@ public int GetNumTriangles() return SteamAudioManager.GetNumTriangles(gameObject); } } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioListener.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioListener.cs index f175089c..62c83c48 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioListener.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioListener.cs @@ -36,6 +36,8 @@ public class SteamAudioListener : MonoBehaviour BakedDataIdentifier mIdentifier = new BakedDataIdentifier { }; [SerializeField] SteamAudioProbeBatch[] mProbeBatchesUsed = null; + +#if STEAMAUDIO_ENABLED Simulator mSimulator = null; Source mSource = null; @@ -229,5 +231,6 @@ void CacheProbeBatchesUsed() { mProbeBatchesUsed = (useAllProbeBatches) ? FindObjectsOfType() : probeBatches; } +#endif } } \ No newline at end of file diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioManager.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioManager.cs index 1ed2ed5b..6900a71a 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioManager.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioManager.cs @@ -34,6 +34,8 @@ public class SteamAudioManager : MonoBehaviour { [Header("HRTF Settings")] public int currentHRTF = 0; + +#if STEAMAUDIO_ENABLED public string[] hrtfNames = null; int mNumCPUCores = 0; @@ -162,7 +164,7 @@ public static SteamAudioListener GetSteamAudioListener() public int NumThreadsForCPUCorePercentage(int percentage) { - return (int) Mathf.Max(1, (percentage * mNumCPUCores) / 100.0f); + return (int)Mathf.Max(1, (percentage * mNumCPUCores) / 100.0f); } public static SceneType GetSceneType() @@ -295,8 +297,8 @@ void OnApplicationStart(ManagerInitReason reason) { if (SteamAudioSettings.Singleton.SOFAFiles[i]) { - mHRTFs[i + 1] = new HRTF(mContext, mAudioSettings, - SteamAudioSettings.Singleton.SOFAFiles[i].sofaName, + mHRTFs[i + 1] = new HRTF(mContext, mAudioSettings, + SteamAudioSettings.Singleton.SOFAFiles[i].sofaName, SteamAudioSettings.Singleton.SOFAFiles[i].data, SteamAudioSettings.Singleton.SOFAFiles[i].volume, SteamAudioSettings.Singleton.SOFAFiles[i].normType); @@ -360,7 +362,7 @@ void OnApplicationStart(ManagerInitReason reason) if (SteamAudioSettings.Singleton.sceneType == SceneType.RadeonRays && !mOpenCLInitFailed) - { + { try { mRadeonRaysInitFailed = false; @@ -461,6 +463,7 @@ public static void NotifyAudioListenerChanged() } } +#if STEAMAUDIO_ENABLED private void LateUpdate() { if (mAudioEngineState == null) @@ -572,7 +575,8 @@ private void LateUpdate() } } } - +#endif + void RunSimulationInternal() { if (mSimulator == null) @@ -696,7 +700,7 @@ public static void Reinitialize() UnityEngine.AudioSettings.Reset(UnityEngine.AudioSettings.GetConfiguration()); - if ((sSingleton.mEmbreeDevice == null || sSingleton.mEmbreeDevice.Get() == IntPtr.Zero) + if ((sSingleton.mEmbreeDevice == null || sSingleton.mEmbreeDevice.Get() == IntPtr.Zero) && SteamAudioSettings.Singleton.sceneType == SceneType.Embree) { try @@ -859,7 +863,7 @@ public static void ExportAllOpenScenes() { var scene = SceneManager.GetSceneAt(i); - EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting scene: {0}", scene.name), (float) i / (float) SceneManager.sceneCount); + EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting scene: {0}", scene.name), (float)i / (float)SceneManager.sceneCount); if (!scene.isLoaded) { @@ -881,7 +885,7 @@ public static void ExportAllScenesInBuild() { var scene = SceneManager.GetSceneByBuildIndex(i); - EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting scene: {0}", scene.name), (float) i / (float) SceneManager.sceneCountInBuildSettings); + EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting scene: {0}", scene.name), (float)i / (float)SceneManager.sceneCountInBuildSettings); var shouldClose = false; if (!scene.isLoaded) @@ -921,7 +925,7 @@ public static void ExportDynamicObjectsInAllOpenScenes() { var scene = SceneManager.GetSceneAt(i); - EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in scene: {0}", scene.name), (float) i / (float) SceneManager.sceneCount); + EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in scene: {0}", scene.name), (float)i / (float)SceneManager.sceneCount); if (!scene.isLoaded) { @@ -943,7 +947,7 @@ public static void ExportDynamicObjectsInBuild() { var scene = SceneManager.GetSceneByBuildIndex(i); - EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in scene: {0}", scene.name), (float) i / (float) SceneManager.sceneCountInBuildSettings); + EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in scene: {0}", scene.name), (float)i / (float)SceneManager.sceneCountInBuildSettings); var shouldClose = false; if (!scene.isLoaded) @@ -973,17 +977,17 @@ public static void ExportDynamicObjectsInProject() var numItems = scenes.Length + prefabs.Length; var index = 0; - foreach (var sceneGUID in scenes) + foreach (var sceneGUID in scenes) { var scenePath = AssetDatabase.GUIDToAssetPath(sceneGUID); - EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in scene: {0}", scenePath), (float) index / (float) numItems); + EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in scene: {0}", scenePath), (float)index / (float)numItems); var activeScene = EditorSceneManager.GetActiveScene(); var isLoadedScene = (scenePath == activeScene.path); var scene = activeScene; - if (!isLoadedScene) + if (!isLoadedScene) { #if UNITY_2019_2_OR_NEWER var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssetPath(scenePath); @@ -999,7 +1003,7 @@ public static void ExportDynamicObjectsInProject() ExportDynamicObjectsInArray(GetDynamicObjectsInScene(scene)); - if (!isLoadedScene) + if (!isLoadedScene) { EditorSceneManager.CloseScene(scene, true); } @@ -1007,11 +1011,11 @@ public static void ExportDynamicObjectsInProject() ++index; } - foreach (var prefabGUID in prefabs) + foreach (var prefabGUID in prefabs) { var prefabPath = AssetDatabase.GUIDToAssetPath(prefabGUID); - EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in prefab: {0}", prefabPath), (float) index / (float) numItems); + EditorUtility.DisplayProgressBar("Steam Audio", string.Format("Exporting dynamic objects in prefab: {0}", prefabPath), (float)index / (float)numItems); var prefab = AssetDatabase.LoadMainAssetAtPath(prefabPath) as GameObject; var dynamicObjects = prefab.GetComponentsInChildren(); @@ -1043,7 +1047,7 @@ public static void InstallFMODStudioPluginFiles() var FMODUnity_Settings_Instance = FMODUnity_Settings.GetProperty("Instance"); var FMODUnity_Settings_CurrentVersion = FMODUnity_Settings.GetField("CurrentVersion"); var fmodSettings = FMODUnity_Settings_Instance.GetValue(null, null); - var fmodVersion = (int) FMODUnity_Settings_CurrentVersion.GetValue(fmodSettings); + var fmodVersion = (int)FMODUnity_Settings_CurrentVersion.GetValue(fmodSettings); var fmodVersionMajor = (fmodVersion & 0x00ff0000) >> 16; var fmodVersionMinor = (fmodVersion & 0x0000ff00) >> 8; var fmodVersionPatch = (fmodVersion & 0x000000ff); @@ -1103,7 +1107,7 @@ public static void InstallFMODStudioPluginFiles() moveSucceeded = MoveAssets(moves); } - } + } else { EditorUtility.DisplayDialog("Steam Audio", @@ -1378,7 +1382,7 @@ public static int GetNumVertices(GameObject gameObject) var w = terrain.terrainData.heightmapResolution; var h = terrain.terrainData.heightmapResolution; - var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int) Mathf.Pow(2.0f, terrainSimplificationLevel))); + var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int)Mathf.Pow(2.0f, terrainSimplificationLevel))); if (s == 0) { @@ -1412,7 +1416,7 @@ public static int GetNumTriangles(GameObject gameObject) var w = terrain.terrainData.heightmapResolution; var h = terrain.terrainData.heightmapResolution; - var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int) Mathf.Pow(2.0f, terrainSimplificationLevel))); + var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int)Mathf.Pow(2.0f, terrainSimplificationLevel))); if (s == 0) { @@ -1471,7 +1475,7 @@ public static void AnyHit(ref Ray ray, float minDistance, float maxDistance, out var numHits = Physics.RaycastNonAlloc(origin, direction, sSingleton.mRayHits, maxDistance, layerMask); - occluded = (byte) ((numHits > 0) ? 1 : 0); + occluded = (byte)((numHits > 0) ? 1 : 0); } // This method is called as soon as scripts are loaded, which happens whenever play mode is started @@ -1551,7 +1555,7 @@ static Scene CreateScene(Context context) { var sceneType = GetSceneType(); - var scene = new Scene(context, sceneType, sSingleton.mEmbreeDevice, sSingleton.mRadeonRaysDevice, + var scene = new Scene(context, sceneType, sSingleton.mEmbreeDevice, sSingleton.mRadeonRaysDevice, ClosestHit, AnyHit); if (sceneType == SceneType.Custom) @@ -1656,7 +1660,7 @@ static GameObject[] GetDynamicGameObjectsForExport(SteamAudioDynamicObject dynam static bool IsDynamicSubObject(GameObject root, GameObject obj) { return (root.GetComponentInParent() != - obj.GetComponentInParent()); + obj.GetComponentInParent()); } // Ideally, we want to use GameObject.activeInHierarchy to check if a GameObject is active. However, when @@ -1766,7 +1770,7 @@ static void GetVertices(GameObject gameObject, Vector3[] vertices, int offset, T var w = terrain.terrainData.heightmapResolution; var h = terrain.terrainData.heightmapResolution; - var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int) Mathf.Pow(2.0f, terrainSimplificationLevel))); + var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int)Mathf.Pow(2.0f, terrainSimplificationLevel))); if (s == 0) { s = 1; @@ -1824,7 +1828,7 @@ static void GetTriangles(GameObject gameObject, Triangle[] triangles, int offset var w = terrain.terrainData.heightmapResolution; var h = terrain.terrainData.heightmapResolution; - var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int) Mathf.Pow(2.0f, terrainSimplificationLevel))); + var s = Mathf.Min(w - 1, Mathf.Min(h - 1, (int)Mathf.Pow(2.0f, terrainSimplificationLevel))); if (s == 0) { s = 1; @@ -2009,5 +2013,6 @@ static SerializedData GetDataAsset(SteamAudioDynamicObject dynamicObject) { return dynamicObject.asset; } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioProbeBatch.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioProbeBatch.cs index 28a38e4e..d2e16aed 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioProbeBatch.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioProbeBatch.cs @@ -38,6 +38,7 @@ public class SteamAudioProbeBatch : MonoBehaviour [SerializeField] Sphere[] mProbeSpheres = null; [SerializeField] List mBakedDataLayerInfo = new List(); +#if STEAMAUDIO_ENABLED ProbeBatch mProbeBatch = null; const float kProbeDrawSize = 0.1f; @@ -327,5 +328,6 @@ public void BeginBake() Baker.BeginBake(tasks); } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioSource.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioSource.cs index 71cd5488..bb2c45f6 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioSource.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioSource.cs @@ -140,6 +140,7 @@ public class SteamAudioSource : MonoBehaviour [Range(0.0f, 10.0f)] public float pathingMixLevel = 1.0f; +#if STEAMAUDIO_ENABLED Simulator mSimulator = null; Source mSource = null; AudioEngineSource mAudioEngineSource = null; @@ -522,5 +523,6 @@ public static float EvaluateDistanceCurve(float distance, IntPtr userData) return 0.0f; } } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioStaticMesh.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioStaticMesh.cs index b0c18fc3..05d267bd 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioStaticMesh.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioStaticMesh.cs @@ -13,6 +13,7 @@ public class SteamAudioStaticMesh : MonoBehaviour public SerializedData asset = null; public string sceneNameWhenExported = ""; +#if STEAMAUDIO_ENABLED StaticMesh mStaticMesh = null; void Start() @@ -60,5 +61,6 @@ void Update() } } } +#endif } } diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineSource.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineSource.cs index a5cdc3fe..14ebe841 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineSource.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineSource.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using UnityEngine; @@ -78,3 +79,5 @@ public override void UpdateParameters(SteamAudioSource source) } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineState.cs b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineState.cs index 9943bb43..0b57950f 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineState.cs +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/UnityAudioEngineState.cs @@ -2,6 +2,7 @@ // Copyright 2017 Valve Corporation. All rights reserved. Subject to the following license: // https://valvesoftware.github.io/steam-audio/license.html // +#if STEAMAUDIO_ENABLED using System; using UnityEngine; @@ -60,3 +61,5 @@ public override AudioSettings GetAudioSettings() } } } + +#endif diff --git a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/SteamAudioUnity.asmdef b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/SteamAudioUnity.asmdef index 7ed503b1..241b5799 100644 --- a/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/SteamAudioUnity.asmdef +++ b/unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/SteamAudioUnity.asmdef @@ -2,14 +2,7 @@ "name": "SteamAudioUnity", "rootNamespace": "", "references": [], - "includePlatforms": [ - "Android", - "Editor", - "LinuxStandalone64", - "macOSStandalone", - "WindowsStandalone32", - "WindowsStandalone64" - ], + "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": false,