diff options
| author | Andrew Lee <alee14498@gmail.com> | 2019-11-03 18:31:04 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@gmail.com> | 2019-11-03 18:31:04 -0500 |
| commit | e8dd5d4fd406e6e6b710cbe85309f6870bccc37a (patch) | |
| tree | db0e99cfdbefb1625d66d07631f43565ae8ff41f /Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedRenderer.cs | |
| parent | 20b14c9a89821e6592bf25bed9329a5abe20495c (diff) | |
| download | Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.tar.gz Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.tar.bz2 Unicity-e8dd5d4fd406e6e6b710cbe85309f6870bccc37a.zip | |
Remove everything
Diffstat (limited to 'Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedRenderer.cs')
| -rw-r--r-- | Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedRenderer.cs | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedRenderer.cs b/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedRenderer.cs deleted file mode 100644 index 701e538..0000000 --- a/Assets/Packages/Lean/Localization/Scripts/Behaviours/LeanLocalizedRenderer.cs +++ /dev/null @@ -1,55 +0,0 @@ -using UnityEngine; - -namespace Lean.Localization -{ - /// <summary>This component will update a Renderer component's sharedMaterial with a localized material, or use a fallback if none is found.</summary> - [ExecuteInEditMode] - [DisallowMultipleComponent] - [RequireComponent(typeof(Renderer))] - [HelpURL(LeanLocalization.HelpUrlPrefix + "LeanLocalizedRenderer")] - [AddComponentMenu(LeanLocalization.ComponentPathPrefix + "Localized Renderer")] - public class LeanLocalizedRenderer : LeanLocalizedBehaviour - { - [Tooltip("If PhraseName couldn't be found, this material will be used")] - public Material FallbackMaterial; - - [Tooltip("The material index you want to replace.")] - public int Index; - - // This gets called every time the translation needs updating - public override void UpdateTranslation(LeanTranslation translation) - { - // Get the Renderer component attached to this GameObject - var renderer = GetComponent<Renderer>(); - - // Get the shared materials of this component - var sharedMaterials = renderer.sharedMaterials; - - // Use translation? - if (translation != null && translation.Data is Material) - { - sharedMaterials[Index] = (Material)translation.Data; - } - // Use fallback? - else - { - sharedMaterials[Index] = FallbackMaterial; - } - - renderer.sharedMaterials = sharedMaterials; - } - - protected virtual void Awake() - { - // Should we set FallbackFont? - if (FallbackMaterial == null) - { - // Get the Renderer component attached to this GameObject - var renderer = GetComponent<Renderer>(); - - // Copy current material to fallback - FallbackMaterial = renderer.sharedMaterials[Index]; - } - } - } -}
\ No newline at end of file |
