From 27bb88f7ac4a6c28f8d7d7ea388e8b5a9e1b4b9c Mon Sep 17 00:00:00 2001
From: mhby1g21 <mhby1g21@soton.ac.uk>
Date: Fri, 6 Dec 2024 12:15:53 +0000
Subject: [PATCH] added #if UNITY_EDITOR #endif directives to all editor
 related scripts to allow build compiles successfully

---
 AVVR/Assets/_Scripts/AudioRecorder/AudioRecorder.cs    | 5 ++++-
 AVVR/Assets/_Scripts/AudioRecorder/DelayedAudioPlay.cs | 4 +++-
 AVVR/Assets/_Scripts/Change Audio.cs                   | 3 +++
 AVVR/Assets/_Scripts/Demo/LoadDemo.cs                  | 3 +++
 AVVR/Assets/_Scripts/Import Scenery.cs                 | 5 ++++-
 AVVR/Assets/_Scripts/Import Sound.cs                   | 3 +++
 AVVR/Assets/_Scripts/Sound Click Toggle.cs             | 3 +++
 7 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/AVVR/Assets/_Scripts/AudioRecorder/AudioRecorder.cs b/AVVR/Assets/_Scripts/AudioRecorder/AudioRecorder.cs
index a783400..ee74b4f 100644
--- a/AVVR/Assets/_Scripts/AudioRecorder/AudioRecorder.cs
+++ b/AVVR/Assets/_Scripts/AudioRecorder/AudioRecorder.cs
@@ -1,3 +1,5 @@
+#if UNITY_EDITOR
+
 using UnityEngine;
 using UnityEditor;
 using System;
@@ -310,4 +312,5 @@ public class EditorCoroutine
             Stop();
         }
     }
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/AVVR/Assets/_Scripts/AudioRecorder/DelayedAudioPlay.cs b/AVVR/Assets/_Scripts/AudioRecorder/DelayedAudioPlay.cs
index 10f0133..d78e1c4 100644
--- a/AVVR/Assets/_Scripts/AudioRecorder/DelayedAudioPlay.cs
+++ b/AVVR/Assets/_Scripts/AudioRecorder/DelayedAudioPlay.cs
@@ -1,3 +1,4 @@
+#if UNITY_EDITOR
 using UnityEngine;
 using System.Collections;
 using UnityEditor;
@@ -36,4 +37,5 @@ public class DelayedAudioPlay : MonoBehaviour
         audioSource.Play();
         Debug.Log($"Playing audio source: {audioSource.name}");
     }
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/AVVR/Assets/_Scripts/Change Audio.cs b/AVVR/Assets/_Scripts/Change Audio.cs
index 5e7c1cb..d799407 100644
--- a/AVVR/Assets/_Scripts/Change Audio.cs	
+++ b/AVVR/Assets/_Scripts/Change Audio.cs	
@@ -1,3 +1,5 @@
+#if UNITY_EDITOR
+
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
@@ -14,3 +16,4 @@ public class ChangeAudio : MonoBehaviour
         EditorUtility.OpenPropertyEditor(audioSource);
     }
 }
+#endif
\ No newline at end of file
diff --git a/AVVR/Assets/_Scripts/Demo/LoadDemo.cs b/AVVR/Assets/_Scripts/Demo/LoadDemo.cs
index 641a122..0f35724 100644
--- a/AVVR/Assets/_Scripts/Demo/LoadDemo.cs
+++ b/AVVR/Assets/_Scripts/Demo/LoadDemo.cs
@@ -1,3 +1,5 @@
+#if UNITY_EDITOR
+
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
@@ -56,3 +58,4 @@ public class LoadDemo : MonoBehaviour
         }
     }
 }
+#endif
\ No newline at end of file
diff --git a/AVVR/Assets/_Scripts/Import Scenery.cs b/AVVR/Assets/_Scripts/Import Scenery.cs
index 8a98b1c..416b632 100644
--- a/AVVR/Assets/_Scripts/Import Scenery.cs	
+++ b/AVVR/Assets/_Scripts/Import Scenery.cs	
@@ -1,3 +1,5 @@
+#if UNITY_EDITOR
+
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;
@@ -163,4 +165,5 @@ public class ImportScenery : MonoBehaviour
         // initialise assignmaterial script in new gameobject
         materialAssigner.Initialise();
     }
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/AVVR/Assets/_Scripts/Import Sound.cs b/AVVR/Assets/_Scripts/Import Sound.cs
index 5570e37..960b040 100644
--- a/AVVR/Assets/_Scripts/Import Sound.cs	
+++ b/AVVR/Assets/_Scripts/Import Sound.cs	
@@ -1,3 +1,5 @@
+#if UNITY_EDITOR
+
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
@@ -61,3 +63,4 @@ public class ImportSound : MonoBehaviour
         EditorUtility.DisplayDialog("Audio file added!", name + " added to assets. Assign with \"Change Audio\"." , "OK");
     }
 }
+#endif
diff --git a/AVVR/Assets/_Scripts/Sound Click Toggle.cs b/AVVR/Assets/_Scripts/Sound Click Toggle.cs
index 107d511..c3f7df6 100644
--- a/AVVR/Assets/_Scripts/Sound Click Toggle.cs	
+++ b/AVVR/Assets/_Scripts/Sound Click Toggle.cs	
@@ -1,3 +1,5 @@
+#if UNITY_EDITOR
+
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
@@ -33,3 +35,4 @@ public class SoundClickToggle : MonoBehaviour
         UnityEditor.EditorUtility.DisplayDialog("Audio Mode Set!", dialog, "OK");
     }
 }
+#endif
\ No newline at end of file
-- 
GitLab