Skip to content

Commit 5a5f563

Browse files
committed
Removed sound player, use global instead.
1 parent e94841b commit 5a5f563

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

Assets/JCSUnity/Scripts/Webcam/JCS_Webcam.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ public class JCS_Webcam
8686

8787
[Header("- Sound")]
8888

89-
[Tooltip("Sound player for 3D sounds calculation.")]
90-
[SerializeField]
91-
private JCS_SoundPlayer mSoundPlayer = null;
92-
9389
[Tooltip("Sound when taking the screenshot.")]
9490
[SerializeField]
9591
private AudioClip mTakePhotoSound = null;
@@ -106,14 +102,6 @@ public class JCS_Webcam
106102

107103
/* Functions */
108104

109-
protected override void Awake()
110-
{
111-
base.Awake();
112-
113-
if (mSoundPlayer == null)
114-
mSoundPlayer = this.GetComponent<JCS_SoundPlayer>();
115-
}
116-
117105
private void Start()
118106
{
119107
ActiveWebcam();
@@ -217,7 +205,11 @@ public void TakeSnapshotWebcam()
217205
mResumeTrigger = true;
218206

219207
// play sound.
220-
mSoundPlayer.PlayOneShot(mTakePhotoSound);
208+
{
209+
var soundm = JCS_SoundManager.instance;
210+
JCS_SoundPlayer sp = soundm.GetGlobalSoundPlayer();
211+
sp.PlayOneShot(mTakePhotoSound);
212+
}
221213
}
222214

223215
/// <summary>

0 commit comments

Comments
 (0)