aboutsummaryrefslogtreecommitdiff
path: root/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@gmail.com>2019-11-03 18:31:04 -0500
committerAndrew Lee <alee14498@gmail.com>2019-11-03 18:31:04 -0500
commite8dd5d4fd406e6e6b710cbe85309f6870bccc37a (patch)
treedb0e99cfdbefb1625d66d07631f43565ae8ff41f /Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs
parent20b14c9a89821e6592bf25bed9329a5abe20495c (diff)
downloadUnicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.tar.gz
Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.tar.bz2
Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.zip
Remove everything
Diffstat (limited to 'Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs')
-rw-r--r--Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs47
1 files changed, 0 insertions, 47 deletions
diff --git a/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs b/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs
deleted file mode 100644
index 7b45595..0000000
--- a/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedAudioSource.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using UnityEngine;
-
-namespace Lean.Localization
-{
- /// <summary>This component will update an AudioSource component with localized text, or use a fallback if none is found.</summary>
- [ExecuteInEditMode]
- [DisallowMultipleComponent]
- [RequireComponent(typeof(AudioSource))]
- [HelpURL(LeanLocalization.HelpUrlPrefix + "LeanLocalizedAudioSource")]
- [AddComponentMenu(LeanLocalization.ComponentPathPrefix + "Localized AudioSource")]
- public class LeanLocalizedAudioSource : LeanLocalizedBehaviour
- {
- [Tooltip("If PhraseName couldn't be found, this clip will be used")]
- public AudioClip FallbackAudioClip;
-
- // This gets called every time the translation needs updating
- public override void UpdateTranslation(LeanTranslation translation)
- {
- // Get the AudioSource component attached to this GameObject
- var audioSource = GetComponent<AudioSource>();
-
- // Use translation?
- if (translation != null && translation.Data is AudioClip)
- {
- audioSource.clip = (AudioClip)translation.Data;
- }
- // Use fallback?
- else
- {
- audioSource.clip = FallbackAudioClip;
- }
- }
-
- protected virtual void Awake()
- {
- // Should we set FallbackAudioClip?
- if (FallbackAudioClip == null)
- {
- // Get the AudioSource component attached to this GameObject
- var audioSource = GetComponent<AudioSource>();
-
- // Copy current sprite to fallback
- FallbackAudioClip = audioSource.clip;
- }
- }
- }
-} \ No newline at end of file